SOLVING LINEAR PROGRAMS Dr. Ron Lembke
Solving LPs Need a more formal method How to find points to solve for? A picture is worth a thousand words
Standard Form Linear programs are written the following way: Max20S+25T s.t.0.5S+0.2T<= S+0.5T<=56 S>=0 T>=0 Space Time
Graphical Solution Sweatshirts T-shirts T S Draw a picture to represent the feasible combinations of S and T, that meet all of the constraints, and find the best point Draw a line of all points that would exactly use up all of the space, and a line of all the points that would exactly use up all of the time
Endpoints of constraints Space:0.5S+0.2T<=40 If S=0, then 0.2T=40, so T=200 (0,200) If T=0, then 0.5S=40, so S=80 (80,0) Time: 0.25S+0.5T<=56 If S=0, 0.5T=56, so T=112(0,112) If T=0, 0.25S=56, so S=224(224,0) Hey! These look familiar!
Graphical Solution Sweatshirts T-shirts T S Draw a line to represent Space constraint Space Constraint S=0, T=200 S=80, T=0
Graphical Solution Sweatshirts T-shirts T S Draw a line to represent Time constraint Time Constraint S=0, T=112 S=224, T=0
Graphical Solution Sweatshirts T-shirts T S Green area satisfies all constraints “Feasible Region” Time Constraint S=0, T=112 Space S=80, T=
Graphical Solution Sweatshirts T-shirts T S Last time, we started at (0,112) in search of a better solution. We traded 1 T for 2S, which kept the amount of time used constant, and kept doing that until we used up all of the space (that is, hit the space constraint). Time Constraint S=0, T=112 Space S=80, T=
Graphical Solution Sweatshirts T-shirts T S Where do constraints intersect? Where the lines cross - the point is on both 0.5S T= S + 0.5T= 56 So for S and T. Two equations, two unknowns Algebra! Woohoo!! Time Constraint S=0, T=112 Space S=80, T=
Graphical Solution Sweatshirts T-shirts T S Multiply one (or both) to get same coefficients 0.5S T=40 [0.25S+ 0.5T =56] x2 becomes 0.5S + 1 T = 112 -[0.5S + 0.2T = 40] subtract the first one S + 0.8T = 72, so T = 72/0.8 = 90 Substitute into any of the three equations: 0.5S + 0.2*90 = 40, so 0.5S = = 22 So S =22/0.5 = 44 Optimal = (44, 90) Time S=0, T=112 Space S=80, T=
Evaluate Profits at Intersection Points Sweatshirts T-shirts T S S = 44, T=90 Z=20* *90 = = 3,130 Time S=0, T=112 Z=20*0+25*112 = 2,800 Space S=80, T=0 Z=20*80 +25*0 =
Edge Points Better than Interior Points A BC A has to be better than B C has to be better than B To figure out if A or C is better, have to evaluate the objective function at both.
Corner Points Better than Middle Edge E D F IF E is better than D, then F will be better than D or E Or, IF E is better than F, D will be better than E or F. Using same logic, either F or H has to be better than G. One has to be better than G. G H
Find all the Corner Points of Feasible Space There can be many, many constraints. Find the feasible space. Ignore constraints that don’t border it. Constraints can be vertical or horizontal.
Solution Method (For 2 variables only) 1. Find end points of each constraint 2. Draw constraints 3. Figure out which intersections are interesting 4. Use algebra to solve for intersection pts 5. Find profits (or costs) of intersections 6. Choose the best one