analytical_hierarchy_processxxxxxxxxxxanalytical_hierarchy_process(A)analytical_hierarchy_process(A, method)xxxxxxxxxxW, CI, CR = analytical_hierarchy_process(A)The Analytic Hierarchy Process is a mathematical model for decision-making problems developed by Thomas L. Saaty.
Computes the weight of each element according to pairwise comparison matrix A.
The eigenvector of A corresponding to the maximum eigenvalue is chosen as the weight vector as default.
The consistency index and ratio are returned along with the weight vector.
xxxxxxxxxxW, CI, CR = analytical_hierarchy_process(A, method)method specifies the way how to compute the weight vector.
Default is eigenvector.
xxxxxxxxxx>>> from OpenHA.assessment.system import analytical_hierarchy_process>>> import numpy as np>>> A = np.array([1, 1/2, 4, 3, 3, 2, 1, 7, 5, 5, 1/4, 1/7, 1, 1/2, 1/3, 1/3, 1/5, 2, 1, 1, 1/3, 1/5, 3, 1, 1]).reshape((-5, 5))>>> w, ci, cr = analytical_hierarchy_process(A)>>> print(w, ci, cr)
[[0.26360349] [0.47583538] [0.0538146 ] [0.09806829] [0.10867824]] 0.018021102142554035 0.01609026977013753
A —— The n-by-n pairwise comparison matrix.
method —— str, optional. It specifies the way how to compute the weights vector, specified as eigenvector (default), geometric_mean, or arithmetic_mean.
For example, assuming a comparison matrix
eigenvector: The eigenvector corresponding to the maximum eigenvalue.geometric_mean: the geometric mean of each row of matrix A.That is,
arithmetic_mean: the arithmetic mean of each row of matrix A.| Name of the parameters | Is optional? | Source, dialog or input port? |
|---|---|---|
A | No | Dialog |
method | Yes | Dialog |
A tuple (W, CI, CR), where W is the weight vector of length n, CI is the Consistency Index, and CR is the Consistency Ratio.
where
It is used as a measure of the closeness of
It can be noted that if
In order to check consistency, Satty uses both the consistency index and another measure called the random index
| n | 1 | 2 | 3 | 4 | 5 | 6 | 6 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| RI | 0.00 | 0.00 | 0.58 | 0.90 | 1.12 | 1.24 | 1.32 | 1.41 | 1.45 | 1.49 |
Since Saaty suggests using the AHP
when the number of objectives is less than 10, this table only lists the
The consistency ratio of a matrix is the ratio of
If the consistency ratio is 0.10 or less, the decision-maker is not too inconsistent and the result obtained by the AHP is acceptable.
[1] G. H. Nguyen, "The Analytic Hierarchy Process: A Mathematical Model for Decision Making Problems" (2014). Senior Independent Study Theses. Paper 6054. https://openworks.wooster.edu/independentstudy/6054