0% found this document useful (0 votes)
6 views

Linear Programing

Linear programming (LP) is a method for optimizing outcomes like profit or cost under specific constraints expressed as linear equations. Key components include decision variables, constraints, and objective functions, with methods such as the graphical and simplex methods for solving LP problems. LP is widely applicable in various fields, including manufacturing, transportation, and resource allocation.

Uploaded by

Jessi Mindset
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Linear Programing

Linear programming (LP) is a method for optimizing outcomes like profit or cost under specific constraints expressed as linear equations. Key components include decision variables, constraints, and objective functions, with methods such as the graphical and simplex methods for solving LP problems. LP is widely applicable in various fields, including manufacturing, transportation, and resource allocation.

Uploaded by

Jessi Mindset
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Linear Programming

Linear programming (LP), also called linear optimization, is a way to find the best outcome
(like maximum profit or minimum cost) in a problem where certain rules or limits (called
constraints) must be followed. These rules can be in the form of equalities or inequalities.
Linear programming helps solve problems by figuring out the most efficient solution within
a given set of conditions.

In simpler terms, linear programming is a method used to get the best result for a problem
while meeting certain requirements, all expressed through simple, straight-line
relationships. The goal is to find the best possible answer.

To use linear programming, a few basic rules apply:

 Constraints should be measured in numbers.


 The relationship between the rules (constraints) and the goal (objective) should be
simple and linear.
 The main objective (like profit or cost) should be optimized (made as large or small
as possible).

Equality and Inequality

When talking about equality of real numbers, there's just one type of relation called
"equality," but there are five different types of inequalities.

𝑥 = 𝑦 means that x is exactly the same number as y. This is equality.

𝑥 ≠ 𝑦 means that x is not the same number as y.

𝑥 > 𝑦 means that x is a greater number than y.

𝑥 < 𝑦 y means that x is a smaller number than y

𝑥 ≥ 𝑦 means that x is either greater than or equal to y.

𝑥 ≤ 𝑦 means that x is either less than or equal to y.


Limitation
Linear programming (LP) always has a linear objective function. The key feature of linear
programming is that both the objective function (the function to be maximized or
minimized) and the constraints must be linear. A linear objective function means it can be
expressed as a straight-line equation, where each variable is multiplied by a constant, and
the sum of these terms gives the value to optimize (maximize or minimize).

If the objective function or constraints are not linear, the problem would no longer be
considered a linear programming problem but could fall under a different category, such as
nonlinear programming.

Components of Linear Programming

The key parts of linear programming include:

 Decision Variables
 Constraints
 Data
 Objective Functions

Characteristics of Linear Programming

The main features of a linear programming problem are:

 Constraints – Limitations on resources must be expressed in mathematical terms.


 Objective Function – The goal of the problem should be clearly defined in numerical
terms.
 Linearity – The relationship between variables in the function must be linear,
meaning each variable is of degree one.
 Finiteness – There must be a limited number of inputs and outputs. If there are
infinite factors, finding an optimal solution is impossible.
 Non-negativity – Variable values must be either positive or zero; they cannot be
negative.
 Decision Variables – These are the variables that determine the outcome.
Identifying them is the first step in solving any problem.
Linear Programming Problems

Linear Programming Problems (LPP) involve finding the best possible outcome (either
maximum or minimum value) for a given linear function, known as the objective function.
This function includes multiple variables that must meet certain conditions, represented by
linear inequalities called constraints. LPPs are used to find optimal solutions in various
situations, such as manufacturing, diet planning, transportation, and resource allocation
problems.

Methods to Solve Linear Programming Problems

Linear programming problems can be solved using various methods, including the graphical
method, the simplex method, and tools like R or OpenSolver. Two of the most widely used
techniques are the simplex method and the graphical method, which are often discussed in
detail.

Graphical Method: Example and Steps

Question: A doctor wishes to mix two types of foods in such a way that the vitamin contents of the
mixture contain at least 8 units of vitamin A and 10 units of vitamin C. Food ‘I’ contains 2 units/kg of
vitamin A and 1 unit/kg of vitamin C. Food ‘II’ contains 1 unit/kg of vitamin A and 2 units/kg of
vitamin C. It costs Rs 50 per kg to purchase Food ‘I’ and Rs 70 per kg to purchase Food ‘II’. Formulate
this problem as a linear programming problem to minimize the cost of such a mixture

Step 1: Define the Decision Variables

Let:

 x1= the number of kilograms of Food I.


 x2 = the number of kilograms of Food II.

Step 2: Formulate the Objective Function

The goal is to minimize the cost of the food mixture. The cost is given by Rs 50 per kg for
Food I and Rs 70 per kg for Food II. Therefore, the objective function to minimize is:

Minimize 𝑍 = 50𝑋1 + 70𝑋2


Step 3: Set Up the Constraints

We need to satisfy the minimum requirements for vitamins A and C.

 Vitamin A constraint:
Food I provides 2 units of vitamin A per kg, and Food II provides 1 unit per kg. The
mixture must contain at least 8 units of vitamin A:

2𝑋1 + 𝑋2 ≥ 8

 Vitamin C constraint:

Food I provides 1 unit of vitamin C per kg, and Food II provides 2 units per kg. The mixture
must contain at least 10 units of vitamin C:

𝑋1 + 2𝑋2 ≥ 10

Step 4: Rearrange Constraints for Graphical Solution

To graph the constraints, we first convert the inequalities to equations:

1. Vitamin A constraint:

2𝑋1 + 𝑋2 = 8

To plot the above line:

𝑋1 = 0, 𝑋2 = 8

𝑋2 = 0, 𝑋1 = 4

2. Vitamin C constraint:

𝑋1 + 2𝑋2 = 10
To plot the above line:

𝑋1 = 0, 𝑋2 = 5

𝑋2 = 0, 𝑋1 = 10

2 4 10

Coordinates in feasible region are (0, 8), (2, 4) and (10, 0) and there cost is 560, 380 and
400. The optimal solution is (2, 4) with minimum cost of 380.

Problem 2:

A company produces two products: Product A and Product B. The company wants to maximize
its profit. Each unit of Product A gives a profit of $30, and each unit of Product B gives a profit
of $20.

However, the production is limited by the availability of two resources: Resource 1 and
Resource 2.

 Each unit of Product A requires 2 hours of Resource 1 and 1 hour of Resource 2.


 Each unit of Product B requires 1 hour of Resource 1 and 2 hours of Resource 2.
 There are a total of 10 hours available for Resource 1 and 8 hours available for Resource
2.

The company wants to determine how many units of Product A and Product B to produce to
maximize profit.

Answer: Maximum profit is 160 (4, 2)


Problem 3: Factory Production Problem

Problem:

A factory produces two types of products: Tables and Chairs. To make each table, 4 hours of
carpentry work and 2 hours of painting work are required. Each chair requires 3 hours of carpentry
work and 1 hour of painting work. The factory has a maximum of 24 hours available for carpentry
and 8 hours for painting each day. The profit from each table is $40, and from each chair, it's $25.

The factory wants to maximize its daily profit.

Answer: Maximum profit is 200 (0, 8)

Problem 4: Diet Problem

Problem:

A person wants to choose a mix of two foods, Food A and Food B, to meet their daily protein and
fat requirements while minimizing cost. Each unit of Food A contains 5 grams of protein and 4
grams of fat, and each unit of Food B contains 3 grams of protein and 6 grams of fat. The person
needs at least 15 grams of protein and 12 grams of fat daily. The cost of Food A is $3 per unit, and
the cost of Food B is $2 per unit.

Answer: Minimum cost is 9 (3, 0)


SIMPLEX METHOD

Steps for Solving Simplex Method

1. Decision variable
2. Objective function
3. Constraint
4. Standard form (Slack variable)
5. Initial Simplex Table
6. Entering variable (highest negative coefficient in Obj function)
7. Ratio
8. Leaving variable
9. Pivot operation (to make pivot element =1 and others =0)
10. Next Entering variable (highest negative coefficient in Obj
function)
11. Apply Pivot operation (to make pivot element =1 and others =0)
12. Optimal Solution

Problem 1:
A doctor wishes to mix two types of foods in such a way that the vitamin contents of the mixture
contain at least 8 units of vitamin A and 10 units of vitamin C. Food ‘I’ contains 2 units/kg of vitamin
A and 1 unit/kg of vitamin C. Food ‘II’ contains 1 unit/kg of vitamin A and 2 units/kg of vitamin C. It
costs Rs 50 per kg to purchase Food ‘I’ and Rs 70 per kg to purchase Food ‘II’. Formulate this problem
as a linear programming problem to minimize the cost of such a mixture.

1. Decision variable
 𝑥1 = 𝐹𝑜𝑜𝑑 1 𝑎𝑛𝑑 𝑥2 = 𝐹𝑜𝑜𝑑 2

2. Objective function

𝑍 = 50𝑥1 + 70𝑥2

3. Constraint

2𝑥1 + 𝑥2 ≥ 8
𝑥1 + 2𝑥2 ≥ 10

4. Standard form (Slack variable)

2𝑥1 + 𝑥2 − 𝑠1 = 8

𝑥1 + 2𝑥2 − 𝑠2 = 10

5. Initial Simplex Table

Basic 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 RHS
𝒔𝟏 2 1 -1 0 8
𝒔𝟐 1 2 0 -1 10
Z -50 -70 0 0 0

6. Entering Variable

We look at the objective row (bottom row) to find highest negative coefficients.

Basic 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 RHS
𝒔𝟏 2 1 -1 0 8
𝒔𝟐 1 2 0 -1 10
Z -50 -70 0 0 0

7. Ratio

Basic 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 RHS Ratio


𝒔𝟏 2 1 -1 0 8 8
𝒔𝟐 1 2 0 -1 10 5
Z -50 -70 0 0 0
8. Leaving Variable

The smallest ratio is 5, so 𝒔𝟐 is the leaving variable and 2 is the pivot element.

Basic 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 RHS Ratio


𝒔𝟏 2 1 -1 0 8 8
𝒔𝟐 1 2 0 -1 10 5
Z -50 -70 0 0 0

9. Pivot Operation

To make pivot element =1 and others =0 in second coloumn

Divide R2 by 2

R1: R1-R2

R3: R3+R2*70
Basic 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 RHS
𝒔𝟏 1.5 0 -1 0.5 3
𝒙𝟐 0.5 1 0 -0.5 5
Z -15 0 0 -35 350

Now apply pivot operation for the second variable

Basic 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 RHS Ratio


𝒔𝟏 1.5 0 -1 0.5 3 2
𝒙𝟐 0.5 1 0 -0.5 5 10
Z -15 0 0 -35 350

Here pivot element is 1.5.

To make pivot element =1 and others =0 in second coloumn

Divide R1 by 1.5
R2: R2-(R1*0.5)
R3: R3+ (R1*15)

Basic 𝒙𝟏 𝒙𝟐 𝒔𝟏 𝒔𝟐 RHS
𝒔𝟏 1 0 -0.66 0.33 2
𝒙𝟐 0 1 0.33 -0.66 4
Z 0 0 -10 -30 380

Optimal Solution

Now the Optimal Solution is:

𝒙𝟏 = 𝟐, 𝒙𝟐 = 𝟒 𝒂𝒏𝒅 𝑻𝑪 = 𝟑𝟖𝟎

You might also like