ÐÏࡱá>þÿ  þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿK( CITY, CITY): DIST, ! The distance matrix; X; ! X( I,J) = 1 if we use link I, J; ENDSETS DATA: ! Distance matrix need not be symmetric; ! However, city 1 is base of the tree; !to Atl Chi Cin Hou LA Mon ; DIST = 0 702 454 842 2396 1196 !from Atlanta; 702 0 324 1093 2136 764 !from Chicago; 454 324 0 1137 2180 798 !from Cinci; 842 1093 1137 0 1616 1857 !from Houston; 2396 2136 2180 1616 0 2900 !from LA; 1196 764 798 1857 2900 0;!from Montreal; ENDDATA !----------------------------------------------; !The model size: Warning, may be slow for N > 8; N = @SIZE( CITY); !The objective is to minimize total dist. of links; MIN = @SUM( LINK: DIST * X); !For city K, except the base, ... ; @FOR( CITY( K)| K #GT# 1: ! It must be entered; @SUM( CITY( I)| I #NE# K: X( I, K)) = 1; !If there is a link from J-K, then LVL(K)=LVL(J)+1. Note:These are not very powerful for large problems; @FOR( CITY( J)| J #NE# K: LVL( K) >= LVL( J) + X( J, K) - ( N - 2) * ( 1 - X( J, K)) + ( N - 3) * X( K, J); ); ); LVL( 1) = 0; ! City 1 has level 0; !There must be an arc out of city 1; @SUM( CITY( J)| J #GT# 1: X( 1, J)) >= 1; !Make the X's 0/1; @FOR( LINK: @BIN( X); ); !The level of a city except the base is at least 1 but no more than N-1, and is 1 if link to the base; @FOR( CITY( K)| K #GT# 1: @BND( 1, LVL( K), 999999); LVL( K) <= N - 1 - ( N - 2) * X( 1, K); ); END MODEL: !Given a set of nodes and the distance between them, finding the shortest total distance of links on the network to connect all the nodes is the classic problem called minimal spanning tree (MST). This model finds the minimum cost network connecting Atlanta , Chicago, Cincinnati, Houston, LA, and Montreal so that messages can be sent from Atlanta (base) to all other cities through the network; SETS: CITY / ATL CHI CIN HOU LAX MON/: LVL; !LVL( I) = level of city I; ! LVL( 1) = 0; LINþÿÿÿýÿÿÿþÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entryÿÿÿÿÿÿÿÿ÷CONTENTSÿÿÿÿÿÿÿÿÿÿÿÿ÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entryÿÿÿÿÿÿÿÿ*0_šîÏ»òÀð^P VtfþÄ @ Contentsÿÿÿÿÿÿÿÿÿÿÿÿ4 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿýÿÿÿþÿÿÿ þÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  !"#$%&'()*+,þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿs a link from J-K, then LVL(K)=LVL(J)+1. Note:These are not very powerful for large problems;\cf2 \par \cf1 @FOR\cf2 ( CITY( J)| J #NE# K: \par LVL( K) >= LVL( J) + X( J, K) \par - ( N - 2) * ( 1 - X( J, K)) \par + ( N - 3) * X( K, J); ); ); \par LVL( 1) = 0; \cf3 ! City 1 has level 0;\cf2 \par \cf3 !There must be an arc out of city 1;\cf2 \par \cf1 @SUM\cf2 ( CITY( J)| J #GT# 1: X( 1, J)) >= 1; \par \cf3 !Make the X's 0/1;\cf2 \par \cf1 @FOR\cf2 ( LINK: \cf1 @BIN\cf2 ( X); ); \par \cf3 !The level of a city except the base is at least 1 but no more than N-1, and is 1 if link to the base;\cf2 \par \cf1 @FOR\cf2 ( CITY( K)| K #GT# 1: \par \cf1 @BND\cf2 ( 1, LVL( K), 999999); \par LVL( K) <= N - 1 - ( N - 2) * X( 1, K); ); \par \cf1 END\cf2 \par \par } ì‹{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Courier New;}} {\colortbl ;\red0\green0\blue255;\red0\green0\blue0;\red0\green175\blue0;} \viewkind4\uc1\pard\cf1\f0\fs20 MODEL\cf2 : \par \cf3 !Given a set of nodes and the distance between them, finding the shortest total distance of links on the network to connect all the nodes is the classic problem called minimal spanning tree (MST). This model finds the minimum cost network connecting Atlanta , Chicago, Cincinnati, Houston, LA, and Montreal so that messages can be sent from Atlanta (base) to all other cities through the network;\cf2 \par \cf1 SETS\cf2 : \par CITY / ATL CHI CIN HOU LAX MON/: LVL; \par \cf3 !LVL( I) = level of city I;\cf2 \par \cf3 ! LVL( 1) = 0;\cf2 \par LINK( CITY, CITY): \par DIST, \cf3 ! The distance matrix;\cf2 \par X; \cf3 ! X( I,J) = 1 if we use link I, J;\cf2 \par \cf1 ENDSETS\cf2 \par \cf1 DATA\cf2 : \cf3 ! Distance matrix need not be symmetric;\cf2 \par \cf3 ! However, city 1 is base of the tree;\cf2 \par \cf3 !to Atl Chi Cin Hou LA Mon ;\cf2 \par DIST = 0 702 454 842 2396 1196 \cf3 !from Atlanta;\cf2 \par 702 0 324 1093 2136 764 \cf3 !from Chicago;\cf2 \par 454 324 0 1137 2180 798 \cf3 !from Cinci;\cf2 \par 842 1093 1137 0 1616 1857 \cf3 !from Houston;\cf2 \par 2396 2136 2180 1616 0 2900 \cf3 !from LA;\cf2 \par 1196 764 798 1857 2900 0;\cf3 !from Montreal;\cf2 \par \cf1 ENDDATA\cf2 \par \cf3 !----------------------------------------------;\cf2 \par \cf3 !The model size: Warning, may be slow for N > 8;\cf2 \par N = \cf1 @SIZE\cf2 ( CITY); \par \cf3 !The objective is to minimize total dist. of links;\cf2 \par \cf1 MIN\cf2 = \cf1 @SUM\cf2 ( LINK: DIST * X); \par \cf3 !For city K, except the base, ... ;\cf2 \par \cf1 @FOR\cf2 ( CITY( K)| K #GT# 1: \cf3 ! It must be entered;\cf2 \par \cf1 @SUM\cf2 ( CITY( I)| I #NE# K: X( I, K)) = 1; \par \cf3 !If there i