max f( x1, x2, ..., xn ); // Objective function subject to: g1( x1, x2, ..., xn ) = c1 // Equality constraints g2( x1, x2, ..., xn ) = c2 ... gu( x1, x2, ..., xn ) = cu h1( x1, x2, ..., xn ) ≤ d1 // Inequality constraints h2( x1, x2, ..., xn ) ≤ d2 ... hv( x1, x2, ..., xn ) ≤ dv |
|
max a1x1 + a2x2 + ... + anxn ; // Objective function subject to:c11x1 + c12x2 + ... + c1nxn ≤ d1 // Constraints c21x1 + c22x2 + ... + c2nxn ≤ d2 .... cm1x1 + cm2x2 + ... + cmnxn ≤ dm x1 ≥ 0, x2 ≥ 0, ..., xn ≥ 0 |
|
|
|
max: x1 + x2
s.t.: x1 + 2x2 ≤ 8
3x1 + 2x2 ≤ 12
x1 ≥ 0, x2 ≥ 0
|
|
So an LP is usually written as follows:
max: x1 + x2 s.t.: x1 + 2x2 ≤ 8 3x1 + 2x2 ≤ 12 |
The constraints x1 ≥ 0, x2 ≥ 0 are implicitly assumed !!!
max: x1 + x2 s.t.: x1 + 2x2 ≤ 8 3x1 + 2x2 ≤ 12 |
|
|
|
|
|
look like this:
max: x1 + x2 s.t.: x1 + 2x2 ≤ 8 3x1 + 2x2 ≤ 12 |
Answer:
|
Graphically:
We can see that:
|
Important note:
|