The AHP Pairwise Process

How the Analytic Hierarchy Process pairwise comparison process works.

Bill Adams
DLProdTeam
6 min readNov 15, 2017

--

The Analytic Hierarchy Process (AHP) was developed in the 1970’s by Dr. Thomas Saaty as a method to organize and analyze complex decisions. (See the AHP Wikipedia Article for more information on the history and details of the subject.) Essentially it consists of the following steps:

  1. Break up the complex decision into simple pieces
  2. Perform easy to understand comparisons on the simple pieces
  3. Mathematically glue those simple decisions back together to answer the original complex decision.

Step 2 above is the pairwise comparison process. In this article we answer the following questions

  1. What is the point of pairwise comparisons?
  2. How do we do pairwise comparisons?
  3. How do we convert pairwise comparison information into priorities, and why is the eigenvector used to do this?

Our example decision

In order to answer these questions, we use a single example decision throughout the discussion, choosing your next car purchase. For this decision we assume we have broken the decision down to the following pieces:

  • Safety, Style, Comfort

Why pairwise compare?

For our example decision, we need to know the importance of Safety, Style, and Comfort to our car choice dilemma. That importance needs to be represented as percentage importance in the AHP theory. For example:

which would mean that Safety is most important to you, then Style then Comfort, and by those fixed amounts. The decimal version of these numbers is called the priority vector.

However, it is very difficult for someone to come up with these percentages for any given problem. We need a method to derive these priorities from simpler to understand pieces. In our example above, note that:

  • Safety is twice as important as Style (0.6 versus 0.3 respectively)
  • Style is 3 times more important than Comfort (0.3 versus 0.1)
  • Safety is 6 times more important than Comfort (0.6 versus 0.1)

This process of saying “A is ___ better than B” is called pairwise comparison. The data for the comparison can be placed into a table in the following way.

Note 1: the question “A is _____ better than B” is much easier to answer than the percentage importance question.

Note 2: we pairwise compare items because we need to know the percentage importance of the items (priority vector) for the AHP; yet that priority vector is difficult, or impossible, to come up with directly.

Recap

  1. We need a priority vector for Safety, Style, Comfort
  2. We gave an example priority vector of 0.6, 0.3, 0.1
  3. We used that priority vector to get a pairwise comparison table, and we noticed that pairwise comparison is much easier to do.

Question: Can we work the other way around and start with a pairwise comparison table, and work backwards to get a priority vector? If so, we can use the easy to answer pairwise comparison questions to create the priority vector the AHP theory needs. The answer is… yes we can and we show how in the next section.

Getting a priority vector from pairwise when votes are consistent

To understand this process, let us look at our example table for Safety, Style, Comfort and highlight the first column.

That column of [1, 1/2, 1/6] is almost a priority vector, only the numbers do not sum to 1 (they add up to 10/6). If we divide each entry by 10/6 they turn into

which do add up to 1! This process of dividing by the sum always makes the numbers total up to 1.

The same thing happens if we do this on the Style and Comfort columns. That is the priority vector we started with!

Warning 1: this is not the whole story. This idea works in this case because our pairwise comparisons are consistent, i.e. we said Safety is 2x better than Style, which is 3x better than Comfort and that Safety is 6x better than Comfort, which we could derive from the 2x and 3x better votes. Votes need not always be consistent

Recap

  1. When votes are consistent, it is easy to get a priority vector from the pairwise table
  2. Take any column and divide by the sum of that column.

What to do for inconsistent matrices?

We need an example of an inconsistent pairwise comparison set, so let’s adjust our previous example slightly and change the vote for Safety versus Comfort from a 6 to a 4, giving us the following pairwise comparison matrix.

  • If we divide the Safety column by its sum — 7/4 — we get:
  • For the Style column, it is the same, and we get
  • Lastly for the Comfort column, its sum is 8, and dividing results in

Because of the inconsistency of the votes, these are not the same! What do we do?

The solution

It is natural to expect the answer to be an average of those 3 values, and we do essentially that.

Key Idea: take the weighted average of the columns of the pairwise matrix over and over. The idea being that the more import columns should have more weight.

Step 1

We start by assuming that all columns are equally weighted and calculate the weighted average of the Safety, Style, and Comfort columns.

For the Weighted Avg column, we multiplied each column by its weight (1/3 in this case) and added together. The last column is the Weighted Avg column divided by its sum (to make the numbers add to one).

First estimate of priorities: We now have an estimate for the priority vector

Step 2: Continue

To continue we take the weighted average of the columns of the original pairwise comparison matrix using the new weights:

Next estimate

Step 3: Continue until the results stabilize

With our new estimate of priorities above, we have new weights to do the calculation again. We do this over and over again until the results stabilize. The results of these steps for our pairwise table are shown below.

Conclusion

The steps outlined above are called the Largest Eigenvector calculation. This calculation is precisely what we use to derive the priorities from a pairwise comparison table in the Analytic Hierarchy Process.

--

--