$TITLE TRAFFIC EQUILIBRIUM -- FRIESZ ET AL. * see "Computing Wardropian Equilibria in a Complementarity Framework" * M.C. Ferris, A. Meeraus and T. F. Rutherford * Mathematical Programming Technical Report 95-03, February 1995. * ftp://ftp.cs.wisc.edu:math-prog/tech-reports/95-03.ps.Z SCALAR RHO /0.3/; SET N NODES /1*24/; ALIAS (I,N), (J,N), (K,N), (L,N); SET DEST(J) IDENTIFICATION OF DESTINATION NODES, ACTIVE(I,J,K) IDENTIFIES THE SET OF ACTIVE ARCS, A(N,N) ARCS; $INCLUDE sioux-falls.dat ACTIVE(A,K) = YES$DEST(K); ACTIVE(I,J,I) = NO; ACTIVE(I,I,J) = NO; PARAMETER ETALT(I,J), DBAR(I,J); ETALT(I,J) = 0; DBAR(I,J) = 2 * D0(I,J); VARIABLES T(I,J) TIME TO GET FROM NODE I TO NODE J, X(I,J,K) FLOW TO K ALONG ARC I-J, F(I,J) AGGREGATE FLOW ON ARC I-J, D(I,J) DEMAND FROM NODE I TO NODE J; EQUATION RATIONAL(I,J,K) COST MINIMIZATION BALANCE(I,J) MATERIAL BALANCE DEMAND(I,J) ELASTIC DEMAND FDEF(I,J) AGGREGATE FLOW DEFINITION; * The following constraint imposes individual rationality. * The time to reach node K from node I is no greater than * the time required to travel from node I to node J and then * from node J to node K. RATIONAL(I,J,K)$ACTIVE(I,J,K).. COEF_A(I,J) + COEF_B(I,J) * POWER(F(I,J)/COEF_K(I,J),4) + T(J,K) =G= T(I,K); * The flow into a node equals demand plus flow out: BALANCE(I,J).. SUM(K$ACTIVE(I,K,J),X(I,K,J)) =G= SUM(K$ACTIVE(K,I,J),X(K,I,J)) + D(I,J); * Elastic demand: DEMAND(I,J)$(D.UP(I,J) NE D.LO(I,J)).. (D(I,J) - DBAR(I,J)) * EXP(-RHO*T(I,J)) + D(I,J) * ETALT(I,J) =E= 0.0; * Flow on a given arc constitutes flows to all destinations K: FDEF(A).. F(A) =E= SUM(K$ACTIVE(A,K), X(A,K)); * Here is the MCP model: MODEL TRAFFIC /RATIONAL.X, BALANCE.T, FDEF.F, DEMAND.D/; * Initial levels for arc flows are needed so that we can * properly evaluate the nonlinear functions: F.L(A) = COEF_K(A); X.L(A,K) = 0.0; T.L(I,J) = COEF_A(I,J)$A(I,J) + SMIN(K$A(I,K),COEF_A(I,K))$(NOT A(I,J)); * Lower bounds are zero for flows, positive for times: X.LO(A,K) = 0.0; T.LO(I,J) = 0.0; * Fixing values causes corresponding equilibrium conditions * to be dropped: T.FX(I,I) = 0; F.FX(I,J)$(NOT A(I,J)) = 0; * INITIALLY FIX DEMAND: D.FX(I,J) = D0(I,J); TRAFFIC.ITERLIM = 8000; SOLVE TRAFFIC USING MCP; * CONFIGURE THE ELASTIC-DEMAND MODEL: ETALT(I,J)$D0(I,J) = EXP(-RHO*T.L(I,J)); D.UP(I,J)$D0(I,J) = +INF; D.LO(I,J)$D0(I,J) = -INF; D.L(I,J)$D0(I,J) = 0.0; F.L(A) = COEF_K(A); X.L(A,K) = 0.0; T.L(I,J) = COEF_A(I,J)$A(I,J) + SMIN(K$A(I,K),COEF_A(I,K))$(NOT A(I,J)); * CONFIRM THE SOLUTION: SOLVE TRAFFIC USING MCP;