Click to get the blogger’s contact information

directory

  • The idea of analytic hierarchy process
  • Analytic hierarchy Process
  • Specific Cases (municipal engineering project construction decision)
    • 1. Ask questions
    • 2. Build a hierarchical structure
    • 3. Construct the judgment matrix (paired comparison matrix) and assign values
    • 4. Hierarchical single sort (weight vector calculation) and test (consistency test)
      • Compute weight vector
      • Consistency test
    • 5. Hierarchical total Sorting (combined weight vector) and test (consistency test)
    • 6. Result analysis
    • 7. Advantages and disadvantages of AHP
  • Analytic Hierarchy Process code implementation (MATLAB)

The idea of analytic hierarchy process

The idea of analytic hierarchy process: all the problems to be analyzed hierarchically; According to the nature of the problem and the general goal to be reached, the problem is divided into different component factors, and according to the correlation between these factors, namely their affiliation relationship, the factors are aggregated and combined according to different levels to form a multi-level analysis structure model. Finally, the merits and demerits of the problem are compared and sorted.

Analytic hierarchy Process

2. Construct judgment matrix and assign values. 3. Hierarchical single ordering (weight vector calculation) and test (consistency test)

Specific Cases (municipal engineering project construction decision)

1. Ask questions

City managers need to decide on a public works project. The options are to build a highway to a tourist area or an urban subway. In addition to considering economic benefits, social benefits, environmental benefits and other factors should be considered, that is, multi-criteria decision-making problem, considering the use of analytic hierarchy process to solve.

2. Build a hierarchical structure

1. Clear decision objective: “Reasonable construction of municipal engineering, so that the highest comprehensive benefit”.

2. In order to achieve this goal, there are three main criteria to be considered, namely, economic, social and environmental benefits. Also must consider the direct economic benefits, indirect economic benefits, convenient daily travel, convenient holiday travel, reduce environmental pollution, improve the city appearance and other factors (criteria), from the correlation analysis, these factors belong to the main criteria, therefore placed in the next level consideration, and belongs to different criteria.

3. Solutions, namely building highways or subways, are placed at the lowest level of the hierarchical substructure as measure layer elements.

Thus the hierarchy is formed:

3. Construct the judgment matrix (paired comparison matrix) and assign values

1. Method of constructing judgment matrix:

Each element that has a downward membership is calledguidelines) as a judgment matrixThe first element(upper left corner),membershipIn all its partsThe elementNext in orderThe first lineandThe first column.

As shown below:



2. How to assign the judgment matrix:

Ask the fillers (experts) repeatedly: according to the criteria of the judgment matrix, which of the two elements is important and how important is it, and assign a value of 1-9 to the importance degree.

(It can be likened to the membership degree of fuzzy PID, which is artificially set and criticized by people)



Assume that the filled judgment matrix is A=(aij)n×n, and the judgment matrix has the following properties:

(1) aij>0

(2) aji=1/ aji

(3) aii=1

The judgment matrix has symmetry, so when filling in, usually fill in the part AII =1 first, and then only judge and fill in the n(n-1)/2 elements of the upper triangle or the lower triangle.

In special cases, the judgment matrix can be transitive, that is, it satisfies the equation: AIj *ajk= AIk.

When the above formula is true for all elements of the judgment matrix, the judgment matrix is called consistency matrix.

For the above example, the following judgment matrix can be constructed:

4. Hierarchical single sort (weight vector calculation) and test (consistency test)

Compute weight vector

For the judgment matrix filled by experts, some mathematical methods are used to carry out hierarchical ordering. Hierarchical single ranking refers to the relative weight of each factor of each judgment matrix against its criteria, so it is essentially to calculate the weight vector. Here is a brief introduction to the sum method: for consistency judgment matrix, each column is the corresponding weight after normalization. For the non-consistent judgment matrix, the corresponding weight of each column is approximated after normalization, and the arithmetic mean value of the N column vectors is taken as the final weight.

Formula:

In the hierarchical sorting, the consistency test of the judgment matrix should be carried out. The judgment matrix can be transitive and consistent. In general, the judgment matrix is not required to strictly satisfy this property.

But look from the law of human knowledge, A correct judgement matrix of importance is the logical law, for example, if A is more important than B, B is more important than C, then logically, A should be more important than C is obvious, if two compare when the result of A is more important than C, then the judgment matrix in violation of the consistency criterion, it is not reasonable in logic.

Therefore, in practice, the judgment matrix is required to meet the general consistency, which requires consistency test. Only through the test can it be proved that the judgment matrix is logically reasonable and the analysis of the results can be continued.

Consistency test

Step one, calculateConsistency index CI



Second, check the table to determine the correspondingMean random consistency index RI

According to the different orders of the judgment matrix, the average random consistency index RI can be obtained by referring to the following table:



The third step is to calculate the consistency ratio CR and judge:



When C.R.<0.1, the consistency of the judgment matrix is considered acceptable; when C.R.>0.1, the judgment matrix is considered inconsistent and needs to be revised.

Figure 1 Figure 2

It can be seen that all single-ordered C.R.<0.1 consider the consistency of each judgment matrix acceptable.

5. Hierarchical total Sorting (combined weight vector) and test (consistency test)

Total ranking refers to the relative weight of each factor of each judgment matrix to the target layer (uppermost). This weight is calculated from the top down, layer by layer synthesis.

The literal description formula is as follows:

The calculation process is as follows to better understand the process: P (C1 / A) = P (C1 / B1) * P (B1 / A) = 0.5 * 0.1429 = 0.07145 CR = CR (C1 / A) * (C/B) CR (B/A) = 0 * 0 = 0, P (D1 / A) = P (D1 / C1) * P(C1/B1) * P(B1/A) + P(D1/C2) * P(C2/B1) * P(B1/A) + P(D1/C3) * P(C3/B2) * P(B2/A) + P(D1/C4) * P(C4/B2) * P(B2/A) + P (D1 / C5) * P (C5 / B3) * P (B3 / A) + P (D1 / C6) * P (C6 / B3) * P (B3 / A) = 0.8333 * 0.5 * 0.1429 * 0.5 * 0.1429 + 0.1667 + 0.75 * 0.75 * 0.4286 +0.8750 * 0.25 * 0.4286 +0.1667 * 0.75 * 0.4286 +0.8333 * 0.25 * 0.4286

6. Result analysis

According to the overall ranking result of scheme level, the weight of building subway (D2) (0.6592) is far greater than that of building expressway (D1) (0.3408). Therefore, the final decision scheme is to build subway. Analyze the decision-making ideas according to the hierarchical sorting process:

1. For the three factors of criterion layer B, the weight of direct economic benefit (B1) is the lowest (0.1429), while the weight of social benefit (B2) and environmental benefit (B3) is relatively high (0.4286), indicating that social benefit and environmental benefit are more important in decision-making. 2, for don’t care about economic benefits, the impact of two factors (C1) direct economic benefits, indirect drive benefit weight (C2) single sequences are a highway is far greater than subways, with regard to social benefits and environmental benefits are valued, four factors of the effects of the three factors of single sort weights are built subway is much larger than a highway, which can indicate, Due to the outstanding social and environmental benefits, the weight of subway construction scheme will be relatively prominent. 3. It can also be seen from the overall ranking results of criterion layer C that convenience for daily travel (C3) and reduction of environmental pollution (C5) are of large weight values. If these two factors are considered separately, the ranking of schemes is far greater than that of highways.

From this, we can analyze the thinking of decision-making: that is, decision-making attaches more importance to social and environmental benefits than to economic benefits; (Summary criterion layer B) Therefore, for specific factors, convenience for daily travel and reduction of environmental pollution become the main factors to be considered. For both of these factors, the subway construction scheme is better. (Summary criterion Layer C) Therefore, the final scheme to choose subway construction is logical.

7. Advantages and disadvantages of AHP

Advantages: (1) Systematicness: Hierarchical analysis takes the object of study as a system and makes decisions in accordance with decomposition, comparative judgment and comprehensive thinking mode, which has become an important tool of system analysis developed after mechanism analysis and statistical analysis. (2) Practicability: Ahp combines qualitative and quantitative methods, and can deal with many practical problems that cannot be started with traditional optimization techniques, with a wide range of applications. At the same time, this method communicates with decision makers and decision analysts, and decision makers can even apply it directly, which increases the understanding and mastery of decision makers. (3) Simplicity: people with medium education level can understand the basic principles of analytic hierarchy process and master its basic steps. The calculation is also very simple, and the results obtained are simple and clear, and easy for decision makers to understand and master.

Disadvantages: old: can only choose from the original scheme, can not generate a new scheme; Rough: its comparison, judgment until the results are rough, not suitable for high precision requirements of the problem; Subjective: from the establishment of hierarchical structure model to the establishment of pair-comparison matrix, human subjective factors play a very important role, which makes the decision results may be difficult to be accepted by the public. Of course, adopting expert group judgment is one way to overcome this shortcoming.

Analytic Hierarchy Process code implementation (MATLAB)

disp('Please enter judgment matrix A(order n)');
A=input('A=');
[n,n]=size(A);
x=ones(n,100);
y=ones(n,100);
m=zeros(1.100);
m(1) =max(x(:,1));
y(:,1) =x(:,1);
x(:,2)=A*y(:,1);
m(2) =max(x(:,2));
y(:,2) =x(:,2) /m(2);
p=0.0001; i=2; k=abs(m(2) -m(1));
while  k>p
  i=i+1;
  x(:,i)=A*y(:,i- 1);
  m(i)=max(x(:,i));
  y(:,i)=x(:,i)/m(i);
  k=abs(m(i)-m(i- 1));
end
a=sum(y(:,i));
w=y(:,i)/a;
t=m(i);
disp(w);disp(t); % below is the consistency test CI=(t-n)/(n- 1); RI=[0 0 0.52 0.89 1.12 1.26 1.36 1.41 1.46 1.49 1.52 1.54 1.56 1.58 1.59];
CR=CI/RI(n);
if CR<0.10
    disp('The consistency of this matrix is acceptable! ');
    disp('CI=');disp(CI);
    disp('CR=');disp(CR);
end
Copy the code

Example:

Save the above code as test1 and add it to the path when the point is run;

The input A matrix is going to be input as A vector;

Then press Enter and you can see that the result is the same as in step 4.



By continuously using this formula to calculate the weight vectors of the corresponding matrices (criterion layer B to criterion layer C, criterion layer C to scheme layer D), the final result can be obtained.

Simply modify the above procedure, pass in the parameter matrix, so that you do not have to play every time.

function w= test1(A)
% disp('Please enter judgment matrix A(order n)');
% A=input('A=');
[n,n]=size(A);
x=ones(n,100);
y=ones(n,100);
m=zeros(1.100);
m(1) =max(x(:,1));
y(:,1) =x(:,1);
x(:,2)=A*y(:,1);
m(2) =max(x(:,2));
y(:,2) =x(:,2) /m(2);
p=0.0001; i=2; k=abs(m(2) -m(1));
while  k>p
  i=i+1;
  x(:,i)=A*y(:,i- 1);
  m(i)=max(x(:,i));
  y(:,i)=x(:,i)/m(i);
  k=abs(m(i)-m(i- 1));
end
a=sum(y(:,i));
w=y(:,i)/a;
t=m(i);
disp(w);disp(t); % below is the consistency test CI=(t-n)/(n- 1); RI=[0 0 0.52 0.89 1.12 1.26 1.36 1.41 1.46 1.49 1.52 1.54 1.56 1.58 1.59];
CR=CI/RI(n);
if CR<0.10
    disp('The consistency of this matrix is acceptable! ');
    disp('CI=');disp(CI);
    disp('CR=');disp(CR);
end
Copy the code

Input:

Array1=[1 1/3 1/3;3 1 1;3 1 1];
Array2=[1 1;1 1];
Array3=[1 3;1/3 1];
Array4=[1 3;1/3 1];
Array5=[1 5;1/5 1];
Array6=[1 3;1/3 1];
Array7=[1 1/5;5 1];
Array8=[1 7;1/7 1];
Array9=[1 1/5;5 1];
Array10=[1 1/3;7 1];

A=test1(Array1);
B1=test1(Array2);
B2=test1(Array3); 
B3=test1(Array4);
C1=test1(Array5);
C2=test1(Array6);
C3=test1(Array7);
C4=test1(Array8);
C5=test1(Array9);
C6=test1(Array10);
Copy the code

Obtain the corresponding matrix: