All Labs

Linear Programming Lab

Work through real-world optimization problems using the graphical method. Set up objective functions and constraints, visualize feasible regions, identify optimal solutions, and explore how changing parameters affects the answer.

Guided Experiment: Graphical Method

Where do you predict the optimal solution will be found: at a corner point, on an edge, or in the interior of the feasible region?

Write your hypothesis in the Lab Report panel, then click Next.

Feasible Region

FeasibleCornerOptimal

Controls

Z =x +y
x +y
x +y
x ≥ 0 and y ≥ 0 are always included.

Results

Max Z=5x+4y\text{Max } Z = 5x + 4y
Optimal Solution
(3.00,  1.50)Z=21.00(3.00,\; 1.50) \Rightarrow Z = 21.00

Corner Points

xyZ
3.001.5021.00
4.000.0020.00
0.003.0012.00
0.000.000.00

Data Table

(0 rows)
#ProblemConstraintsCorner PtsOptimal xOptimal yOptimal Z
0 / 500
0 / 500
0 / 500

Reference Guide

LP Formulation

Every linear program has three parts: decision variables, an objective function, and constraints.

Optimize Z=c1x1+c2x2\text{Optimize } Z = c_1 x_1 + c_2 x_2

The objective coefficients represent profit, cost, or some other quantity to be maximized or minimized.

Graphical Method

For two-variable problems, the graphical method plots each constraint as a line and identifies the feasible region.

a1x+b1yc1a_1 x + b_1 y \le c_1

The optimal solution is found by evaluating the objective at each corner point of the feasible polygon.

Corner Point Theorem

If a linear program has an optimal solution, it occurs at a vertex (corner point) of the feasible region.

Z=maxcorners{c1x+c2y}Z^* = \max_{\text{corners}} \{ c_1 x + c_2 y \}

This theorem makes it possible to solve LP problems by checking a finite number of points.

Binding Constraints

A constraint is binding when it holds with equality at the optimal solution. Non-binding constraints have slack.

Slack=ci(aix+biy)\text{Slack} = c_i - (a_i x^* + b_i y^*)

Only binding constraints affect the optimal value. Relaxing a non-binding constraint does not change the solution.