用dijkstra算法求解最短路径,point/1..86/:v;road(point,point):w,x;endsetsdata:数据enddata@for(road(i,j):w(i,j)=0);w(5,13)=9.05; w(5,39)=8.93; w(5,33)=12.28; w(5,55)=8.37; w(5,74)=12.51;w(7,33)=0.65; w(7,66)=1; w(8,38)=2; w(8,67)=3.87; w(9,44
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/24 09:43:04
用dijkstra算法求解最短路径,point/1..86/:v;road(point,point):w,x;endsetsdata:数据enddata@for(road(i,j):w(i,j)=0);w(5,13)=9.05; w(5,39)=8.93; w(5,33)=12.28; w(5,55)=8.37; w(5,74)=12.51;w(7,33)=0.65; w(7,66)=1; w(8,38)=2; w(8,67)=3.87; w(9,44
用dijkstra算法求解最短路径,
point/1..86/:v;
road(point,point):w,x;
endsets
data:
数据
enddata
@for(road(i,j):w(i,j)=0);
w(5,13)=9.05; w(5,39)=8.93; w(5,33)=12.28; w(5,55)=8.37; w(5,74)=12.51;w(7,33)=0.65; w(7,66)=1; w(8,38)=2; w(8,67)=3.87; w(9,44)=2.83; w(9,69)=9.04; w(10,71)=0.29;
w(11,72)=17.2; w(14,77)=1.54;w(15,78)=17.65;w(16,59)=6.95;w(17,24)=2.76; w(17,33)=14.76; w(17,60)=1.43; w(17,59)=6.15; w(18,81)=11.97;w(19,85)=6.89;w(20,83)=13.55;
w(21,23)=7.3; w(21,57)=9.45; w(21,65)=11.51; w(22,65)=3.4; w(22,81)=3.4;w(23,61)=1.73; w(23,66)=11.51;w(24,26)=1.89; w(24,27)=3.09; w(24,28)=4.56; w(25,26)=1.03;
w(25,27)=2.23; w(25,27)=3.7; w(26,65)=5.24; w(27,65)=6.44; w(27,86)=6.44;w(28,29)=194.55; w(28,36)=107.08; w(28,37)=107.55; w(28,38)=173.12; w(28,65)=7.9;
w(29,31)=2.79; w(29,32)=10.7; w(29,33)=14.9; w(29,66)=14.9;
w(30,31)=1.56; w(30,32)=9.47; w(30,33)=13.31; w(30,66)=13.67; w(30,68)=17.85; w(31,78)=13.42;
w(32,59)=5.69;w(34,36)=101.33; w(34,37)=101.79; w(34,38)=167.37; w(34,85)=7.9;w(35,38)=47.53; w(35,85)=7.9; w(36,52)=0.25;w(37,42)=9.43;w(37,43)=9.83;
w(37,69)=10.07;w(38,39)=1.72;w(38,40)=1.12;w(38,70)=9.65;w(39,67)=3.59;w(40,67)=2.99;w(40,77)=2.99;w(41,68)=1.05;w(42,48)=9.59;w(42,68)=10.88;w(42,73)=9.73;
w(43,68)=11.29;w(44,47)=1.98;w(44,70)=13.69;w(45,53)=18.3;w(45,70)=8.96;w(45,72)=20.49;w(46,69)=1.97;w(46,78)=19.61;w(47,69)=8.18;w(47,78)=18.01;w(48,51)=15.65;
w(48,71)=20.6;w(49,51)=3.03;w(49,71)=7.98;w(49,78)=19.2;w(50,71)=1.8;
w(50,78)=18.39;w(51,73)=15.79;w(52,53)=7.69;w(52,64)=0.7;w(52,72)=9.87;w(53,71)=18.86;
w(54,56)=9.28;w(54,72)=13.1;w(54,74)=13.1;w(55,58)=12.22;w(55,76)=17.18;w(56,75)=11.88;w(56,78)=17.76;w(57,78)=7.78;w(57,79)=14.54;w(58,59)=9.24;
w(58,77)=16.36;w(59,79)=9.89;w(60,82)=2.01;w(61,82)=5.93;w(61,83)=5.93;w(62,83)=12.04;w(62,85)=3.67;w(63,84)=8.96;w(63,86)=6.75;w(64,85)=6.54;
w(65,66)=15.71;w(67,68)=19.89;w(67,70)=11.53;w(68,69)=11.53; w(69,70)=19.89; w(71,72)=21.05; w(71,73)=21.05;
w(72,73)=15.71;w(74,75)=15.71;w(76,78)=21.05;w(76,77)=21.05;w(77,78)=21.05;w(80,81)=12.12;w(83,84)=15.71;w(85,86)=15.71;
min=@sum(road(i,j):w(i,j)*x(i,j)+v(j)*x(i,j));
@for(point(i)|i#ne#1#and#i#ne#2:@sum(point(k):x(k,i))=@sum(point(j):x(i,j)));
@sum(point(j):j#ne#1:x(1,j))=1;
@sum(point(k)|k#ne#1:x(k,1))=0;
@sum(point(k)|k#ne#11:x(k,2))=1;
@sum(point(j)|j#ne#11:x(11,j))=0;
@for(road(i,j):x(i,j)
用dijkstra算法求解最短路径,point/1..86/:v;road(point,point):w,x;endsetsdata:数据enddata@for(road(i,j):w(i,j)=0);w(5,13)=9.05; w(5,39)=8.93; w(5,33)=12.28; w(5,55)=8.37; w(5,74)=12.51;w(7,33)=0.65; w(7,66)=1; w(8,38)=2; w(8,67)=3.87; w(9,44
改过了 没有可行解 自己找我看哪里有问题