Skip to main content

A Python package for implementing the TOPSIS method.

Project description

Multi-Criteria Decision Making with TOPSIS

Overview This repository contains a Python-based implementation of the TOPSIS decision-making methodology (Technique for Order of Preference by Similarity to Ideal Solution). The tool helps evaluate and rank different options based on multiple decision criteria while considering their relative significance.

System Requirements

  • Python 3.x environment
  • Required packages: pandas numpy

To set up the dependencies: pip install pandas numpy

File Structure

  • Main script: 102203557.py
  • Required input: CSV format decision matrix
  • Generated output: CSV file with rankings

Input Data Requirements Your input CSV file should be structured as follows:

  • Column 1: Alternative identifiers
  • Columns 2+: Numerical values for each criterion

Sample input format (input.csv): Alternative,Metric1,Metric2,Metric3,Metric4 Option1,20,300,50,0.5 Option2,25,250,60,0.7

Running the Program Execute the script using the following syntax: python 102203557.py input_file weights impacts output_file

Parameters:

  • input_file: Path to your input CSV
  • weights: Criterion weights (comma-separated)
  • impacts: Criterion types (+ for maximization, - for minimization)
  • output_file: Desired location for results

Example: python 102203557.py input.csv "1,1,1,1" "+,-,+,+" results.csv

Results Format The output CSV includes:

  • All original input data
  • TOPSIS score column
  • Final ranking column

Sample output structure: Alternative,Metric1,Metric2,Metric3,Metric4,TOPSIS_Score,Rank Option1,20,300,50,0.5,0.78,2 Option2,25,250,60,0.7,0.85,1

Error Management The program includes validation for:

  1. File existence and accessibility
  2. Data format requirements
  3. Input parameter consistency
  4. Valid impact indicators

Common error messages:

  • "Unable to locate specified input file"
  • "Input data must contain 3+ columns"
  • "Weight/impact count must match criterion count"
  • "Impact values limited to '+' or '-'"

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_chahat_garg_102203557-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

Topsis_Chahat_Garg_102203557-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file topsis_chahat_garg_102203557-0.1.0.tar.gz.

File metadata

File hashes

Hashes for topsis_chahat_garg_102203557-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8213162f99b7c9c9c336455721cd59262f79ed75d884476aca54f07c20e9fdaa
MD5 737bea61d7cd9abb123e4f22454e5dc8
BLAKE2b-256 eb8d6307cefc9bf8aba141e7106c333bcfcb676d20cdaf5b34a12e9c6a339daa

See more details on using hashes here.

File details

Details for the file Topsis_Chahat_Garg_102203557-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for Topsis_Chahat_Garg_102203557-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 262fb38eef571abb1ca3347b14886d86013edc25c1ae3c719ae2463b3164750c
MD5 72687855911af56eb6f2b55cb9332652
BLAKE2b-256 702e9181aa1dd7616c2d8d2b399e67f7f7754694de077d99aa3972e5455dd3ea

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