Maritime Science Life

Calculations with context

AHP weights and consistency calculator

Calculate criterion priorities and consistency diagnostics from pairwise comparisons of two to six criteria; follow the principal-eigenvector method step by step.

AHP · 1.0.0

AHP: make the comparisons visible

Compare two to six criteria against one objective. The engine derives the principal right eigenvector and shows its convergence, priorities and consistency diagnostics. This is the criterion-weighting stage of AHP, not a complete alternative hierarchy.

Pairwise judgments

An entry of 3 means the row criterion is judged three times as important as the column criterion for your objective. Below 1 favors the column. Fill the upper triangle only; the diagonal is 1 and the opposite entry is its exact computed reciprocal. No judgment is adjusted to improve consistency.

Use a decimal point or comma, without thousands separators. Scientific notation is accepted. AHP also accepts 1/2 through 1/9.

Only visible criteria and alternatives participate. Reducing a count hides entries; increasing it restores them. Reset returns all entries to the teaching example.

Row criterion compared with column criterion

Implementation bounds: 2–6 complete criteria; all ratios 1/9–9. The principal-eigenvector iteration stops only when both maximum weight change and relative residual are ≤10⁻¹³, up to 2,000 iterations. A failure to converge produces no priorities. These are software bounds.

The method and worked example below are readable without JavaScript.

Inputs and CSV files are processed in this page. These tools send no calculator data and use no persistent storage. Download begins only after an explicit click.

From reciprocal comparisons to priorities

One objective, three criteria, one priority vectorThe fictional maintenance objective connects to risk reduction, downtime and resource need. Their reciprocal comparison matrix has rows one two four; one-half one two; one-quarter one-half one. Its principal eigenvector gives weights four-sevenths, two-sevenths and one-seventh. This figure shows the criteria-weighting stage only.Compare maintenance prioritiesRisk reductionDowntimeResource needPAIRWISE RATIOS1241/2121/41/21PRINCIPAL EIGENVECTOR4/72/71/7
The exact worked example: reciprocal ratios 4:2:1 produce priorities 4/7, 2/7 and 1/7. Only the local criterion level is shown.

Equations and symbol key

aⱼᵢ = 1/aᵢⱼ · aᵢᵢ = 1

Aw = λmax w · Σwᵢ = 1

CI = (λmax − n)/(n − 1) · CR = CI/RI

Symbols used in this implementation
SymbolMeaning
A = [aᵢⱼ]Complete reciprocal comparison matrix; row i compared with column j
nNumber of criteria, 2–6
wᵢCriterion i priority; positive, dimensionless; sum is 1
λmaxPrincipal eigenvalue; numerical estimate Σ(Aw) for normalized w
CIConsistency index (λmax − n)/(n − 1)
RIDeclared reference random index for matrix order n
CRCI/RI when RI > 0; undefined for n = 2

Saaty’s scale anchors are 1 equal, 3 moderate, 5 strong, 7 very strong and 9 extreme preference; 2, 4, 6 and 8 are intermediate values. Reciprocals reverse the comparison. This implementation accepts continuous ratios inside [1/9, 9], so distinguish a measured ratio from a verbal judgment.

Define one objective and criteria that mean the same thing throughout the comparison. Discuss the performance ranges and evidence behind each judgment. Avoid overlapping criteria that count the same consequence twice.

Build A with aᵢᵢ = 1 and aⱼᵢ = 1/aᵢⱼ. Perfect consistency additionally requires aᵢⱼ × aⱼₖ = aᵢₖ; reciprocity alone does not ensure it. The interface enforces reciprocity, not transitivity.

Begin with equal positive weights. Repeatedly calculate u = Aw and w = u/Σu. The final vector solves Aw = λmax w with Σw = 1. This is power iteration for the principal right eigenvector; it is not the normalized-column row-average approximation or geometric-mean method.

At the final vector calculate Aw, λmax = Σ(Aw), and each ratio (Aw)ᵢ/wᵢ. They should agree within numerical tolerance. The relative residual is max|Aw − λmax w| / max|Aw|. Convergence checks numerical solution, not the truth of the judgments.

CI = (λmax − n)/(n − 1). CR = CI/RI when RI > 0. For n = 2, RI = 0 and CR is undefined; a positive reciprocal two-criterion matrix is necessarily consistent. Tiny negative CI from floating-point rounding is shown as zero and disclosed.

RI is a declared convention

This implementation uses the Saaty (2008), EJPAM Table 5 (p. 129), simulation table: n = 2, 3, 4, 5, 6 → RI = 0, 0.52, 0.89, 1.11, 1.25. Other published RI tables give different CR values for the same matrix. The RI table is not attributed to the distinct IJSSCI 2008 introductory paper.

RI · Saaty (2008), EJPAM Table 5
nRI
20
30.52
40.89
51.11
61.25

Worked article: compare fictional ship-maintenance programs

For a fictional maintenance-planning exercise, a team considers risk reduction, downtime and resource need. Assume it judges risk reduction twice as important as downtime, four times as important as resource need, and downtime twice as important as resource need.

The resulting matrix is [[1, 2, 4], [1/2, 1, 2], [1/4, 1/2, 1]]. Its known ratio vector is (4, 2, 1), so the normalized weights are (4/7, 2/7, 1/7): about 57.142857%, 28.571429% and 14.285714%.

Here Aw = 3w, λmax = 3, CI = 0 and CR = 0 apart from numerical rounding. This deliberately consistent example demonstrates the arithmetic; it does not show that the priorities are right for any vessel.

Try changing the first comparison from 2 to 5 while holding the other two fixed. The cycle is no longer transitive. Recalculate and inspect CI, CR and changed priorities. The tool does not silently repair that disagreement.

Follow every calculation step
Input matrix
Risk reductionDowntimeResource need
Risk reduction124
Downtime0.512
Resource need0.250.51
Criterion priorities
CriterionwAw(Aw)ᵢ/wᵢRank
Risk reduction0.57142857141.71428571431
Downtime0.28571428570.857142857132
Resource need0.14285714290.428571428633
λmax · CI · RI · CR
NameValue
λmax3
CI0
RI0.52
CR0
Iterations2
Relative eigen-equation residual0
max |Δw|1.110223025e-16

This tool uses a uniform CR > 0.10 review flag as its declared convention. The cited EJPAM paper also discusses stricter size-specific guidance (0.05 for three criteria and 0.08 for four). These are prompts to revisit judgments, not binary correctness tests. A small CR cannot establish sound criteria, unbiased opinions, valid measurements or a safe decision. Review the assumptions rather than changing numbers merely to cross a threshold.

Tables display up to 10 significant digits; CSV preserves the computed binary64 values. Ties are grouped within 10⁻¹² of each descending group’s highest score, with competition ranks (1, 1, 3). Display rounding never determines rank.

Interpretation and limits

  • The tool computes only one local criterion-priority vector. A complete AHP decision requires alternative comparisons under the criteria and a stated synthesis rule. It does not compute ANP dependence, group consensus, fuzzy AHP or statistical confidence.
  • A priority is a relative preference weight, not a failure probability, money allocation or measured risk. Safety obligations and mandatory limits must be assessed separately rather than traded away by a compensatory score.
  • If these weights are used in TOPSIS, record that this is an AHP-weighted TOPSIS hybrid. Use the same criterion order and meanings. Changing the performance scales or alternative set can change the interpretation and ranking.

Try the TOPSIS ranking example

Primary methods and further reading

Sources checked 8 October 2026. All ship-maintenance values are invented teaching inputs, not measured data. Model version 1.0.0.

Related context

The method explanation and worked example are on this page. The articles below provide additional context.

All calculators