TOPSIS Implementation using Python
Project description
TOPSIS Implementation in Python
Topsis-Roushni-102316119
📌 Overview
This project implements TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) — a multi-criteria decision-making (MCDM) method used to rank alternatives based on their distance from the ideal best and ideal worst solutions.
The project includes:
- ✔ Command Line Interface (CLI)
- ✔ Complete input validation & error handling
- ✔ Python package uploaded to PyPI
- ✔ Proper packaging using setuptools
- ✔ Public GitHub repository
🧠 Mathematical Steps of TOPSIS
- Construct the decision matrix
- Normalize the matrix
- Multiply by weights
- Determine Ideal Best and Ideal Worst
- Calculate Euclidean distances
- Compute TOPSIS score
- Rank alternatives
📦 Installation (From PyPI)
Install directly from PyPI:
pip install Topsis-Roushni-102316119
💻 Usage
After installation, run:
topsis <InputDataFile> <Weights> <Impacts> <OutputResultFileName>
Example:
topsis data.csv "1,1,1,2" "+,+,-,+" output.csv
📄 Input Requirements
- Input file must contain at least three columns
- First column → Alternatives
- Remaining columns → Numeric values only
- Number of weights = number of impacts
- Impacts must be either
+(benefit) or-(cost) - Weights and impacts must be comma-separated
📊 Output
The output CSV file contains:
- Original data
- TOPSIS Score
- Rank (1 = Best)
🔒 Error Handling Implemented
The program checks for:
- Incorrect number of parameters
- File not found
- Insufficient columns
- Non-numeric values
- Mismatch in weights and impacts
- Invalid impact symbols
🚀 Live Package
🔗 PyPI Link:
https://pypi.org/project/Topsis-Roushni-102316119/
👩💻 Author
Roushni Sharma
B.Tech Student
Thapar Institute of Engineering and Technology
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file topsis_roushni_102316119-1.0.1.tar.gz.
File metadata
- Download URL: topsis_roushni_102316119-1.0.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7da9e463254c903de0ddb154cab83d0a3d713247f2d515a30573db5c05527bb0
|
|
| MD5 |
c5d4791fdb5f61ed2fe16030f37e54f5
|
|
| BLAKE2b-256 |
d9dc0144d8cd9024d9ac2cea7be94e8257a3e3626ed1c81eac4bfaf96bf7c5de
|
File details
Details for the file topsis_roushni_102316119-1.0.1-py3-none-any.whl.
File metadata
- Download URL: topsis_roushni_102316119-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b2ed5aa2e9cd1ff60b7f00f6d524e8ecafa38a50caf4b4c037f818f4fee34d3
|
|
| MD5 |
df628fcf62675f999e7c09c670e8eccb
|
|
| BLAKE2b-256 |
572a292bbe3bf4531496863f80cd0c739d04e9f0f8cb0f59d1acd08e7179e06b
|