123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- Codemist Standard Lisp 3.54 for DEC Alpha: May 23 1994
- Dump file created: Mon May 23 10:39:11 1994
- REDUCE 3.5, 15-Oct-93 ...
- Memory allocation: 6023424 bytes
- +++ About to read file tstlib.red
- % Examples taken from G.B. Dantzig.
- lll := {x1 >= 0,
- x1+2x2 <= 6,
- x1 + x2 >= 2,
- x1 - x2 >= 3,
- x2 >= 0,
- -2 x1 -x2 <= z };
- lll := {x1>=0,
- x1 + 2*x2<=6,
- x1 + x2>=2,
- x1 - x2>=3,
- x2>=0,
- - 2*x1 - x2<=z}
- sol := linineq(lll,{x1,x2,z=min});
- sol := {x1=6,x2=0,z=-12}
- sol := linineq(lll,{x1,x2,z=min},record=t);
- - x2 - z
- sol := {{x1=6,max(-----------,x2 + 3, - x2 + 2,0), - 2*x2 + 6},
- 2
- z + 12
- {x2=0,0,min(--------,1)},
- 3
- {z=-12,-12,inf}}
- linineq({z = x1 + 2 x2 + 3 x3 + 4 x4,
- 4 = x1 + x2 + x3 + x4,
- -2 = x1 - 2 x2 + 3 x3 - 4 x4,
- x1>=0, x2>=0, x3>=0,x4>=0}, {z=min});
- {x4=0,x3=0,x2=2,x1=2,z=6}
- linineq({z = x1 + 2 x2 + 3 x3 + 4 x4,
- 4 = x1 + x2 + x3 + x4,
- -2 = x1 - 2 x2 + 3 x3 - 4 x4,
- x1>=0, x2>=0, x3>=0,x4>=0}, {z=max});
- {x4=2,x3=2,x2=0,x1=0,z=14}
- linineq({ x1 + x2 >= 1,
- x1 + x2 <= 2,
- x1 - x2 <= 1,
- x1 - x2 >=-1,
- -x2 =z } , {z=min});
- 3 1 - 3
- {x2=---,x1=---,z=------}
- 2 2 2
- linineq({ 5x1 - 4x2 + 13x3 - 2x4 + x5 = 20,
- x1 - x2 + 5x3 - x4 + x5 = 8,
- x1 + 6x2 - 7x3 + x4 + 5x5 = z,
- x1>=0,x2>=0,x3>=0,x4>=0,x5>=0}, {z=min});
- 12 4 - 60
- {x5=0,x4=0,x3=----,x2=---,x1=0,z=-------}
- 7 7 7
- % Examples for integer and mixed integer linear programming
- % (Beightler, Phillips, Wilde, pp. 142 ff)
- linineq({z= 3x1 + 2x2,
- 5x1 + 4x2 <= 23.7,
- x1 >= 0,
- x2 >= 0},
- {z=max},
- int={x1,x2});
- {x2=2,x1=3,z=13}
- linineq({z= x1 + x2,
- -2x1 + 5x2 <= 8,
- 6x1 + x2 <= 30,
- x1 >= 0,
- x2 >= 0},
- {z=max},
- int={x1,x2});
- {x2=3,x1=4,z=7}
- linineq({z=-7x1 + 106x2,
- -x1 + 15x2 <= 90,
- x1 + 2x2 <= 35,
- -3x1 + 4x2 <= 12,
- x1 >= 0,
- x2 >= 0},
- {z=max},
- int={x1,x2});
- {x2=7,x1=15,z=637}
- linineq({z=9x1 + 6x2 + 5x3,
- 2x1 + 3x2 + 7x3 <= 35/2,
- 4x1 + 9x3 <= 15,
- x1 >= 0,
- x2 >= 0,
- x3 >= 0},
- {z=max},
- int={x1});
- 23
- {x3=0,x2=----,x1=3,z=50}
- 6
- % a case where the extremum requirement cannot be resolved
- sol := linineq(lll,{x1,x2,z=max});
- sol := {}
- % print the selection from the intervals:
- on prlinineq;
- sol := linineq(lll,{x1,x2,z=min});
- variables:(x1 x2 z)
- - 12 <= z <= inf; minimum: z=-12
- 0 <= x2 <= 0; zero length interval: x2=0
- 6 <= x1 <= 6; zero length interval: x1=6
- sol := {x1=6,x2=0,z=-12}
- sol := linineq(lll,{x1,x2,z=max});
- variables:(x1 x2 z)
- - 12 <= z <= inf; max/min cannot be resolved
- sol := {}
- % print the full elimination process
- on trlinineq;
- sol := linineq(lll,{x1,x2,z=min});
- variables:(x1 x2 z)
- --------------------------------
- next variable:x1; initial system:
- {z>= - 2*x1 - x2,
- x2>=0,
- x1 - x2>=3,
- x1 + x2>=2,
- 6>=x1 + 2*x2,
- x1>=0}
- --------------------------------
- normalized and reduced:
- {x1>=0,
- - x1 - 2*x2>=-6,
- x1 + x2>=2,
- x1 - x2>=3,
- x2>=0,
- 2*x1 + x2 + z>=0}
- --------------------------------
- class 1:
- - x2 - z
- {x1>=-----------,x1>=x2 + 3,x1>= - x2 + 2,x1>=0}
- 2
- --------------------------------
- class 2:
- { - 2*x2 + 6>=x1}
- --------------------------------
- class 3:
- {x2>=0}
- --------------------------------
- class 4:
- {}
- --------------------------------
- next variable:x2; initial system:
- {x2>=0,
- - x2 - z
- - 2*x2 + 6>=-----------,
- 2
- - 2*x2 + 6>=x2 + 3,
- - 2*x2 + 6>= - x2 + 2,
- - 2*x2 + 6>=0}
- --------------------------------
- normalized and reduced:
- { - x2>=-1, - 3*x2 + z>=-12,x2>=0}
- --------------------------------
- class 1:
- {x2>=0}
- --------------------------------
- class 2:
- z + 12
- {-------->=x2,1>=x2}
- 3
- --------------------------------
- class 3:
- {}
- --------------------------------
- class 4:
- {}
- --------------------------------
- next variable:z; initial system:
- z + 12
- {-------->=0,1>=0}
- 3
- --------------------------------
- normalized and reduced:
- {0>=-1,z>=-12}
- --------------------------------
- class 1:
- {z>=-12}
- --------------------------------
- class 2:
- {}
- --------------------------------
- class 3:
- {}
- --------------------------------
- class 4:
- {0>=-1}
- - 12 <= z <= inf; minimum: z=-12
- 0 <= x2 <= 0; zero length interval: x2=0
- 6 <= x1 <= 6; zero length interval: x1=6
- sol := {x1=6,x2=0,z=-12}
- end;
- (linineq 1250 0)
- End of Lisp run after 1.28+0.63 seconds
|