Graphical Method¶
Introduction to the Graphical Method¶
The Graphical Method is a visual approach to solving linear programming problems involving two decision variables. This method is limited to two-dimensional space, as it requires the problem to be represented graphically. It involves plotting the constraints as straight lines on a graph and identifying the feasible region where all constraints are satisfied. The optimal solution is found at one of the corner points (vertices) of this feasible region.
Steps for Solving a Linear Programming Problem using the Graphical Method:¶
- Formulate the Problem:
- Identify the decision variables.
- Write the objective function (to maximize or minimize).
-
Define the constraints, including non-negativity constraints.
-
Plot the Constraints: Each linear constraint is plotted as a line on the graph. This divides the plane into feasible and non-feasible regions.
-
Determine the Feasible Region: The feasible region is the area where all constraints overlap. It represents all possible solutions that satisfy the constraints.
-
Plot the Objective Function: Plot the objective function as a line and move it parallel until it touches the last point in the feasible region (either maximizing or minimizing the function).
-
Find the Optimal Solution: The optimal solution occurs at one of the vertices (corner points) of the feasible region. Evaluate the objective function at each corner point to find the best solution.
Example 1: Maximizing Profit¶
Problem:¶
A factory manufactures two products, Product X and Product Y. Each unit of Product X requires 2 hours of labor and 1 unit of raw material, while each unit of Product Y requires 1 hour of labor and 2 units of raw material. The factory has 100 hours of labor and 150 units of raw material available. The profit from Product X is $40 per unit, and from Product Y is $30 per unit. How many units of each product should the factory produce to maximize profit?
Step-by-Step Solution:¶
- Formulate the Problem:
-
Decision Variables:
Let \(x_1\) be the number of units of Product X and \(x_2\) be the number of units of Product Y. -
Objective Function:
Maximize profit:
[ Z = 40x_1 + 30x_2 ] -
Constraints:
- Labor constraint:
[ 2x_1 + x_2 \leq 100 ] - Raw material constraint:
[ x_1 + 2x_2 \leq 150 ] - Non-negativity constraints:
[ x_1 \geq 0, \quad x_2 \geq 0 ]
- Labor constraint:
-
Plot the Constraints:
-
For the labor constraint \(2x_1 + x_2 \leq 100\), rearrange the equation to: [ x_2 = 100 - 2x_1 ] This is a line with intercepts at \(x_1 = 50\) and \(x_2 = 100\).
-
For the raw material constraint \(x_1 + 2x_2 \leq 150\), rearrange the equation to: [ x_2 = \frac{150 - x_1}{2} ] This is a line with intercepts at \(x_1 = 150\) and \(x_2 = 75\).
-
Determine the Feasible Region: The feasible region is the area on the graph where both constraints overlap, bounded by the lines \(2x_1 + x_2 \leq 100\), \(x_1 + 2x_2 \leq 150\), and the non-negativity constraints \(x_1 \geq 0\) and \(x_2 \geq 0\).
-
Find the Corner Points: The corner points of the feasible region are:
- \( (0, 0) \)
- \( (0, 75) \)
- \( (50, 0) \)
-
\( (30, 40) \) (Intersection of the two constraint lines).
-
Evaluate the Objective Function at Each Corner Point:
- At \( (0, 0) \), \( Z = 40(0) + 30(0) = 0 \)
- At \( (0, 75) \), \( Z = 40(0) + 30(75) = 2250 \)
- At \( (50, 0) \), \( Z = 40(50) + 30(0) = 2000 \)
-
At \( (30, 40) \), \( Z = 40(30) + 30(40) = 1200 + 1200 = 2400 \)
-
Conclusion: The maximum profit is \( Z = 2400 \), which occurs when 30 units of Product X and 40 units of Product Y are produced.
Example 2: Minimizing Cost¶
Problem:¶
A dietitian needs to plan a meal that provides at least 24 units of protein and 36 units of carbohydrates. Two foods are available: Food A and Food B. Food A provides 6 units of protein and 4 units of carbohydrates per serving, and costs $5 per serving. Food B provides 4 units of protein and 8 units of carbohydrates per serving, and costs $7 per serving. How many servings of each food should be chosen to minimize the cost while meeting the nutritional requirements?
Step-by-Step Solution:¶
- Formulate the Problem:
-
Decision Variables:
Let \(x_1\) be the number of servings of Food A and \(x_2\) be the number of servings of Food B. -
Objective Function:
Minimize cost:
[ Z = 5x_1 + 7x_2 ] -
Constraints:
- Protein constraint:
[ 6x_1 + 4x_2 \geq 24 ] - Carbohydrate constraint:
[ 4x_1 + 8x_2 \geq 36 ] - Non-negativity constraints:
[ x_1 \geq 0, \quad x_2 \geq 0 ]
- Protein constraint:
-
Plot the Constraints:
-
For the protein constraint \(6x_1 + 4x_2 \geq 24\), rearrange the equation to: [ x_2 = \frac{24 - 6x_1}{4} ] This is a line with intercepts at \(x_1 = 4\) and \(x_2 = 6\).
-
For the carbohydrate constraint \(4x_1 + 8x_2 \geq 36\), rearrange the equation to: [ x_2 = \frac{36 - 4x_1}{8} ] This is a line with intercepts at \(x_1 = 9\) and \(x_2 = 4.5\).
-
Determine the Feasible Region: The feasible region is the area where both constraints are satisfied, considering non-negativity constraints. It is the area bounded by the lines representing the protein and carbohydrate constraints.
-
Find the Corner Points: The corner points of the feasible region are:
- \( (0, 4.5) \)
- \( (4, 0) \)
-
\( (2, 3) \) (Intersection of the two constraint lines).
-
Evaluate the Objective Function at Each Corner Point:
- At \( (0, 4.5) \), \( Z = 5(0) + 7(4.5) = 31.5 \)
- At \( (4, 0) \), \( Z = 5(4) + 7(0) = 20 \)
-
At \( (2, 3) \), \( Z = 5(2) + 7(3) = 10 + 21 = 31 \)
-
Conclusion: The minimum cost is \( Z = 20 \), which occurs when 4 servings of Food A and 0 servings of Food B are chosen.
Conclusion¶
The Graphical Method provides an intuitive way to solve linear programming problems involving two decision variables. By plotting the constraints and objective function on a graph, the feasible region is identified, and the optimal solution is found at one of the vertices of this region. While the method is simple and visual, it is only applicable to problems with two variables, making it limited in scope for more complex problems.
How can I help you today?