Skip to content

Instantly share code, notes, and snippets.

View hendriari's full-sized avatar
:octocat:

Hendri ari hendriari

:octocat:
View GitHub Profile
| Situation | Recommended Algorithm |
|------------------------------------------------------------------|------------------------------------------|
| You need users to define importance subjectively via comparisons | AHP |
| You need to validate logical consistency of judgments | AHP |
| You have objective data and pre-defined weights | SAW |
| You need a fast, easy-to-implement solution | SAW |
| You need fine-grained differentiation between close alternatives | TOPSIS |
| Scale of criteria values varies greatly | TOPSIS |
| You want to combine subjective + objective data | AHP for weights → SAW/TOPSIS for scoring |
| Alternative | Price | Performance | Battery |
| ----------- | ----- | ----------- | ------- |
| Laptop A | 0.800 | 0.944 | 0.800 |
| Laptop B | 1.000 | 0.833 | 1.000 |
| Laptop C | 0.667 | 1.000 | 0.667 |
| Alternative | Price (Cost, max=2000) | Performance (Benefit, max=100) | Battery (Benefit, max=200) |
| ----------- | ---------------------- | ------------------------------ | -------------------------- |
| Laptop A | 1500 | 85 | 12 |
| Laptop B | 1200 | 75 | 15 |
| Laptop C | 1800 | 90 | 10 |
| | Price | Camera | Battery |
| ------- | ----- | ------ | ------- |
| Price | 1.000 | 0.200 | 3.000 |
| Camera | 5.000 | 1.000 | 7.000 |
| Battery | 0.333 | 0.143 | 1.000 |
| Algorithm | Available Since | Best For |
| -------------------------------- | --------------- | ----------------------------------------------- |
| AHP (Analytic Hierarchy Process) | v1.0.0 | Subjective weighting via pairwise comparison |
| SAW (Simple Additive Weighting) | v1.1.0 | Simple, fast ranking with known weights |
| TOPSIS | v1.2.0 | Robust ranking based on ideal solution distance |