npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sg-ahp-lite

v1.2.0

Published

This is a minimal and optimised implementation of AHP algorithm for multi-criteria decision-making and prescriptive analytics.

Downloads

18

Readme

teamslogup Fork Version

Fork for round precision result


const linearAlgebra = require('linear-algebra')();
const Matrix = linearAlgebra.Matrix; `
	
const ahp = require('ahp-lite');

AHP Lite

Codacy Badge npm version GitHub license Greenkeeper badge

This is a simplified implementation in Javascript for NodeJS of the algorithm AHP (Analytic Hierarchy Proccess) created by Saaty in 1986. This method is utilised in the field of prescriptive analytics, operations research, decision science and managerial accouting to methodically asign weighting to conflicting criteria based on systematic and hierchical subjective judgement.

Installation

npm i ahp

Example Usage

const c = new Matrix([[1, 0.33, 0.2], [3, 1, 0.14], [5, 7, 1]]); // Criteria assessment matrix.

ahp.getWeights(c);

Returns:

{ ev: [ 0.1, 0.19, 0.71 ], ci: 0.12, cr: 0.21 }

Documentation

INPUT

| Argument | Description | Mandatory | Type | Rules | |:-------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:----------:|:-----------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| | c | c argument stands for 'criteria matrix' and is a matrix that contains the data from comparative judgement between criteria based on Saaty scale. (READ BIBLIOGRAPHY) | True | Matrix of numeric data | This argument MUST be a matrix object from linear-algebra module and MUST contain only numeric data. |

OUTPUT

| Property | Description | Type | |:-------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-----------------------:| | ev | ev property stands for 'eigenvector' and is an array that contains the weights of each criteria. | Array of numeric data. | | ci | ci property stands for 'consistency index' this is an indicator of inconsistency. | Float number. | | cr | cr property stands for 'consistency ratio' this is the standarised indicator of inconsistency, higher than 0.2 should be reviewed. | Float number. |

NOTE: Make sure to read through bibliography below of AHP to understand how the algorithm works.

Package roadmap

  • [x] AHP.
  • [x] Support for Linear-Algebra matrices.
  • [ ] Support for MathJS matrices.
  • [ ] Support for Group decision-making.
  • [ ] (FAHP) Fuzzy AHP.
  • [ ] (IFAHP) Intuisionistic Fuzzy AHP.
  • [ ] (NAHP) Neutrosophic AHP.
  • [ ] (ANP) Analytic Network Process.
  • [ ] (NNP) Neural Network Process.

Package Dependencies

  • linear-algebra

License

MIT

Contributing

https://github.com/patelotech/ahp-lite

Linting

Configuration

  • Eslint v-5.11.1 // AIRBNB Configuration

Linting scripts

  • Error checl: npm run lint
  • Error fix: npm run lint-fix or npm run lint -- --fix

Bibliography

  • Saaty, R. W. (1987). The analytic hierarchy process—what it is and how it is used. Mathematical Modelling, 9(3-5), 167. doi:10.1016/0270-0255(87)90473-8
  • Saaty, T. L. (1986). Axiomatic Foundation of the Analytic Hierarchy Process. Management Science, 32(7), 841. doi:10.1287/mnsc.32.7.841
  • Saaty, T. L. (1978). Exploring the interface between hierarchies, multiple objectives and fuzzy sets. Fuzzy Sets and Systems, 1(1), 57–68. doi:10.1016/0165-0114(78)90032-5
  • Saaty, T. L. (2008). Decision making with the analytic hierarchy process. International journal of services sciences, 1(1), 83-98.
  • Aczél, J., & Saaty, T. L. (1983). Procedures for synthesizing ratio judgements. Journal of Mathematical Psychology, 27(1), 97. doi:10.1016/0022-2496(83)90028-7