数学建模0—1规划
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
SETS:
!We have a network of 10 points.
We want to find the length of the shortest route
from point 1 to point 10.;
! Here is our primitive set of 10 points,where
F(i) represents the shortest path distance
from point i to the last point;
CITIES /1..10/:F;
! The derived set ROADS lists the roads that
exist between the points;
ROADS(CITIES,CITIES)/
1,2 1,3 1,4
2,5 2,6
3,5 3,6 3,7
4,6 4,7
5,8 5,9
6,8 6,9
7,8 7,9
8,10
9,10/:D;
! D(i,j) is the distance from point i to j;
ENDSETS
DATA:
! Here are the distances that correspond to the above links; D=
4.5 2.8 3
10.3 9
6 7.4 10.2
3.5 8.3
4.6 8.2
9 6.5
5.4 4.6
8
4.6;
ENDDATA
! If you are already in point 10,then the cost to
travel to point 10 is 0;
F(@SIZE(CITIES))=0;
@FOR(CITIES(i)|i#LT#@SIZE(CITIES):
F(i)=@MIN(ROADS(i,j):D(i,j)+F(j))
);
END