clc
clear all
A=[ 0.615385 0.625 0.111111 0.486486 0.1 0.714286 0.571429
0.461538 0.5 0.055556 0.081081 0 0.142857 0
0.384615 0.375 0.277778 0.621622 0.75 0.857143 0.857143
0.615385 0.5625 0.166667 0.918919 1 1 0.857143
0.692308 0.25 0.277778 0.405405 0.45 0.285714 1
0.846154 0.75 0.111111 0.459459 0.65 0 0.571429
0.846154 1 0.555556 0.27027 0.7 0.285714 1
0 0 1 0 0.5 1 0.571429
0.269231 0.125 0.222222 0.081081 0.95 0.428571 0.428571
0.5 0.0625 0.333333 0.189189 0.4 0.571429 0.285714
0.769231 0.125 0 0.432432 0.65 0.714286 0.428571
1 0.6875 0.055556 1 0.5 1 0.571429
0.961538 1 0.166667 0.513514 0.65 0.428571 0.714286
0.615385 0.1875 0.111111 0.513514 0.65 0 0.428571
0.807692 0.4375 0.444444 0.594595 0.55 0.571429 0.428571
0.884615 0.25 0.333333 0.702703 0.45 0.714286 0.571429
0.538462 0 0.777778 0.810811 0.35 0.142857 0.714286
0.653846 0.1875 0.666667 0.783784 0.5 0.285714 0.857143
0.269231 0.0625 0.888889 0.378378 0.65 0.857143 1
0.769231 0.5 0.833333 0.459459 0 0 0.571429];
B=A;
max=0;
t=0;
for v=1:1:19
for s=v+1:1:20
B(v,:)=[];
B(s,:)=[];
B0=B;
for i1=1:1:16
for j1=i1+1:1:17
for k1=j1+1:1:18
t=t+smax(B(i1,1),B(j1,1),B(k1,1))+smax(B(i1,2),B(j1,2),B(k1,2))+smax(B(i1,3),B(j1,3),B(k1,3))+smax(B(i1,4),B(j1,4),B(k1,4))+smax(B(i1,5),B(j1,5),B(k1,5))+smax(B(i1,6),B(j1,6),B(k1,6))+smax(B(i1,7),B(j1,7),B(k1,7));
B(i1,:)=[];
B(j1,:)=[];
B(k1,:)=[];
B1=B;
for i2=1:1:13
for j2=i2+1:1:14
for k2=j2+1:1:15
t=t+smax(B(i2,1),B(j2,1),B(k2,1))+smax(B(i2,2),B(j2,2),B(k2,2))+smax(B(i2,3),B(j2,3),B(k2,3))+smax(B(i2,4),B(j2,4),B(k2,4))+smax(B(i2,5),B(j2,5),B(k2,5))+smax(B(i2,6),B(j2,6),B(k2,6))+smax(B(i2,7),B(j2,7),B(k2,7));
B(i2,:)=[];
B(j2,:)=[];
B(k2,:)=[];
B2=B;
for i3=1:1:10
for j3=i3+1:1:11
for k3=j3+1:1:12
t=t+smax(B(i3,1),B(j3,1),B(k3,1))+smax(B(i3,2),B(j3,2),B(k3,2))+smax(B(i3,3),B(j3,3),B(k3,3))+smax(B(i3,4),B(j3,4),B(k3,4))+smax(B(i3,5),B(j3,5),B(k3,5))+smax(B(i3,6),B(j3,6),B(k3,6))+smax(B(i3,7),B(j3,7),B(k3,7));
B(i3,:)=[];
B(j3,:)=[];
B(k3,:)=[];
B3=B;
for i4=1:1:7
for j4=i4+1:1:8
for k4=j4+1:1:9
t=t+smax(B(i4,1),B(j4,1),B(k4,1))+smax(B(i4,2),B(j4,2),B(k4,2))+smax(B(i4,3),B(j4,3),B(k4,3))+smax(B(i4,4),B(j4,4),B(k4,4))+smax(B(i4,5),B(j4,5),B(k4,5))+smax(B(i4,6),B(j4,6),B(k4,6))+smax(B(i4,7),B(j4,7),B(k4,7));
B(i4,:)=[];
B(j4,:)=[];
B(k4,:)=[];
B4=B;
for i5=1:1:4
for j5=i5+1:1:5
for k5=j5+1:1:6
t=t+smax(B(i5,1),B(j5,1),B(k5,1))+smax(B(i5,2),B(j5,2),B(k5,2))+smax(B(i5,3),B(j5,3),B(k5,3))+smax(B(i5,4),B(j5,4),B(k5,4))+smax(B(i5,5),B(j5,5),B(k5,5))+smax(B(i5,6),B(j5,6),B(k5,6))+smax(B(i5,7),B(j5,7),B(k5,7));
B(i5,:)=[];
B(j5,:)=[];
B(k5,:)=[];
t=t+smax(B(1,1),B(2,1),B(3,1))+smax(B(1,2),B(2,2),B(3,2))+smax(B(1,3),B(2,3),B(3,3))+smax(B(1,4),B(2,4),B(3,4))+smax(B(1,5),B(2,5),B(3,5))+smax(B(1,6),B(2,6),B(3,6))+smax(B(1,7),B(2,7),B(3,7));
if t>max
max=t;
end
t=0;
B=B4;
end
end
end
B=B3;
end
end
end
B=B2;
end
end
end
B=B1;
end
end
end
B=B0;
end
end
end
end
B=A;
end