Skip to main content

Unweighted VIKOR method

Project description

Unweighted VIKOR method

python-version pypi-version license Downloads

The Unweighted VIKOR method (UW-VIKOR) is a multiple-criteria decision-making (MCDM) technique for ranking alternatives based on the classical VIKOR (VIseKriterijumska Optimizacija I Kompromisno Resenje) approach, however this method does not require the introduction of a priori weighting scheme. Instead, the decision-maker only has to determine the bounds ${(l_j,u_j)}_{j=1}^{M}$ between which the weights vary, thus reducing the demands on the algorithm.

As a consequence, the weights are considered decision variables in a non-linear mathematical optimization problem that considers the VIKOR $Q$-score as the objective function. The optimization yields two scores subjected to maximize ($Q_{i}^{L}$) and minimize ($Q_{i}^{U}$) the $Q$-score per each alternative as well as the optimal weights attached to them ($W_{i}^{L}$ and $W_{i}^{U}$). Then, per each alternative, we get the score intervals $[S_{i}^{L}$, $S_{i}^{U}]$ and $[R_{i}^{L}, R_{i}^{U}]$ by evaluating them with the optimal weights. Finally, we can rank alternatives using an aggregation function of the $[Q_{i}^{L}, Q_{i}^{U}]$ scores.

Installation

You can install the uwVIKOR library from GitHub:

git clone https://github.com/Aaron-AALG/uwVIKOR.git
python3 -m pip install -e uwVIKOR

You can also install it directly from PyPI:

pip install uwVIKOR

Input parameters and 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.

  • v: value of the utility parameter (By default v = 0.5).

  • w0: array with the initial guess of the weights (By default w0 = []).

  • 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 $S$, $R$ and $Q$ scores in regard to the optimal weights.

  • Weights_min: List with the weights that minimize the $Q$ score.

  • Weights_max: List with the weights that maximize the $Q$ score.

Example

The uwVIKOR function is implemented in order to manage decision matrices as input data which will be converted to NumPy arrays. Here is an example in which three alternatives and four criteria are used:

import pandas as pd
import numpy as np
from uwVIKOR.uwVIKOR 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.array([0.1 for _ in range(data.shape[1])])
U = np.array([0.4 for _ in range(data.shape[1])])
v = 0.75

x = uwVIKOR(data, directions, L, U, v)

Generalization to classic VIKOR

Given that uwVIKOR generalizes VIKOR, we can also compute it by limiting the amplitude of the boundaries. For this function, it is recommended to use the Numpy numerical epsilon as the difference between $L$ and $U$. Here is an example:

weights = np.array([0.25, 0.2, 0.2, 0.35])
epsilon = np.finfo(float).eps

try:
    x = uwVIKOR(data,
                directions,
                weights,
                weights + epsilon,
                )
except:
    x = uwVIKOR(data,
                directions,
                weights - epsilon,
                weights,
                )

Optimization in Python

This library uses the minimize function of the scipy.optimize module to carry out the optimization problems. In particular, Q_L and Q_U are obtained one by one, thus we can apply the SLSQP method.

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

uwVIKOR-1.0.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

uwVIKOR-1.0.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file uwVIKOR-1.0.0.tar.gz.

File metadata

  • Download URL: uwVIKOR-1.0.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for uwVIKOR-1.0.0.tar.gz
Algorithm Hash digest
SHA256 41cfaace86867ae14e23917a6c62a3b76f5fa8974fb09de823623d75d48340dc
MD5 4a00d4b73b2f382e87c4600d1cdd8691
BLAKE2b-256 3661ce4f91314d1e37c97092f5edf14e3be252bfd6de11936795c37835008ce7

See more details on using hashes here.

File details

Details for the file uwVIKOR-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: uwVIKOR-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for uwVIKOR-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e634fd50c1e6dec952db5405780a713f58ceab73313daf6e80cad77205aa3c02
MD5 8b2b4f32db5b20ff69d0a6e2d5b5664c
BLAKE2b-256 cde30a8d5af5dd81cc69ccbb834b3ed2e66c3e5d8315265d6823dc09097c3d98

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page