TOPSIS
Overview
TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) ranks optimization trials by scoring each trial based on its distance from the ideal solution (best possible) and the anti-ideal solution (worst possible). Score 1 = ideal, Score 0 = worst.
For each trial, Tunny Dashboard provides:
| Output | Description |
|---|---|
| TOPSIS score | Each trial's score (0–1, higher is closer to ideal) |
| Ranking | Trials ordered from highest score to lowest |
| Positive ideal (A+) | The best value of every objective, combined |
| Negative ideal (A-) | The worst value of every objective, combined |
Algorithm
Given a decision matrix V (m trials × n objectives), TOPSIS computes scores in 6 steps.
Step 1: Vector Normalization
Normalize each objective column j by its Euclidean norm:
This makes objectives with different scales comparable.
Step 2: Weighted Normalized Matrix
Multiply normalized values by user-assigned weights w_j:
Tunny Dashboard normalizes the weights internally so they sum to 1 (mirroring VIKOR; if the weights are invalid, such as all-zero or NaN, uniform weights are used instead). The TOPSIS score is in any case unaffected by uniformly rescaling the weights — only the ratio between weights matters, so [0.7, 0.3] and [7.0, 3.0] give the same result.
Step 3: Ideal and Anti-Ideal Solutions
For each objective, select the best and worst values according to direction:
| Direction | Positive ideal A+_j | Negative ideal A-_j |
|---|---|---|
| minimize | min_i w_ij | max_i w_ij |
| maximize | max_i w_ij | min_i w_ij |
Step 4: Euclidean Distances
Step 5: TOPSIS Score (Relative Closeness)
- score → 1: close to positive ideal (good trial)
- score → 0: close to negative ideal (poor trial)
- D+ + D- = 0: degenerate case → score = 0.5
Step 6: Ranking
Sort by score descending.
Edge Cases
NaN/Inf trials: any trial with a non-finite objective value (NaN or ±Inf) is excluded from computation; its score is set to 0.0 and placed at the end of the ranking.
All trials same value: column norm = 0, so r_ij = 0, and D+ = D- = 0 → score = 0.5.
Weight scale invariance: weights [0.7, 0.3] and [7.0, 3.0] give identical results — only the ratio between weights matters, and Tunny Dashboard normalizes weights to sum to 1 internally.
Complexity
| Step | Cost |
|---|---|
| Normalize | O(m × n) |
| Ideal sols | O(m × n) |
| Distances | O(m × n) |
| Sort | O(m log m) |
| Total | O(m × n + m log m) |
Under 100 ms for 50,000 trials × 4 objectives.
Strengths and Limitations
Strengths
- Aggregates multiple objectives into a single intuitive [0, 1] score
- Handles mixed minimize / maximize directions
- Weights let you tune relative importance in real time
Limitations
- Weight choice is subjective — start with equal weights and adjust sliders
- Rank reversal can occur when alternatives are added or removed
- Objectives with very different scales may not be fully compensated by vector normalization
When to Use
Want a fast, intuitive overall ranking? → TOPSIS
Need to balance utility vs. worst-case? → VIKOR
Want pairwise preference detail? → PROMETHEE
If the relative importance of each objective is unclear, start from equal
weights and check sensitivity with the TOPSIS Ranking chart's sliders.Controls in the App
The TOPSIS Ranking chart lets you:
- Weight sliders: adjust each objective's weight (0–1) in real time, recomputing scores immediately
- Top-N display: switch between showing the top 5, 10, or 20 trials
- Bar click: highlight the selected trial elsewhere in the dashboard
References
- Hwang, C.-L., & Yoon, K. (1981). Multiple Attribute Decision Making: Methods and Applications. Springer. https://doi.org/10.1007/978-3-642-48318-9