﻿TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) 多准则决策工具 – 王灿的个人网站

## TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) 多准则决策工具

1. 这是一个完全免费的工具。
This is a completely free tool.

2. 我不是专业码农，因此不能保证功能不出现问题。如果你在使用中发现任何bug，请和我联系，除了用户电脑本身的问题以外，绝大多数的问题都可以得到及时解决。
It is hard to get rid of all bugs, and I cannot make guarantee for the functionality of the tool. If you find any bug when using it, please contact with me. I promise that most of the problems (expect those caused only by your computer) could be solved in time.

3. 本工具基于Python 3.6开发，不需要安装运行环境，直接下载、解压后找到exe文件就可以用。
This tool is developed based on Python 3.6. Compared with Matlab-based tools, python-based tools do not need additional installation of Runtime and thus could be directly executed by double-clicking .exe file.

4. This tool is particularly for my friend Garfield.

Option 1. Download the executable (packed in zip file, named ‘TOPSIS.exe’) and directly use it without needs to install python.

TOPSIS-exe版 (TOPSIS, executable)

Option 2. Those who have already installed python3 could use following zip file, which contains a py file. Please note that this py file would have to import several modules, including pandas, numpy, tkinter, pickle.

python源代码 (python code for this tool)

# 功能介绍 Introduction of Functionality

TOPSIS是一种多准则决策方法。提到多准则决策，我们可能想到的最常用方法是直接加权求和，TOPSIS比这个复杂一些，但也很简单。
TOPSIS is a kind of multi-criteria decision making (MCDM) method. As to MCDM, the most straightforward method might be simple weighted summation. TOPSIS is a more complicated method, but still very simple.

Supposing we have N criteria and M options, so we will have a M by N evaluation matrix.

TOPSIS首先将进行标准化：一方面，要把所有的准则变成越高越好，对于那些越低越好的准则，将取倒数；另一方面，要将每一个准则对应的列除以该列的范数，以消除量纲。
TOPSIS would firstly normalize the evaluation matrix, which contains 2 steps. The first step is to make all criteria ‘the higher, the better’. For those criteria which should be ‘the lower the better’, it will use reciprocals. The second step is to divide each column (corresponding to a specific criterion) by its norm to get rid of different scales.

If criteria have different importance, TOPSIS would weight the normalized evaluation matrix, that is to multiply each column with a weight. Weights could be obtained by other methods, such as AHP.

After that, TOPSIS will find the maximum value  and minimum value of each column. The maximum values of all columns would constitute a theoretically best option, and the minimum values of all columns would constitute a theoretically worst option. They might not necessarily exist, just a kind of possibility.

Given the best and the worst (possible) options, TOPSIS would calculate the Euclidean distance of each real option (corresponding to a row) to the best option, denoted as d1, as well the Euclidean distance to the worst option, denoted as d2. Then, score = d2 / (d1+d2) would be calculated.

Apparently, the better a real option is, the smaller its d1 should be, the larger its d2 should be, and consequently the larger its score should be, vice versa. Specifically, if a real option happens to be the best possible option, then d1=0, d2=1, score=1.

Finally, TOPSIS will rank options according to their scores and tell you the best option.

This tool allows users to import evaluation matrix in csv file, set the criteria which should be the lower the better (and keep the else the higher the better), set weights (all to 1s, or set weight for a specific criterion, or import a weight csv file), run TOPSIS, and export final and intermediate results.

ICP备案号：沪ICP备20010289号-1