Skip to main content

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

  1. Construct the decision matrix
  2. Normalize the matrix
  3. Multiply by weights
  4. Determine Ideal Best and Ideal Worst
  5. Calculate Euclidean distances
  6. Compute TOPSIS score
  7. 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


Download files

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

Source Distribution

topsis_roushni_102316119-1.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

topsis_roushni_102316119-1.0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file topsis_roushni_102316119-1.0.1.tar.gz.

File metadata

File hashes

Hashes for topsis_roushni_102316119-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7da9e463254c903de0ddb154cab83d0a3d713247f2d515a30573db5c05527bb0
MD5 c5d4791fdb5f61ed2fe16030f37e54f5
BLAKE2b-256 d9dc0144d8cd9024d9ac2cea7be94e8257a3e3626ed1c81eac4bfaf96bf7c5de

See more details on using hashes here.

File details

Details for the file topsis_roushni_102316119-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_roushni_102316119-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b2ed5aa2e9cd1ff60b7f00f6d524e8ecafa38a50caf4b4c037f818f4fee34d3
MD5 df628fcf62675f999e7c09c670e8eccb
BLAKE2b-256 572a292bbe3bf4531496863f80cd0c739d04e9f0f8cb0f59d1acd08e7179e06b

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