我这里贴一两个我自己写的程序…
MODEL:
SETS:
city/1..6/: u;
link(city,city):dist,x;
ENDSETS
DATA:
dist= 0 702 454 842 2396 1196
702 0 324 1093 2136 764
454 324 0 1137 2180 798
842 1093 1137 0 1616 1587
2396 2136 2180 1616 0 2900
1196 764 798 1857 2900 0;
n=6;
ENDDATA
MIN=@SUM(link:dist*x);
@FOR(link(I,J):@SUM(link(I,J)|I#NE#J:x(I,J))=1);
@FOR(link(I,J):@SUM(link(I,J)|J#GT#1#AND#I#NE#J:u(I)-u(J)+n*x(I,J)