lingo中tsp问题求解,运行时提示有语法错误,迷惑中...MODEL:SETS:CITY / 1..10/:U; LINK( CITY,CITY):DIST,X;ENDSETSDATA:DIST=0 22.3 22.7 24.5 22.7 22 22.1 26.5 27.3 24.222.3 0 1.8 5.1 3.3 2.5 3.6 9.2 10 6.122.7 1.8 0 3.5 5.1 2.6 1.8 7.4 8.
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 07:02:12
lingo中tsp问题求解,运行时提示有语法错误,迷惑中...MODEL:SETS:CITY / 1..10/:U; LINK( CITY,CITY):DIST,X;ENDSETSDATA:DIST=0 22.3 22.7 24.5 22.7 22 22.1 26.5 27.3 24.222.3 0 1.8 5.1 3.3 2.5 3.6 9.2 10 6.122.7 1.8 0 3.5 5.1 2.6 1.8 7.4 8.
lingo中tsp问题求解,运行时提示有语法错误,迷惑中...
MODEL:
SETS:
CITY / 1..10/:U;
LINK( CITY,CITY):DIST,X;
ENDSETS
DATA:
DIST=0 22.3 22.7 24.5 22.7 22 22.1 26.5 27.3 24.2
22.3 0 1.8 5.1 3.3 2.5 3.6 9.2 10 6.1
22.7 1.8 0 3.5 5.1 2.6 1.8 7.4 8.3 4.6
24.5 5.1 3.5 0 6.7 5.2 2.7 5.6 6.5 1.9
22.7 3.3 5.1 6.7 0 3.3 7 12.6 13.5 9.2
22 2.5 2.6 5.2 3.3 0 4.4 10 10.8 7.3
22.1 3.6 1.8 2.7 7 4.4 0 7 7.9 4.3
26.5 9.2 7.4 5.6 12.6 10 7 0 0.85 4
27.3 10 8.3 6.5 13.5 10.8 7.9 0.85 0 4.8
24.2 6.1 4.6 1.9 9.2 7.3 4.3 4 4.8 0
enddata
N = @SIZE( CITY);
MIN = @SUM( LINK:DIST * X);
@FOR( CITY( K):
@SUM( CITY( I)| I #NE# K:X( I,K)) = 1;
@SUM( CITY( J)| J #NE# K:X( K,J)) = 1;
@FOR( CITY( J)| J #GT# 1 #AND# J #NE# K:
U( J) >= U( K) + X ( K,J) -
( N - 2) * ( 1 - X( K,J)) +
( N - 3) * X( J,K));
);
@FOR( LINK:@BIN( X));
@FOR( CITY( K)| K #GT# 1:
U( K) = 1 + ( N - 2) * X( K,1)
);
END
lingo中tsp问题求解,运行时提示有语法错误,迷惑中...MODEL:SETS:CITY / 1..10/:U; LINK( CITY,CITY):DIST,X;ENDSETSDATA:DIST=0 22.3 22.7 24.5 22.7 22 22.1 26.5 27.3 24.222.3 0 1.8 5.1 3.3 2.5 3.6 9.2 10 6.122.7 1.8 0 3.5 5.1 2.6 1.8 7.4 8.
数据后面没加分号