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
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:
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
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).
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.
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.
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)
This library uses the minimize function of the scipy.optimize
module to carry out the optimization problems. In particular,
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.