Skip to main content

TOPSIS command-line tool

Project description

TOPSIS Algorithm Implementation

Program 1: Overview

TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) is a multi-criteria decision-making (MCDM) technique used to rank alternatives based on their relative closeness to the ideal best and ideal worst solutions.

This project provides a complete command-line based Python implementation of the TOPSIS algorithm with proper validation and result generation.


Features

  • Accepts custom weights and impacts for each criterion
  • Computes TOPSIS Score and Rank
  • Works as a command-line program
  • Generates results in a CSV output file
  • Robust error handling and input validation
  • Available as an installable PyPI package

How TOPSIS Works (Brief)

  1. Normalize the decision matrix
  2. Apply weights to normalized values
  3. Determine ideal best and ideal worst solutions
  4. Compute separation measures
  5. Calculate TOPSIS score
  6. Rank alternatives based on score

How to Use

Prerequisites

  • Python 3.7 or higher
  • Required libraries:
    • pandas
    • numpy

Install dependencies (if running from source):

pip install pandas numpy

Command-Line Usage

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

Parameters

  1. InputDataFile: Path to the dataset file (CSV/XLSX). The first column lists alternatives, followed by numeric data for criteria.
  2. Weights: Comma-separated values for criterion importance (e.g., "1,2,3").
  3. Impacts: Comma-separated values (+ for maximize, - for minimize) indicating desired impact for each criterion (e.g., "+,-,+").
  4. ResultFileName: Name of the output file where results will be saved.

Example Command

topsis sample_input.csv "1,1,1,1" "+,+,+,+" output.csv

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_vansh_102303806-0.0.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

topsis_vansh_102303806-0.0.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file topsis_vansh_102303806-0.0.2.tar.gz.

File metadata

  • Download URL: topsis_vansh_102303806-0.0.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for topsis_vansh_102303806-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c86e11a9e690fb421ba166cba803c9a3a8c7e70adeb9b681331568359b9b5219
MD5 f80eaed26d4e5420d577e384e458f7a0
BLAKE2b-256 08c61043bf0ea18d2d90da54106f8a6fdba8f25f6cc9754edcd14465fc320538

See more details on using hashes here.

File details

Details for the file topsis_vansh_102303806-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_vansh_102303806-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 25c5a41c32c2472b25e95a5fbffa69fd245e8369d313a14202f38e5553c106fc
MD5 d07077e6ef46cc01ebb57ff8ae94e714
BLAKE2b-256 74fb393a448e20edeff713e12404b2e31faf78c02b915d364ca038fb9bcdd0e5

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