Skip to main content

A Python package for TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) - Multi-Criteria Decision Making

Project description

๐ŸŽฏ TOPSIS

Technique for Order Preference by Similarity to Ideal Solution

PyPI version Python License: MIT Downloads


A powerful multi-criteria decision-making (MCDM) technique used to rank alternatives based on their distance from an ideal best and an ideal worst solution.


๐Ÿ“ฆ Installation โ€ข ๐Ÿš€ Quick Start โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿ‘ค Author



๐Ÿ’ก About

This Python package provides a clean, efficient, and command-line friendly implementation of TOPSIS, designed as part of an academic assignment and packaged professionally for real-world usage via PyPI.


โœจ Key Features

Feature Description
โœ… Standard Compliant Fully compliant with standard TOPSIS methodology
๐Ÿ–ฅ๏ธ CLI Support Easy-to-use command-line interface
๐Ÿ›ก๏ธ Robust Validation Comprehensive input validation and error handling
โš–๏ธ Customizable Supports customizable weights and impacts
๐Ÿ“Š Ranked Output Outputs ranked results with TOPSIS score
๐Ÿชถ Lightweight Minimal dependencies, easy installation via pip


๐Ÿ“ฆ Installation

Install directly from PyPI using pip:

pip install Topsis-Rehnoor-102317137


๐Ÿ–ฅ๏ธ Usage

Run the package from the command line:

python -m topsis <input_file.csv> "<weights>" "<impacts>" <output_file.csv>

๐Ÿ”น Example

python -m topsis data.csv "1,1,1,2" "+,+,-,+" result.csv


๐Ÿ“‚ Input File Format

โš ๏ธ Requirements:

  • โœ”๏ธ Input file must be a CSV file
  • โœ”๏ธ Must contain at least 3 criteria columns
  • โœ”๏ธ First column โ†’ Alternative names (non-numeric)
  • โœ”๏ธ Remaining columns โ†’ Numeric criteria values only

๐Ÿ“‹ Sample Input (data.csv)

Model Cost Performance Maintenance Mileage
M1 250 7.5 5 18
M2 300 8.0 6 20
M3 200 6.5 4 15


๐Ÿ“ค Output File

The output CSV file contains:

  • ๐Ÿ“Œ All original columns
  • ๐Ÿ“Š Topsis Score
  • ๐Ÿ† Rank (Rank 1 = Best Alternative)

๐Ÿ“‹ Sample Output

Model Cost Performance Maintenance Mileage Topsis Score Rank
M2 300 8.0 6 20 0.72 ๐Ÿฅ‡ 1
M1 250 7.5 5 18 0.58 ๐Ÿฅˆ 2
M3 200 6.5 4 15 0.31 ๐Ÿฅ‰ 3


๐Ÿ”ฌ Behind the Scenes (TOPSIS Steps)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    TOPSIS Algorithm                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  1๏ธโƒฃ  Normalize the decision matrix                          โ”‚
โ”‚  2๏ธโƒฃ  Apply user-defined weights                             โ”‚
โ”‚  3๏ธโƒฃ  Determine ideal best and worst solutions               โ”‚
โ”‚  4๏ธโƒฃ  Calculate Euclidean distances (Sโบ and Sโป)              โ”‚
โ”‚  5๏ธโƒฃ  Compute TOPSIS performance score                       โ”‚
โ”‚  6๏ธโƒฃ  Rank alternatives based on scores                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜


๐Ÿ› ๏ธ Technologies Used

Python Pandas NumPy PyPI



๐Ÿ‘ค Author

Rehnoor Aulakh

Computer Science Student

Email



๐Ÿ“„ License

This project is licensed under the MIT License.

License: MIT


โญ If you found this helpful, please consider giving it a star! โญ

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

topsis_rehnoor_102317137-1.0.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

topsis_rehnoor_102317137-1.0.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file topsis_rehnoor_102317137-1.0.0.tar.gz.

File metadata

File hashes

Hashes for topsis_rehnoor_102317137-1.0.0.tar.gz
Algorithm Hash digest
SHA256 30332d1be05f07b03b2eb11e7b3cc5b0bf339e74edf13c7e4da5c9a93573eaf4
MD5 7d57e085da29aaccfe0979397fd272de
BLAKE2b-256 d537474e27e575577387157e6fe26ea88fe79681ee975a9d7459d0b3616ac3c3

See more details on using hashes here.

File details

Details for the file topsis_rehnoor_102317137-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_rehnoor_102317137-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0158169c2bb51ad32a65c04028cd962ec3b8f7f4d0c1ebc113ff595022eb1793
MD5 59438457ab606fd31e4ef7dea7891406
BLAKE2b-256 0e909a5c98d749c4e6b2666b2fb253cba260939bf380360948f09302a9c64900

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page