ÐÏࡱá>þÿ  þÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿSTNOD( ALLNODE)/ A B C D E/; LINK( ALLNODE, ALLNODE): DIST, ! The distance matrix; X; ! X( I, J) = 1 if we use link I, J; ENDSETS DATA: ! Distance matrix need not be symmetric; ! A B C D E F G H I J K; DIST =0 14 999 999 999 4 999 999 999 999 999 14 0 999 999 999 999 999 3 999 999 999 999 999 0 9 999 999 999 999 2 999 999 999 999 9 0 999 999 999 999 999 3 6 999 999 999 999 0 999 999 5 999 999 3 4 999 999 999 999 0 999 999 3 999 999 999 999 999 999 999 999 0 2 999 3 999 999 3 999 999 5 999 2 0 999 999 999 999 999 2 999 999 3 999 999 0 8 999 999 999 999 3 999 999 3 999 8 0 999 999 999 999 6 3 999 999 999 999 999 0; ENDDATA !-----------------------------------------------; ! The model size: Warning, may be slow for N > 8; N = @SIZE( ALLNODE); ! Objective is minimize total distance of links; MIN = @SUM( LINK: DIST * X); ! For each must-do node K, except the base, ... ; @FOR( MUSTNOD( K)| K #GT# 1: ! It must be entered; @SUM( ALLNODE( I)| I #NE# K: X( I, K)) = 1; ! Force U(J)=number arcs between node J and node 1. Note: This is not very strong for large problems; @FOR( ALLNODE( 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); ); ); ! There must be an arc out of node 1; @SUM( ALLNODE( J)| J #GT# 1: X( 1, J)) >= 1; !If an arc out of node J, there must be an arc in; @FOR( ALLNODE( J)| J #GT# 1: @FOR( ALLNODE( K)| K #NE# J: @SUM( ALLNODE( I)| I #NE# K #AND# I #NE# J: X( I, J)) >= X( J, K); ); ); ! Make the X's 0/1; @FOR( LINK: @BIN( X); ); ! Level of a node except the base is at least 1, no more than N-1, and is 1 if link to the base; @FOR( ALLNODE( K)| K #GT# 1: @BND( 1, U( K), 999999); U( K) < N - 1 - ( N - 2) * X( 1, K); ); END MODEL: ! (STEINERT); !Given a set of nodes, the distance between them, and a specified subset of the nodes, find the set of links so that the total distance is minimized, and there is a (unique) path between every pair of nodes in the specified subset. This is called a Steiner tree problem; SETS: ALLNODE / A B C D E F G H I J K/: U; ! U( I) = level of node I in the tree; ! U( 1) = 0; ! The subset of nodes that must be connected. The first node must be a must-do node; MUþÿÿÿýÿÿÿþÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entryÿÿÿÿÿÿÿÿ´ CONTENTSÿÿÿÿÿÿÿÿÿÿÿÿ´ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  !"#$%&þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entryÿÿÿÿÿÿÿÿ*0_šîÏ»òÀð^ JósfþÄ @ Contentsÿÿÿÿÿÿÿÿÿÿÿÿ# ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿýÿÿÿþÿÿÿ þÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  !"#$%&'()*+,-./01234þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ N - 3) * X( J, K); ); \par ); \par \cf3 ! There must be an arc out of node 1;\cf2 \par \cf1 @SUM\cf2 ( ALLNODE( J)| J #GT# 1: X( 1, J)) >= 1; \par \cf3 !If an arc out of node J, there must be an arc in;\cf2 \par \cf1 @FOR\cf2 ( ALLNODE( J)| J #GT# 1: \par \cf1 @FOR\cf2 ( ALLNODE( K)| K #NE# J: \par \cf1 @SUM\cf2 ( ALLNODE( I)| I #NE# K #AND# I #NE# J: \par X( I, J)) >= X( J, K); \par ); ); \par \cf3 ! Make the X's 0/1;\cf2 \par \cf1 @FOR\cf2 ( LINK: \cf1 @BIN\cf2 ( X); ); \par \cf3 ! Level of a node except the base is at least 1, no more than N-1, and is 1 if link to the base;\cf2 \par \cf1 @FOR\cf2 ( ALLNODE( K)| K #GT# 1: \par \cf1 @BND\cf2 ( 1, U( K), 999999); \par U( 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 ! (STEINERT);\cf2 \par \cf3 !Given a set of nodes, the distance between them, and a specified subset of the nodes, find the set of links so that the total distance is minimized, and there is a (unique) path between every pair of nodes in the specified subset. This is called a Steiner tree problem;\cf2 \par \cf1 SETS\cf2 : \par ALLNODE / A B C D E F G H I J K/: U; \par \cf3 ! U( I) = level of node I in the tree;\cf2 \par \cf3 ! U( 1) = 0;\cf2 \par \cf3 ! The subset of nodes that must be connected. The first node must be a must-do node;\cf2 \par MUSTNOD( ALLNODE)/ A B C D E/; \par LINK( ALLNODE, ALLNODE): \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 ! A B C D E F G H I J K;\cf2 \par DIST =0 14 999 999 999 4 999 999 999 999 999 \par 14 0 999 999 999 999 999 3 999 999 999 \par 999 999 0 9 999 999 999 999 2 999 999 \par 999 999 9 0 999 999 999 999 999 3 6 \par 999 999 999 999 0 999 999 5 999 999 3 \par 4 999 999 999 999 0 999 999 3 999 999 \par 999 999 999 999 999 999 0 2 999 3 999 \par 999 3 999 999 5 999 2 0 999 999 999 \par 999 999 2 999 999 3 999 999 0 8 999 \par 999 999 999 3 999 999 3 999 8 0 999 \par 999 999 999 6 3 999 999 999 999 999 0; \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 ( ALLNODE); \par \cf3 ! Objective is minimize total distance of links;\cf2 \par \cf1 MIN\cf2 = \cf1 @SUM\cf2 ( LINK: DIST * X); \par \cf3 ! For each must-do node K, except the base, ... ;\cf2 \par \cf1 @FOR\cf2 ( MUSTNOD( K)| K #GT# 1: \par \cf3 ! It must be entered;\cf2 \par \cf1 @SUM\cf2 ( ALLNODE( I)| I #NE# K: X( I, K)) = 1; \par \cf3 ! Force U(J)=number arcs between node J and node 1. Note: This is not very strong for large problems;\cf2 \par \cf1 @FOR\cf2 ( ALLNODE( J)| J #GT# 1 #AND# J #NE# K: \par U( J) >= U( K) + X ( K, J) - \par ( N - 2) * ( 1 - X( K, J)) + \par (