# A Simplified Algorithm for Dealing with Inconsistencies Using the Analytic Hierarchy Process
## 2 Materials and Methods  
### Method Overview  
We start with the assumption that inconsistency arises due to incorrect choice of the preference score. As noted in the introduction, several factors may result in such incorrect choice, such as lack of concentration and inappropriate use of extremes to reflect strong preferences. The approach compares the actual and expected preference score for each of the bivariate sets for each individual. Expected value scores have been proposed as a means of simplifying the analysis when there are a large number of alternatives. In such cases, not all comparisons are undertaken and the omitted values are estimated [39; 40]. In this case, the expected value score is compared with the \"actual\" score derived from the information provided by the respondent. The greatest deviation between the actual and expected score is assumed to represent the incorrect response. In this regard, the approach is similar to that proposed by [PERSON] et al. [26], who modified the pairwise comparison matrix using the eigenvector to produce an acceptable consistency level while retaining most of the original comparison information, and similar also to the approach proposed by [PERSON] et al. [36], who replaced the \"most\" inconsistent elements within a comparison matrix with estimates based on other scores. The approach, however, is computationally simpler than both these previous approaches, and can be readily incorporated into code to estimate the weights (see the Supplementary Material for examples of the code).  
The iterative heuristic approach can be summarized as a series of four simple steps:  
1. For each of the comparisons within a set where the consistency ratio (CR) is above the threshold value, estimate the expected value based on the observed values in the other comparisons. For example, for a \(3\times 3\) preference matrix given by \(\begin{bmatrix}1&a_{1,2}&a_{1,3}\\ a_{2,1}&1&a_{2,3}\\ a_{3,1}&a_{3,2}&1\end{bmatrix}\), where \(a_{j,i}=1/a_{ij}\), then if preferences were completely consistent, and assuming transitivity holds, we would expect \(\hat{a}_{1,3}=a_{1,2}\cdot a_{2,3}\), \(\hat{a}_{2,3}=a_{2,1}\cdot a_{1,3}\) and \(\hat{a}_{1,2}=a_{1,3}\cdot a_{3,2}\)[39] where \(\hat{a}_{i,j}\) is the estimated value of \(a_{i,j}\). For consistency with the 9-point scale, the estimated values are restricted to the range \([-1/9,9]\) such that \(\hat{a}_{i,j}=\max\Bigl{[}\min\Bigl{[}a_{i,k}\cdot a_{kj,9}\Bigr{]},1/9\Bigr{]}\);
2. Derive the squared deviation of the expected to actual value, normalized by the actual value e.g., \(\bigl{(}\hat{a}_{i,j}-a_{i,j}\bigr{)}^{2}/a_{i,j}\);
3. Identify the comparison score with the largest normalized squared deviation and replace the actual value with the estimated value in the comparison matrix. In the case where two (or more) estimates have the same (maximum) deviation, both would be replaced with their estimated value;
4. Re-estimate the consistency ratio. If it is still above the threshold value, repeat the process (keeping the expected value from the first round); if it is less than the threshold value, then exit the process and finalize the relative weights.  
The algorithm can be readily implemented in R, with examples of R code provided in the Supplementary Material. A limit on the number of iterations over which the analysis can be run can also be imposed to allow for the case where convergence to a consistent set of comparison scores cannot be achieved in a reasonable number of iterations.