1+ % Mainfiles purpose is to show how to use n-ary TOPSIS method
2+ % that uses n-ary norm operators to set preference for either positive
3+ % ideal solution or negative ideal solution depending on the practical
4+ % problem. It was published in
5+
6+ % P. Luukka, N—ary norm operators and TOPSIS, 2020 IEEE International
7+ % Conference on Fuzzy Systems (FUZZ-IEEE), Glasgow, UK, 2020, pp. 1-6,
8+ % doi: 10.1109/FUZZ48607.2020.9177580.
9+
10+
11+ % First lets create artificial data of ten alternatives and five criteria:
12+ c= 10 ;
13+ data= c * randn(10 ,5 );
14+ % Define parameters p for Minkowski metric (1=Manhattan distance,2=Euclidean distance etc)
15+ % and parameter values for fuzzy union (w) and intersection (w2) operators
16+ p= 1 ; w= 2 ; w2= 5 ;
17+ % See more information about these from the proceedings.
18+
19+ % Define whether criteria is benefit criteria or cost criteria in crit
20+ % vector 1=benefit, 2=cost.
21+ crit= [1 1 1 2 1 ]; % in this example fourth would be cost criteria and others benefit
22+
23+ [cc ,PISB ,NISB ]=narytopsis(data ,p ,w ,w2 ,crit )
24+
25+ % For output of the function you get:
26+ % cc = closeness coefficient values for ten alternatives
27+ % PISB = distance to positive ideal solution
28+ % NISB = distance to negative ideal solution
29+
30+ % You can get the ordering of the alternatives by sorting CC to descending order
31+ [Y ,I ]=sort(cc ,' descend' );
32+
33+ % Order of the attributes:
34+ Order= I '
0 commit comments