Enter the Primal Linear Program
Feasible Region and Corner Points
The graph is drawn for two-variable primal models. It shows constraint boundaries and feasible corner candidates.
Sample Linear Program
| Item | x1 | x2 | Relation | RHS |
|---|---|---|---|---|
| Objective Max Z | 3 | 5 | ||
| Resource 1 | 2 | 1 | ≤ | 100 |
| Resource 2 | 1 | 2 | ≤ | 80 |
| Resource 3 | 1 | 0 | ≤ | 40 |
Dual Linear Programming Rules
Primal max form: Maximize Z = cTx, subject to Ax ≤ b and x ≥ 0.
Dual min form: Minimize W = bTy, subject to ATy ≥ c and y ≥ 0.
Corner method: solve boundary intersections, keep feasible points, then optimize c1x1 + c2x2.
For a maximization primal, a ≤ constraint creates a nonnegative dual variable. A ≥ constraint creates a nonpositive dual variable. An equality constraint creates a free dual variable. For a minimization primal, the ≤ and ≥ sign rules reverse.
Step-by-Step Use
- Select whether the primal model is a maximization or minimization problem.
- Choose the number of decision variables and constraints.
- Enter the objective coefficients for x1, x2, and any extra variables.
- Enter each constraint row, inequality sign, and right hand side value.
- Press Calculate Dual to create the dual model and solve supported two-variable cases.
- Review the chart, slack table, dual signs, and objective comparison.
- Use the CSV or PDF buttons to save the result.
Understanding Dual Linear Programming
Dual linear programming is a useful way to read any linear model from another side. A primal model uses activities, resources, limits, and profit or cost coefficients. The dual model turns those limits into values. These values are often called shadow prices.
This calculator helps you build both models in one workspace. You enter the primal objective coefficients, constraint coefficients, relation signs, and right hand side values. The tool writes the matching dual structure automatically. It also solves two variable cases by checking feasible corner points. That makes it practical for classroom work, planning examples, and sensitivity checks.
The main idea is simple. Every primal constraint becomes one dual variable. Every primal variable becomes one dual constraint. A maximization model with less than or equal constraints becomes a minimization dual with greater than or equal constraints. A minimization model uses the reverse pattern. Equality constraints create free dual variables, because their value can move above or below zero.
The graphical solver is based on the corner point method. It draws the original constraint lines, finds boundary intersections, removes infeasible points, and evaluates the objective at each remaining point. The best point is reported with slack or surplus values. When the dual also has two variables, the same method can compare the dual result.
Use the output as a guide, not as a replacement for formal proof. Linear programs can be unbounded, degenerate, infeasible, or affected by unusual sign rules. Large models should be checked with a professional optimization solver. Still, this page gives a clear learning path. You can see how each coefficient moves from the primal table into the dual table. You can also export the summary for notes, reports, or worksheets.
For best results, start with a clean standard form. Keep units consistent. Use positive right hand side values when possible. Review each inequality sign before solving. Then compare the primal value, dual value, slacks, and chart. These pieces show how the model behaves, where resources bind, and which limits have the strongest economic meaning.
Finally, test changed coefficients often today with care. Small changes reveal tradeoffs and hidden bottlenecks. They support safer decisions before real planning work.
Frequently Asked Questions
1. What does a dual model show?
It shows the value of constraints in the primal model. Each primal constraint becomes a dual variable, often interpreted as a shadow price.
2. Can this calculator solve every linear program?
It forms dual models for several sizes. The built-in graphical solver is limited to two-variable primal or two-variable dual cases.
3. Why are some dual variables free?
A free dual variable usually comes from an equality constraint in the primal. It can take positive, negative, or zero values.
4. What is slack in this tool?
Slack is unused capacity for a less than or equal constraint. Surplus is the extra amount above a greater than or equal requirement.
5. Why do primal and dual values match?
When both models are feasible and bounded, strong duality says their optimal objective values match under standard linear programming assumptions.
6. What if no corner point appears?
The model may be infeasible, entered incorrectly, or outside the graphical solver scope. Check signs, right hand side values, and coefficients.
7. Can I use negative coefficients?
Yes. Negative coefficients are accepted. Review the graph and equations carefully because negative values can change the feasible region shape.
8. Are exported files based on current results?
Yes. The CSV and PDF buttons use the visible calculation summary from the latest submitted model.