Overview
TOPSIS evaluates conflicting criteria through two reference points: the best weighted combination and the least desirable weighted combination. The highest relative-closeness score ranks first.
How DecisioQ calculates TOPSIS
- Normalize every criterion using the observed option minimum and maximum.
- For
Maximize, use(value - minimum)/(maximum - minimum); forMinimize, use(maximum - value)/(maximum - minimum). - Multiply each normalized value by its normalized criterion weight.
- Select the greatest weighted value as ideal and the smallest as anti-ideal.
- Calculate Euclidean distance to both reference points.
- Calculate relative closeness, round to six decimals, and rank descending.
Formula details
For option i: D_i+ = sqrt(sum((v_ij - v_j+)^2)), D_i- = sqrt(sum((v_ij - v_j-)^2)), and C_i = D_i-/(D_i+ + D_i-). If both distances are zero, DecisioQ returns zero.
When TOPSIS may fit
Use TOPSIS when criteria conflict and closeness to an ideal combination matters. It explicitly considers both desirable and undesirable reference points.
- Strong performance in one criterion can offset weakness in another.
- Weights and normalization materially influence ranking.
- Changing the option set can change normalization ranges and scores.
Verified supplier example
Quality is maximized; cost and delivery time are minimized.
{
"algorithm": "TOPSIS",
"weightStrategy": "Expert",
"criteria": [
{"name":"Quality","weight":0.5,"direction":"Maximize"},
{"name":"Cost","weight":0.3,"direction":"Minimize"},
{"name":"DeliveryDays","weight":0.2,"direction":"Minimize"}
],
"options": [
{"optionId":"A","name":"Supplier A","scores":{"Quality":90,"Cost":250,"DeliveryDays":5}},
{"optionId":"B","name":"Supplier B","scores":{"Quality":80,"Cost":180,"DeliveryDays":3}},
{"optionId":"C","name":"Supplier C","scores":{"Quality":70,"Cost":100,"DeliveryDays":7}}
]
}{"decisionResult":{"winner":"A","ranking":[{"optionId":"A","score":0.617218},{"optionId":"B","score":0.540706},{"optionId":"C","score":0.357775}]},"configurationUsed":{"rankingAlgorithm":{"value":"TOPSIS","source":"ExplicitRequest"}}}Supplier A ranks first because its quality and delivery performance place it closest to the weighted ideal overall despite its higher cost.
Weights are established before TOPSIS
Each path produces normalized effective criterion weights. TOPSIS is a separate stage that ranks options using those weights; AHP is not an alternative ranking algorithm.
TOPSIS versus WSM
Neither method is universally better. TOPSIS evaluates closeness to reference profiles; WSM calculates a direct weighted total.
| Consideration | TOPSIS | WSM |
|---|---|---|
| How it ranks | Closeness to the ideal profile and distance from the least-desirable profile. | Weighted sum of normalized criterion scores. |
| How to interpret the result | Overall closeness to two reference profiles. | A direct total in which strength in one area can offset weakness in another. |
| Reproducing the calculation | More steps; practical with a spreadsheet. | Fewer steps; easy to check with a calculator or spreadsheet. |
API usage
POST /api/v1/decide with Authorization: Bearer <token>. Never place production tokens in documentation or browser source.