Skip to main content

Command-line implementation of TOPSIS decision making method

Project description

TOPSIS Python Package

This project is a Python command-line tool that implements the TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) method.

TOPSIS is a multi-criteria decision making technique used to rank different alternatives based on their distance from an ideal best solution and an ideal worst solution.

This package allows users to apply the TOPSIS method easily using a single command from the terminal.


Installation

The package can be installed using pip.

pip install Topsis-KhushiMehta-102303769


Usage

After installing the package, the TOPSIS method can be executed from the command line using the following format:

topsis <input_file> <output_file>

Example:

topsis data.csv "1,1,1" "+,+,+" result.csv

Here, input_file : CSV or Excel (.xlsx) file containing the data
weights : Comma-separated numerical values indicating importance of criteria
impacts : Comma-separated symbols (+ or -) indicating benefit or cost criteria
output_file : CSV file where the result will be stored


Input File Format

The input file must be provided in CSV or Excel (.xlsx) format.

The first column of the file should contain the names of the alternatives. All remaining columns must contain numeric values only.

Sample Input Table:

Alternative | C1 | C2 | C3 A1 | 250 | 16 | 12 A2 | 200 | 20 | 8 A3 | 300 | 14 | 16


Weights and Impacts

Weights represent the importance of each criterion. They must be provided as comma-separated numeric values.

Example: "1,1,1"

Impacts specify whether a criterion is beneficial or non-beneficial. Use '+' for benefit criteria and '-' for cost criteria.

Example: "+,+,-"

The number of weights and impacts must be equal to the number of criteria columns in the input file.


Output File

The output is generated in CSV format.

Two additional columns are added to the original data: Topsis Score Rank

A higher Topsis Score indicates a better alternative. The alternative with the highest score is assigned rank 1.


Error Handling

The program performs the following validations before processing the data:

Correct number of command-line arguments
Input file existence
Minimum of three columns in the input file
Numeric values in criteria columns
Matching number of weights, impacts, and criteria columns
Valid impact values (+ or -)

Appropriate error messages are displayed if any of the above conditions fail.


About TOPSIS

TOPSIS ranks alternatives based on their relative closeness to the ideal solution. The alternative closest to the ideal best solution and farthest from the ideal worst solution is considered the best option.


Author

Khushi Mehta
Developed as part of an academic assignment

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_khushimehta_102303769-1.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for topsis_khushimehta_102303769-1.0.1.tar.gz
Algorithm Hash digest
SHA256 43910f463ab71135aa09667149883e92f600ba882caec541723db9e86cdb4bc3
MD5 6700bc60c73d0aa39f54d680d1607bce
BLAKE2b-256 6c286f1069c89cb418e6e1c49b4fd6ccbe91696a050e78fc2773105821889eb8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for topsis_khushimehta_102303769-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 10b506065eba983da832fcd5132d8f883a3fa60641f144af57f98b52162a5bee
MD5 e5bccd597923fc4aaa1514da175ce1da
BLAKE2b-256 8808d95558c16c59a8d4874902af7748112ae70b53311e4b6c0f325cc38258ad

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