Skip to content
Simplex Method Calculator Simplex Method Calculator

Graphical Method Calculator

Solve a two-variable linear programming problem by the graphical method. Enter the objective and constraints to see the feasible region, every corner point and the optimal solution on one graph.

Graphical Method Calculator

How the Graphical Method Calculator Works

The calculator follows the same steps you use on paper. It turns every inequality into a line, shades the region that satisfies all constraints together with x1 ≥ 0 and x2 ≥ 0, finds each corner point by solving pairs of boundary lines, and evaluates the objective function Z at every corner. The corner with the largest Z (for maximization) or the smallest Z (for minimization) is the optimal solution. The dashed line on the graph is the objective line passing through the optimum.

Solved Example

Maximize Z = 50x1 + 40x2 subject to 3x1 + 5x2 ≤ 150, x2 ≤ 20 and 8x1 + 5x2 ≤ 300, with x1, x2 ≥ 0. The feasible region has five corners: (0, 0), (37.5, 0), (30, 12), (16.67, 20) and (0, 20). Evaluating Z gives 0, 1875, 1980, 1633.3 and 800. The maximum is Z = 1980 at x1 = 30, x2 = 12. This example is loaded in the calculator above, and the full hand working is in our guide to the graphical method of LPP.

Steps to Solve an LPP by the Graphical Method

  1. Write the objective function and all constraints in terms of x1 and x2.
  2. Replace each inequality with an equation and plot its line using the two intercepts.
  3. Shade the side of each line that satisfies the inequality. Test the origin when the line does not pass through it.
  4. Mark the feasible region where all shaded areas overlap in the first quadrant.
  5. Find every corner point of the region by solving the equations of the lines that meet there.
  6. Evaluate Z at each corner. The best value is the optimal solution.

Special Cases You Can See on the Graph

Multiple optimal solutions: the objective line is parallel to an edge of the region, so two corners and every point between them give the same Z. Unbounded solution: the region is open and Z keeps improving. Infeasible problem: the constraints do not overlap, so no region is shaded. Each case is explained in special cases in the simplex method.

Graphical Method vs Simplex Method

The graphical method is ideal for learning and for problems with two variables because you can see why the optimum sits at a corner. The simplex method moves between the same corners algebraically and works for any number of variables. Check the same problem with the 2-variable simplex calculator to see the tableaus that reach the same corner, or read simplex method vs graphical method.

Frequently Asked Questions

What is the graphical method in linear programming?

The graphical method solves a linear programming problem with two decision variables by drawing each constraint as a line, shading the feasible region where all constraints hold, and checking the objective function at every corner point of that region. The best corner is the optimal solution.

How do I use this graphical method calculator?

Type the objective function, for example 50x1 + 40x2, enter one constraint per line such as 3x1 + 5x2 <= 150, choose Maximize or Minimize and press Solve & Graph. The calculator draws the graph, lists every corner point with its Z value and highlights the optimum.

What is the corner point method?

The corner point method evaluates the objective function at each vertex of the feasible region. Because an optimal solution of a linear program always occurs at a corner when one exists, the vertex with the best Z value is the answer.

Can the graphical method solve problems with 3 variables?

No. The graphical method only works for two variables because the feasible region must be drawn on a flat x1-x2 plane. For three or more variables use the simplex method calculator.

How does the graph show an unbounded or infeasible LPP?

If no point satisfies every constraint, there is no shaded region and the problem is infeasible. If the shaded region extends forever in the direction that improves Z, the problem is unbounded and has no finite optimum. The calculator reports both cases.

Can I use >= and = constraints?

Yes. Enter <=, >= or = in any constraint. The non-negativity conditions x1 >= 0 and x2 >= 0 are added automatically, so you do not need to type them.