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

写在前面 Notice

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.

下载 Download

方式一:从以下链接下载打包好的exe文件,相对较大,下载并解压缩后,直接运行文件夹中的TOPSIS.exe文件即可,无需安装python。
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)

方式二:如果有python基础,并安装了python3,那么可以下载下面的zip文件,运行py文件即可。需要注意的是,运行本文件需要一系列的python依赖包,包括:pandas, numpy, tkinter, pickle,.
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)

视频示例 Video Demo

功能介绍 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.

假如有N个准则,M个备选方案,于是就有一个M*N的评价矩阵。
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.

如果各准则有不同的权重,TOPSIS则时将对上述标准化评价矩阵进行加权,即每一列乘以一个权重系数。权重可以通过层次分析法等其他方法获得。
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.

然后,TOPSIS将从每一列中找到最大值和最小值,每一列(即每个指标)的最大值构成了理论上的最佳可能方案,相应地,每一列的最小值构成了理论上的最差可能方案。当然,这样的极好或极差方案可能在实际中并不存在。
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.

有了最佳和最差(可能)方案,TOPSIS将计算每一个实际方案——即每一行——与最佳可能方案的欧氏距离d1,以及与最差可能方案的欧氏距离d2,然后计算指标score = d2/(d1+d2)。
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.

显然,如果某个实际方案越好,应该d1越小,d2越大,socre越大;反之亦然。特别地,如果某方案就是最佳可能方案,那么d1=0,d2=1,score=1。
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.

最后,TOPSIS会根据各方案的score值,给出排名,并指出最佳方案。
Finally, TOPSIS will rank options according to their scores and tell you the best option.

本工具允许用户导入csv格式的评价矩阵,设定哪些准则是“越低越好”(默认其他是“越高越好”),设定权重(全部设为1,或设定指定准则的权重,或导入权重csv文件),运行TOPSIS,输出最终与中间结果。
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.

发表评论

Close Menu