Skip to main content

Implementation of TOPSIS for multi-criteria decision making

Project description

Topsis-Rohit-102203804

A Python package implementing the TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) method for multi-criteria decision making. This package helps compute rankings for alternatives based on their proximity to ideal best and worst solutions.

Installation

Install the package using pip:

pip install Topsis-Rohit-102203804

Install required dependencies:

pip install pandas numpy pyexcel

Features

  • Compute TOPSIS scores and rankings for alternatives
  • Support for custom weights and impacts for decision criteria
  • Export results to CSV file
  • Comprehensive input validation
  • Both command-line and programmatic usage
  • Support for CSV and Excel input files

Usage

Command Line Interface

topsis <InputDataFile> <Weights> <Impacts> <ResultFileName>

Parameters:

  1. InputDataFile: Path to input dataset (CSV/XLSX)
  2. Weights: Comma-separated criterion weights (e.g., "1,2,3")
  3. Impacts: Comma-separated criterion impacts ('+' for maximize, '-' for minimize)
  4. ResultFileName: Output file path for results

Example:

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

Python Package Usage

from topsis_rohit_102203804.topsis import topsis

# Perform TOPSIS analysis
topsis("input.csv", [1,1,1,1,1], ['+','+','-','+','-'], "output.csv")

Input Data Format

File Requirements

  • Must contain at least 3 columns
  • First column: Names of alternatives
  • Columns 2 onwards: Numeric values for criteria

Example Input CSV:

Alternative,Criterion1,Criterion2,Criterion3
A1,250,16,12
A2,200,18,11
A3,180,20,10

Output Format

The package generates a CSV file with the original data plus two additional columns:

  • Topsis Score: Calculated similarity to ideal solution
  • Rank: Final ranking of alternatives

Error Handling

The package validates:

  • Number of command-line arguments
  • File existence and readability
  • Minimum column requirement (3 or more)
  • Numeric values in criteria columns
  • Matching counts of weights, impacts, and criteria
  • Valid impact symbols (+ or -)
  • Proper formatting of weights and impacts (comma-separated)

Prerequisites

  • Python 3.6 or higher
  • Dependencies:
    • pandas
    • numpy
    • pyexcel

License

MIT License

Author

Rohit (GitHub Profile)

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_rohit_102203804-1.1.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

Topsis_Rohit_102203804-1.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file topsis_rohit_102203804-1.1.0.tar.gz.

File metadata

  • Download URL: topsis_rohit_102203804-1.1.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for topsis_rohit_102203804-1.1.0.tar.gz
Algorithm Hash digest
SHA256 6160d9b46fcc8a0aeb130d666709d2adb415d8af190d1c7c21bc740a199417f4
MD5 38d0314a0f7706753dc33cf5dda3afd7
BLAKE2b-256 ad0c765a9ab87848601b4c55ee80968b9aaccc2acc0386184355f8aab04f9aeb

See more details on using hashes here.

File details

Details for the file Topsis_Rohit_102203804-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for Topsis_Rohit_102203804-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9ba14f83f07dea999ec4c8b7c2f88e33629c05ed33ff6fec3eb6eb153c12b8e
MD5 3285e647b30f2ba37e890f87688869a4
BLAKE2b-256 6e1c463d8afa9df3b91a0da8dd0186507550996c2dd4e6de22048eda93889501

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