#
#**************************
# SET UP THE INITIAL DATA *
#**************************
#   Problem:
#   ********
#   The problem arises in the field of computer networks and parallel
#   computation.  It deals with the static load balancing in a tree
#   computer network with two-way traffic.  A set of heterogeneous host
#   computers are interconnected, in which each node processes jobs (the 
#   jobs arriving at each node according to a time invariant Poisson process) 
#   locally or sends it to a remote node,.  In the latter case, there is a
#   communication delay of forwarding the job and getting a response back.
#   The problem is then to minimize the mean response time of a job.
#   The example considered here features 11 computers arranged as follows:
#         1      6      9
#          \     |     /
#           \    |    /
#        2---4---5---8---10
#           /    |    \
#          /     |     \
#         3      7      11
#   Source:
#   J. Li and H. Kameda,
#   "Optimal load balancing in tree network with two-way traffic",
#   Computer networks and ISDN systems, vol. 25, pp. 1335-1348, 1993.
#   SIF input: Masha Sosonkina, Virginia Tech., 1995.
#   classification OLR2-MN-31-31
# Parameter assignment.
# Problem dimentions
# FI = SUM(arrival rate for a node)
# Objective function
# Constrains
# Comm. constrains
# XIJ --Link flow rate.
	param p1 := 3;
	param n := 11;
	param nlink := 20;
	param nlinkm3 := 17;
	param nlinkm4 := 16;
	param fi := 514.0;
	param cije := 9999.99;
	param ip3 := 3 + (3);
	param ip6 := 6 + (3);
	param ip8 := 8 + (3);
	param ip9 := 9 + (3);
	param i2 := 2 * (7);
	param i2p1 := 1 + (2 * (7));
	param i2p2 := 2 + (2 * (7));

	var x4_1 >= 0.0;
	var x1_4 >= 0.0;
	var x4_2 >= 0.0;
	var x2_4 >= 0.0;
	var x4_3 >= 0.0;
	var x3_4 >= 0.0;
	var x4_5 >= 0.0;
	var x5_4 >= 0.0;
	var x5_6 >= 0.0;
	var x6_5 >= 0.0;
	var x5_7 >= 0.0;
	var x7_5 >= 0.0;
	var x5_8 >= 0.0;
	var x8_5 >= 0.0;
	var x8_9 >= 0.0;
	var x9_8 >= 0.0;
	var x8_10 >= 0.0;
	var x10_8 >= 0.0;
	var x8_11 >= 0.0;
	var x11_8 >= 0.0;
	var b1 >= 0.0 ,  <= 99.99 ,  := 95.0;
	var b2 >= 0.0 ,  <= 99.99 ,  := 95.0;
	var b3 >= 0.0 ,  <= 19.99 ,  := 19.0;
	var b4 >= 0.0 ,  <= 99.99 ,  := 70.0;
	var b5 >= 0.0 ,  <= 99.99 ,  := 70.0;
	var b6 >= 0.0 ,  <= 19.99 ,  := 19.0;
	var b7 >= 0.0 ,  <= 19.99 ,  := 19.0;
	var b8 >= 0.0 ,  <= 99.99 ,  := 70.0;
	var b9 >= 0.0 ,  <= 19.99 ,  := 19.0;
	var b10 >= 0.0 ,  <= 19.99 ,  := 19.0;
	var b11 >= 0.0 ,  <= 19.99 ,  := 19.0;

minimize obj:
	((b1 / ((100.0) - b1 ) )/102.80000000000001) + ((b2 / ((100.0) - b2 ) 
	)/102.80000000000001) + ((b3 / ((20.0) - b3 ) )/102.80000000000001) + ((b4 / 
	((100.0) - b4 ) )/102.80000000000001) + ((b5 / ((100.0) - b5 ) 
	)/102.80000000000001) + ((b6 / ((20.0) - b6 ) )/102.80000000000001) + ((b7 / 
	((20.0) - b7 ) )/102.80000000000001) + ((b8 / ((100.0) - b8 ) 
	)/102.80000000000001) + ((b9 / ((20.0) - b9 ) )/102.80000000000001) + ((b10 / 
	((20.0) - b10 ) )/102.80000000000001) + ((b11 / ((20.0) - b11 ) 
	)/102.80000000000001) + ((x4_1 / ((1000.0) - ((80.0) * x4_1 + (20.0) * x1_4 ) 
	))/6.425000000000001) + ((x4_1 / ((1000.0) - ((20.0) * x4_1 + (80.0) * x1_4 ) 
	))/25.700000000000003) + ((x4_2 / ((1000.0) - ((80.0) * x4_2 + (20.0) * x2_4 ) 
	))/6.425000000000001) + ((x4_2 / ((1000.0) - ((20.0) * x4_2 + (80.0) * x2_4 ) 
	))/25.700000000000003) + ((x4_3 / ((1000.0) - ((80.0) * x4_3 + (20.0) * x3_4 ) 
	))/6.425000000000001) + ((x4_3 / ((1000.0) - ((20.0) * x4_3 + (80.0) * x3_4 ) 
	))/25.700000000000003) + ((x1_4 / ((1000.0) - ((80.0) * x1_4 + (20.0) * x4_1 ) 
	))/6.425000000000001) + ((x1_4 / ((1000.0) - ((20.0) * x1_4 + (80.0) * x4_1 ) 
	))/25.700000000000003) + ((x2_4 / ((1000.0) - ((80.0) * x2_4 + (20.0) * x4_2 ) 
	))/6.425000000000001) + ((x2_4 / ((1000.0) - ((20.0) * x2_4 + (80.0) * x4_2 ) 
	))/25.700000000000003) + ((x3_4 / ((1000.0) - ((80.0) * x3_4 + (20.0) * x4_3 ) 
	))/6.425000000000001) + ((x3_4 / ((1000.0) - ((20.0) * x3_4 + (80.0) * x4_3 ) 
	))/25.700000000000003) + ((x8_9 / ((1000.0) - ((80.0) * x8_9 + (20.0) * x9_8 ) 
	))/6.425000000000001) + ((x8_9 / ((1000.0) - ((20.0) * x8_9 + (80.0) * x9_8 ) 
	))/25.700000000000003) + ((x8_10 / ((1000.0) - ((80.0) * x8_10 + (20.0) * x10_8 
	) ))/6.425000000000001) + ((x8_10 / ((1000.0) - ((20.0) * x8_10 + (80.0) * 
	x10_8 ) ))/25.700000000000003) + ((x8_11 / ((1000.0) - ((80.0) * x8_11 + (20.0) 
	* x11_8 ) ))/6.425000000000001) + ((x8_11 / ((1000.0) - ((20.0) * x8_11 + 
	(80.0) * x11_8 ) ))/25.700000000000003) + ((x9_8 / ((1000.0) - ((80.0) * x9_8 + 
	(20.0) * x8_9 ) ))/6.425000000000001) + ((x9_8 / ((1000.0) - ((20.0) * x9_8 + 
	(80.0) * x8_9 ) ))/25.700000000000003) + ((x10_8 / ((1000.0) - ((80.0) * x10_8 
	+ (20.0) * x8_10 ) ))/6.425000000000001) + ((x10_8 / ((1000.0) - ((20.0) * 
	x10_8 + (80.0) * x8_10 ) ))/25.700000000000003) + ((x11_8 / ((1000.0) - ((80.0) 
	* x11_8 + (20.0) * x8_11 ) ))/6.425000000000001) + ((x11_8 / ((1000.0) - 
	((20.0) * x11_8 + (80.0) * x8_11 ) ))/25.700000000000003) + ((x5_6 / ((1000.0) 
	- ((80.0) * x5_6 + (20.0) * x6_5 ) ))/6.425000000000001) + ((x5_6 / ((1000.0) - 
	((20.0) * x5_6 + (80.0) * x6_5 ) ))/25.700000000000003) + ((x6_5 / ((1000.0) - 
	((80.0) * x6_5 + (20.0) * x5_6 ) ))/6.425000000000001) + ((x6_5 / ((1000.0) - 
	((20.0) * x6_5 + (80.0) * x5_6 ) ))/25.700000000000003) + ((x5_7 / ((1000.0) - 
	((80.0) * x5_7 + (20.0) * x7_5 ) ))/6.425000000000001) + ((x5_7 / ((1000.0) - 
	((20.0) * x5_7 + (80.0) * x7_5 ) ))/25.700000000000003) + ((x7_5 / ((1000.0) - 
	((80.0) * x7_5 + (20.0) * x5_7 ) ))/6.425000000000001) + ((x7_5 / ((1000.0) - 
	((20.0) * x7_5 + (80.0) * x5_7 ) ))/25.700000000000003) + ((x5_4 / ((10000.0) - 
	((80.0) * x5_4 + (20.0) * x4_5 ) ))/6.425000000000001) + ((x5_4 / ((10000.0) - 
	((20.0) * x5_4 + (80.0) * x4_5 ) ))/25.700000000000003) + ((x4_5 / ((10000.0) - 
	((80.0) * x4_5 + (20.0) * x5_4 ) ))/6.425000000000001) + ((x4_5 / ((10000.0) - 
	((20.0) * x4_5 + (80.0) * x5_4 ) ))/25.700000000000003) + ((x5_8 / ((10000.0) - 
	((80.0) * x5_8 + (20.0) * x8_5 ) ))/6.425000000000001) + ((x5_8 / ((10000.0) - 
	((20.0) * x5_8 + (80.0) * x8_5 ) ))/25.700000000000003) + ((x8_5 / ((10000.0) - 
	((80.0) * x8_5 + (20.0) * x5_8 ) ))/6.425000000000001) + ((x8_5 / ((10000.0) - 
	((20.0) * x8_5 + (80.0) * x5_8 ) ))/25.700000000000003);

subject to cnst1:
	0 >= 20.0*x4_1 + 80.0*x1_4 - 999.99;
subject to cnst2:
	0 >= 80.0*x4_1 + 20.0*x1_4 - 999.99;
subject to cnst3:
	0 >= 20.0*x4_2 + 80.0*x2_4 - 999.99;
subject to cnst4:
	0 >= 80.0*x4_2 + 20.0*x2_4 - 999.99;
subject to cnst5:
	0 >= 20.0*x4_3 + 80.0*x3_4 - 999.99;
subject to cnst6:
	0 >= 80.0*x4_3 + 20.0*x3_4 - 999.99;
subject to cnst7:
	0 >= 20.0*x5_6 + 80.0*x6_5 - 999.99;
subject to cnst8:
	0 >= 80.0*x5_6 + 20.0*x6_5 - 999.99;
subject to cnst9:
	0 >= 20.0*x5_7 + 80.0*x7_5 - 999.99;
subject to cnst10:
	0 >= 80.0*x5_7 + 20.0*x7_5 - 999.99;
subject to cnst11:
	0 >= 20.0*x8_9 + 80.0*x9_8 - 999.99;
subject to cnst12:
	0 >= 80.0*x8_9 + 20.0*x9_8 - 999.99;
subject to cnst13:
	0 >= 20.0*x8_10 + 80.0*x10_8 - 999.99;
subject to cnst14:
	0 >= 80.0*x8_10 + 20.0*x10_8 - 999.99;
subject to cnst15:
	0 >= 20.0*x8_11 + 80.0*x11_8 - 999.99;
subject to cnst16:
	0 >= 80.0*x8_11 + 20.0*x11_8 - 999.99;
subject to cnst17:
	0 >= 20.0*x4_5 + 80.0*x5_4 - 9999.99;
subject to cnst18:
	0 >= 80.0*x4_5 + 20.0*x5_4 - 9999.99;
subject to cnst19:
	0 >= 20.0*x5_8 + 80.0*x8_5 - 9999.99;
subject to cnst20:
	0 >= 80.0*x5_8 + 20.0*x8_5 - 9999.99;
subject to n1:
	x4_1 - x1_4 - b1 + 95.0 = 0;
subject to n2:
	x4_2 - x2_4 - b2 + 95.0 = 0;
subject to n3:
	x4_3 - x3_4 - b3 + 19.0 = 0;
subject to n4:
	-x4_1 + x1_4 - x4_2 + x2_4 - x4_3 + x3_4 - x4_5 + x5_4 - b4 + 70.0 = 0;
subject to n5:
	x4_5 - x5_4 - x5_6 + x6_5 - x5_7 + x7_5 - x5_8 + x8_5 - b5 + 70.0 = 0;
subject to n6:
	x5_6 - x6_5 - b6 + 19.0 = 0;
subject to n7:
	x5_7 - x7_5 - b7 + 19.0 = 0;
subject to n8:
	x5_8 - x8_5 - x8_9 + x9_8 - x8_10 + x10_8 - x8_11 + x11_8 - b8 + 70.0 = 0;
subject to n9:
	x8_9 - x9_8 - b9 + 19.0 = 0;
subject to n10:
	x8_10 - x10_8 - b10 + 19.0 = 0;
subject to n11:
	x8_11 - x11_8 - b11 + 19.0 = 0;

solve;
	display x4_1;
	display x1_4;
	display x4_2;
	display x2_4;
	display x4_3;
	display x3_4;
	display x4_5;
	display x5_4;
	display x5_6;
	display x6_5;
	display x5_7;
	display x7_5;
	display x5_8;
	display x8_5;
	display x8_9;
	display x9_8;
	display x8_10;
	display x10_8;
	display x8_11;
	display x11_8;
	display b1;
	display b2;
	display b3;
	display b4;
	display b5;
	display b6;
	display b7;
	display b8;
	display b9;
	display b10;
	display b11;
display obj;
