Unweighted TOPSIS method
Project description
Un-Weighted TOPSIS method
The Un-Weighted Technique for Order Preference by Similarity to Ideal Solution (UW-TOPSIS) ranks decision alternatives based on the classical TOPSIS approach, however, this method does not require the introduction of a priori weights. Instead, it makes use of lower and upper bounds to create a weighted decision space that determines the domain of the.
As a consequence of working with unknown weights, the method does not take into account the relative importance of criteria. Then, the positive ideal solution $( PIS )$ and a negative ideal solution $( NIS )$ vary depending on the conditions of the problem. Hence, the function of relative proximity $( R )$ is an operator which is optimized as two mathematical programming problems of maximize $( R^{U} )$ and minimize $( R^{L} )$, considering weights as decision variables. Finally, per each alternative, we get the intervals $[ R^{L}$, $R^{U} ]$ so we can rank them following a determined comparison method.
For a better understanding of either the algorithm or the method, please check:
The motivation of this repository is the application of UW-TOPSIS to relatively large datasets as we discussed in the following paper:
Installation
You can install the uwTOPSIS library from GitHub:
git clone https://github.com/Aaron-AALG/uwTOPSIS.git
python3 -m pip install -e uwTOPSIS
You can also install it directly from PyPI:
pip install uwTOPSIS
Input-Output
Input
data: dataframe which contains the alternatives and the criteria.
directions: array with the optimal direction of the criteria.
L: array with the lower bounds of the weights.
U: array with the upper bounds of the weights.
norm: normalization method for the data, whether "euclidean", "minmax", or "none" (By default norm = "euclidean").
p: integer value for the L-p distance (By default p=2).
alpha: value of the convex linear combination of the uwTOPSIS score (By default alpha=1/2).
forceideal: logical argument to indicate whether to force the ideal solution. If true, the ideal solutions
are boolean arrays regarding the directions
(By default forceideal = False).
display: logical argument to indicate whether to show print convergence messages or not (By default display = False).
Output
Dictionary which contains three keys.
Ranking: List with R_min and R_max scores in regard to the optimal weights, plus the uwTOPSIS score.
Weights_min: List with the weights that minimize the R score.
Weights_max: List with the weights that maximize the R score.
Example
UW-TOPSIS is implemented in order to manage Pandas DataFrames as input data which will be converted to NumPy arrays. Here is an example based on the paper of V. Liern and B. Pérez-Gladish (2020), in which we only use three alternatives and four criteria:
import pandas as pd
import numpy as np
from uwTOPSIS.uwTOPSIS import *
data = pd.DataFrame({"c1":[173, 176, 142],
"c2":[10, 11, 5],
"c3":[11.4, 12.3, 8.2],
"c4":[10.01, 10.48, 7.3]})
directions = ["max", "max", "min", "min"]
L = np.repeat(0.1, data.shape[1])
U = np.repeat(0.4, data.shape[1])
norm = "euclidean"
p = 2
x = uwTOPSIS(data, directions, L, U, norm, p)
The output of the function is a dictionary whose entries are Ranking
, Weights_min
, and Weights_max
. Besides, Ranking
entry is another dictionary with the arguments R_min
, R_max
, and, uwTOPSIS
. The Weights_min
and Weights_max
output contains the arrays with the optimal solution of each alternative as minimize and maximize respectively.
Generalization to classic TOPSIS
Given that UW-TOPSIS generalizes TOPSIS, we can also compute it by limiting the amplitude of the boundaries. The user can utilize the Numpy numerical epsilon as the difference between lower and upper bounds. Here is an example:
weights = np.array([0.25, 0.2, 0.2, 0.35])
epsilon = np.finfo(float).eps
try:
x = uwTOPSIS(data,
directions,
weights,
weights + epsilon,
norm,
p)
except:
x = uwTOPSIS(data,
directions,
weights - epsilon,
weights,
norm,
p)
However, it is strongly recommended to use the TOPSIS function included in our package instead:
x = TOPSIS(data, directions, weights, norm, p)
Optimization in Python
This library uses the minimize function of the scipy.optimize
module to carry out the optimization problems. In particular, $R^{L}$ and $R^{U}$ are obtained one at a time. Thus, we can apply the SLSQP optimization method.
Literature review of UW-TOPSIS
Since the first implementation of UW-TOPSIS in MCDA in 2020, several researchers in the field have shown interest in this technique. The following table shows the works in which UW-TOPSIS has been used as a method for the case study or experimental part.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file uwTOPSIS-1.0.0.tar.gz
.
File metadata
- Download URL: uwTOPSIS-1.0.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93093f9d10dc4d98515f7958d2e39cf4a308fa4d545343b0c00dabce52fb7c5b |
|
MD5 | f55224521d20d902a90a30232afaab7c |
|
BLAKE2b-256 | 8a1a7985e430d37d920de3f25bda9606fb69a54035d071d6ebad24ba10b17a7b |
File details
Details for the file uwTOPSIS-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: uwTOPSIS-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b382928b5253a551851f1cbfa6f717814713d2d8f134090758b524b36b168f90 |
|
MD5 | 70ea77bdf943766976ac00ff21d9a9cc |
|
BLAKE2b-256 | 096fb7649a43c311e9a564c7af670e01c23e432c4bceebb4d2f48e2c7f8be8d8 |