Linear Programming Solver (2 Variables)
Objective Function
Maximize Z = (a)x + (b)y
Constraints (≤ format)
Enter coefficients for: (C1)x + (C2)y ≤ Value
1:
x +
y ≤
2:
x +
y ≤
3:
x +
y ≤
* Non-negativity constraints (x ≥ 0, y ≥ 0) are applied automatically.
Optimization Result
Understanding Linear Programming
Linear Programming (LP) is a mathematical modeling technique used to achieve the best outcome (such as maximum profit or lowest cost) in a mathematical model whose requirements are represented by linear relationships. This specific tool solves 2-variable maximization problems using the Graphical Method logic.
Core Components of a Linear Programming Problem
- Decision Variables (x and y): These represent the quantities we want to determine (e.g., number of units of Product A and Product B to manufacture).
- Objective Function: The linear equation you want to maximize (Profit) or minimize (Cost).
- Constraints: Linear inequalities that represent the limitations of your resources, such as labor hours, raw materials, or budget.
- Feasible Region: The set of all possible points (x, y) that satisfy all constraints simultaneously.
Real-World Example: Production Mix
Imagine a carpenter makes tables (x) and chairs (y).
- Profit: Each table yields $30 profit, and each chair yields $50 profit. (Maximize Z = 30x + 50y)
- Constraint 1 (Wood): Tables use 1 unit of wood, chairs use 2 units. Total wood available is 10 units. (1x + 2y ≤ 10)
- Constraint 2 (Labor): Tables take 4 hours, chairs take 1 hour. Total labor available is 12 hours. (4x + 1y ≤ 12)
By entering these values into the calculator above, you can find the exact production mix that yields the highest possible profit without exceeding resources.
Maximum Value (Z): ' + maxZ.toLocaleString(undefined, {maximumFractionDigits: 4}) + '
' +
'' +
'
' +
'The optimal solution occurs at vertex (' + bestX.toFixed(2) + ', ' + bestY.toFixed(2) + ') of the feasible region boundary.';
}
Optimal Variable x: ' + bestX.toLocaleString(undefined, {maximumFractionDigits: 4}) + '
' +
'Optimal Variable y: ' + bestY.toLocaleString(undefined, {maximumFractionDigits: 4}) + '
' +
'