IT257 DAA Linear Programming
IT257 DAA Linear Programming
Linear Non-linear
Social
Deterministic Stochastic
Perspective
Single-Agent Multi-Agent
Solution Methods
Linear Programming
Linear Programming (LP)
▪ Linear – All the functions are Linear
Ex:f(x1, x2, …, xn)= c1x1 + c2 x2 + … cn xn
▪ Programming – doesn’t refer to Computer Programming,
but refers to “planning” of activity to find an optimal result
i.e., reaches the specified goal (the best solution) (according
to the mathematical model) among all feasible alternatives.
▪ Linear Programming (LP)
• LP has gained widespread industrial acceptance since 1950
for on-line optimization, blending etc.
Components of a Linear Programming Model
a
j =1
ij x j bi i = 1, 2,..., n
• Solution of LP Problems
- Simplex Method (Dantzig, 1947)
- Examine only constraint boundaries
- Very efficient, even for large problems
Steps in Setting up a LP
1. Determine and Label the Decision Variables.
2. Determine the Objective and Use the Decision Variables
to write an expression for the Objective Function.
3. Determine the Constraints - Feasible Region.
1. Determine the Explicit Constraints and write a functional
expression for each of them.
2. Determine the Implicit Constraints (Nonnegativity Constraints).
Nature Connection: Recreational Sites
2. Objective Function
Max {Z = 10 x1 + 20 x2}
3. Constraints
x1 <= 80
x2 <= 20
x1 + 4 x2 <= 120
x1 <= 80
x2 <= 20
x1 + 4 x2 <= 120
50 x1 >=0; x2 >= 0
30
20 x2 <= 20
10 Feasible Region
x1 <= 80
x2 <= 20
x1 + 4 x2 <= 120
50 x1 >=0; x2 >= 0
30
20
10 Feasible Region
x1 <= 80
x2 <= 20
x1 + 4 x2 <= 120
50 x1 >=0; x2 >= 0
10
Z = 600
50 x1 >=0; x2 >= 0
▪ Draw the constraint boundary line for each constraint. Use the origin (or any
point not on the line) to find which side of line is permitted by the constraint.
▪ Find the feasible region by determining where all the constraints are
satisfied simultaneously.
▪ Determine the slope of one objective function line (which is perpendicular to
its gradient vector). All other objective function lines will have same slope.
▪ Move a straight edge with this slope through the feasible region in the
direction of improving values of the objective function (which is the direction
of the gradient). Stop at the last instant that the straight edge still passes
through a point in the feasible region. This is optimal objective function line.
▪ A feasible point on the optimal objective function line is an optimal solution.
x2-Park No Feasible Solutions – Why?
x1 <= 80
x2 <= 20
x1 + 4 x2 <= 120
x1 + x2 >= 100
50
x1 >=0; x2 >= 0
30
20 x2 <= 20
10 Feasible Region
x1 <= 80
x2 <= 20
x1 + 4 x2 <= 120
50
x1 >=0; x2 >= 0
10
x1 <= 80
x1, x2 >=0
x1 <= 80
30
20
10 Z = 120
80 120 x1-Forest
Key Categories of LP Problems
➢ Resource-Allocation Problems
➢ Cost-benefit-trade-off Problems
➢ Distribution-Network Problems
➢ Mixed Problems
Second Example: Keeping the River Clean
Cost-benefit-trade-off problems
12 Model L
12 lathe
produced
F1 $900/machine
$900/lathe
$800/machine
$800/lathe
C2 88 lathes
Model L
needed
$800/machine
$800/lathe $900/lathe
$900/machine needed
15 lathes
15 Model L F2
produced
$700/lathe
$700/machine C3 99lathes
Model
L
needed
needed
Example:
subject to
SF1-C1 + SF1-C2 + SF1-C3 = 12
SF2-C1 + SF2-C2 + SF2-C3 = 15
SF1-C1 + SF2-C1 = 10
SF1-C2 + SF2-C2 = 8
SF1-C3 + SF2-C3 = 9
and
Sij ≥ 0 (i = F1, F2; j = C1, C2, C3).
Algebraic Formulation
Let Sij = Number of machines to ship from i to j (i = F1, F2; j = C1, C2, C3).
subject to
Factory 1: SF1-C1 + SF1-C2 + SF1-C3 = 12
Factory 2: SF2-C1 + SF2-C2 + SF2-C3 = 15
Customer 1: SF1-C1 + SF2-C1 = 10
Customer 2: SF1-C2 + SF2-C2 = 8
Customer 3: SF1-C3 + SF2-C3 = 9
and
Sij ≥ 0 (i = F1, F2; j = C1, C2, C3).
Terminology and Notations
Terminology of Solutions in LP Model
▪ Solution – not necessarily the final answer to the problem!!!
▪ Feasible Solution – Solution that satisfies all the constraints
▪ Infeasible Solution – Solution for which at least one of the
constraints is violated
▪ Feasible Region – Set of all points that satisfies all constraints
(possible to have a problem without any feasible solutions)
▪ Binding Constraint – The left-hand side (LHS) and the right-
hand side (RHS) of the constraint are equal, I.e., constraint is
satisfied in equality. Otherwise the constraint is nonbinding.
▪ Optimal Solution – Feasible Solution that has the Best Value
of the Objective Function.
Largest Value → Maximization Problems
Smallest Value → Minimization Problems
▪ Multiple Optimal Solutions, no optimal solutions, unbounded Z
3D Feasible Region
Solving Linear Programs
Solution Methods for Linear Programs
▪ Simplex Method
– Optimum must be at the intersection of constraints
– Intersections are easy to find, change inequalities to equalities
x2
cT
x1
Solution Methods for Linear Programs
x2
-cT
x1
Standard Form of the LP Model
xi >= 0 , (i =1,2,…,n)
Other Variants:
Maximize Z (instead of minimizing Z; but Min Z = - Max -Z)
Some constraints have other signs (=; and >= )
Some variables have unrestricted sign, i.e., they are not
subject to (s.t.) the non-negativity constraints.
Solving Linear Programs
Violates Divisibility Assumption of LP
▪ Divisibility Assumption of Linear Programming:
Decision variables in a Linear Programming (LP)
model are allowed to have any values, including
the fractional (noninteger) values, that satisfy all the
functional and the nonnegativity constraints i.e.,
activities can be run at the fractional levels.