Explore Courses
Liverpool Business SchoolLiverpool Business SchoolMBA by Liverpool Business School
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA (Master of Business Administration)
  • 15 Months
Popular
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Business Administration (MBA)
  • 12 Months
New
Birla Institute of Management Technology Birla Institute of Management Technology Post Graduate Diploma in Management (BIMTECH)
  • 24 Months
Liverpool John Moores UniversityLiverpool John Moores UniversityMS in Data Science
  • 18 Months
Popular
IIIT BangaloreIIIT BangalorePost Graduate Programme in Data Science & AI (Executive)
  • 12 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
upGradupGradData Science Bootcamp with AI
  • 6 Months
New
University of MarylandIIIT BangalorePost Graduate Certificate in Data Science & AI (Executive)
  • 8-8.5 Months
upGradupGradData Science Bootcamp with AI
  • 6 months
Popular
upGrad KnowledgeHutupGrad KnowledgeHutData Engineer Bootcamp
  • Self-Paced
upGradupGradCertificate Course in Business Analytics & Consulting in association with PwC India
  • 06 Months
OP Jindal Global UniversityOP Jindal Global UniversityMaster of Design in User Experience Design
  • 12 Months
Popular
WoolfWoolfMaster of Science in Computer Science
  • 18 Months
New
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Rushford, GenevaRushford Business SchoolDBA Doctorate in Technology (Computer Science)
  • 36 Months
IIIT BangaloreIIIT BangaloreCloud Computing and DevOps Program (Executive)
  • 8 Months
New
upGrad KnowledgeHutupGrad KnowledgeHutAWS Solutions Architect Certification
  • 32 Hours
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Popular
upGradupGradUI/UX Bootcamp
  • 3 Months
upGradupGradCloud Computing Bootcamp
  • 7.5 Months
Golden Gate University Golden Gate University Doctor of Business Administration in Digital Leadership
  • 36 Months
New
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Golden Gate University Golden Gate University Doctor of Business Administration (DBA)
  • 36 Months
Bestseller
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDoctorate of Business Administration (DBA)
  • 36 Months
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (DBA)
  • 36 Months
KnowledgeHut upGradKnowledgeHut upGradSAFe® 6.0 Certified ScrumMaster (SSM) Training
  • Self-Paced
KnowledgeHut upGradKnowledgeHut upGradPMP® certification
  • Self-Paced
IIM KozhikodeIIM KozhikodeProfessional Certification in HR Management and Analytics
  • 6 Months
Bestseller
Duke CEDuke CEPost Graduate Certificate in Product Management
  • 4-8 Months
Bestseller
upGrad KnowledgeHutupGrad KnowledgeHutLeading SAFe® 6.0 Certification
  • 16 Hours
Popular
upGrad KnowledgeHutupGrad KnowledgeHutCertified ScrumMaster®(CSM) Training
  • 16 Hours
Bestseller
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 4 Months
upGrad KnowledgeHutupGrad KnowledgeHutSAFe® 6.0 POPM Certification
  • 16 Hours
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Science in Artificial Intelligence and Data Science
  • 12 Months
Bestseller
Liverpool John Moores University Liverpool John Moores University MS in Machine Learning & AI
  • 18 Months
Popular
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
IIIT BangaloreIIIT BangaloreExecutive Post Graduate Programme in Machine Learning & AI
  • 13 Months
Bestseller
IIITBIIITBExecutive Program in Generative AI for Leaders
  • 4 Months
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
IIIT BangaloreIIIT BangalorePost Graduate Certificate in Machine Learning & Deep Learning (Executive)
  • 8 Months
Bestseller
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Liverpool Business SchoolLiverpool Business SchoolMBA with Marketing Concentration
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA with Marketing Concentration
  • 15 Months
Popular
MICAMICAAdvanced Certificate in Digital Marketing and Communication
  • 6 Months
Bestseller
MICAMICAAdvanced Certificate in Brand Communication Management
  • 5 Months
Popular
upGradupGradDigital Marketing Accelerator Program
  • 05 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Corporate & Financial Law
  • 12 Months
Bestseller
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in AI and Emerging Technologies (Blended Learning Program)
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Intellectual Property & Technology Law
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Dispute Resolution
  • 12 Months
upGradupGradContract Law Certificate Program
  • Self paced
New
ESGCI, ParisESGCI, ParisDoctorate of Business Administration (DBA) from ESGCI, Paris
  • 36 Months
Golden Gate University Golden Gate University Doctor of Business Administration From Golden Gate University, San Francisco
  • 36 Months
Rushford Business SchoolRushford Business SchoolDoctor of Business Administration from Rushford Business School, Switzerland)
  • 36 Months
Edgewood CollegeEdgewood CollegeDoctorate of Business Administration from Edgewood College
  • 24 Months
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with Concentration in Generative AI
  • 36 Months
Golden Gate University Golden Gate University DBA in Digital Leadership from Golden Gate University, San Francisco
  • 36 Months
Liverpool Business SchoolLiverpool Business SchoolMBA by Liverpool Business School
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA (Master of Business Administration)
  • 15 Months
Popular
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Business Administration (MBA)
  • 12 Months
New
Deakin Business School and Institute of Management Technology, GhaziabadDeakin Business School and IMT, GhaziabadMBA (Master of Business Administration)
  • 12 Months
Liverpool John Moores UniversityLiverpool John Moores UniversityMS in Data Science
  • 18 Months
Bestseller
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Science in Artificial Intelligence and Data Science
  • 12 Months
Bestseller
IIIT BangaloreIIIT BangalorePost Graduate Programme in Data Science (Executive)
  • 12 Months
Bestseller
O.P.Jindal Global UniversityO.P.Jindal Global UniversityO.P.Jindal Global University
  • 12 Months
WoolfWoolfMaster of Science in Computer Science
  • 18 Months
New
Liverpool John Moores University Liverpool John Moores University MS in Machine Learning & AI
  • 18 Months
Popular
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (AI/ML)
  • 36 Months
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDBA Specialisation in AI & ML
  • 36 Months
Golden Gate University Golden Gate University Doctor of Business Administration (DBA)
  • 36 Months
Bestseller
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDoctorate of Business Administration (DBA)
  • 36 Months
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (DBA)
  • 36 Months
Liverpool Business SchoolLiverpool Business SchoolMBA with Marketing Concentration
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA with Marketing Concentration
  • 15 Months
Popular
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Corporate & Financial Law
  • 12 Months
Bestseller
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Intellectual Property & Technology Law
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Dispute Resolution
  • 12 Months
IIITBIIITBExecutive Program in Generative AI for Leaders
  • 4 Months
New
IIIT BangaloreIIIT BangaloreExecutive Post Graduate Programme in Machine Learning & AI
  • 13 Months
Bestseller
upGradupGradData Science Bootcamp with AI
  • 6 Months
New
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
KnowledgeHut upGradKnowledgeHut upGradSAFe® 6.0 Certified ScrumMaster (SSM) Training
  • Self-Paced
upGrad KnowledgeHutupGrad KnowledgeHutCertified ScrumMaster®(CSM) Training
  • 16 Hours
upGrad KnowledgeHutupGrad KnowledgeHutLeading SAFe® 6.0 Certification
  • 16 Hours
KnowledgeHut upGradKnowledgeHut upGradPMP® certification
  • Self-Paced
upGrad KnowledgeHutupGrad KnowledgeHutAWS Solutions Architect Certification
  • 32 Hours
upGrad KnowledgeHutupGrad KnowledgeHutAzure Administrator Certification (AZ-104)
  • 24 Hours
KnowledgeHut upGradKnowledgeHut upGradAWS Cloud Practioner Essentials Certification
  • 1 Week
KnowledgeHut upGradKnowledgeHut upGradAzure Data Engineering Training (DP-203)
  • 1 Week
MICAMICAAdvanced Certificate in Digital Marketing and Communication
  • 6 Months
Bestseller
MICAMICAAdvanced Certificate in Brand Communication Management
  • 5 Months
Popular
IIM KozhikodeIIM KozhikodeProfessional Certification in HR Management and Analytics
  • 6 Months
Bestseller
Duke CEDuke CEPost Graduate Certificate in Product Management
  • 4-8 Months
Bestseller
Loyola Institute of Business Administration (LIBA)Loyola Institute of Business Administration (LIBA)Executive PG Programme in Human Resource Management
  • 11 Months
Popular
Goa Institute of ManagementGoa Institute of ManagementExecutive PG Program in Healthcare Management
  • 11 Months
IMT GhaziabadIMT GhaziabadAdvanced General Management Program
  • 11 Months
Golden Gate UniversityGolden Gate UniversityProfessional Certificate in Global Business Management
  • 6-8 Months
upGradupGradContract Law Certificate Program
  • Self paced
New
IU, GermanyIU, GermanyMaster of Business Administration (90 ECTS)
  • 18 Months
Bestseller
IU, GermanyIU, GermanyMaster in International Management (120 ECTS)
  • 24 Months
Popular
IU, GermanyIU, GermanyB.Sc. Computer Science (180 ECTS)
  • 36 Months
Clark UniversityClark UniversityMaster of Business Administration
  • 23 Months
New
Golden Gate UniversityGolden Gate UniversityMaster of Business Administration
  • 20 Months
Clark University, USClark University, USMS in Project Management
  • 20 Months
New
Edgewood CollegeEdgewood CollegeMaster of Business Administration
  • 23 Months
The American Business SchoolThe American Business SchoolMBA with specialization
  • 23 Months
New
Aivancity ParisAivancity ParisMSc Artificial Intelligence Engineering
  • 24 Months
Aivancity ParisAivancity ParisMSc Data Engineering
  • 24 Months
The American Business SchoolThe American Business SchoolMBA with specialization
  • 23 Months
New
Aivancity ParisAivancity ParisMSc Artificial Intelligence Engineering
  • 24 Months
Aivancity ParisAivancity ParisMSc Data Engineering
  • 24 Months
upGradupGradData Science Bootcamp with AI
  • 6 Months
Popular
upGrad KnowledgeHutupGrad KnowledgeHutData Engineer Bootcamp
  • Self-Paced
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Bestseller
upGradupGradUI/UX Bootcamp
  • 3 Months
upGradupGradCloud Computing Bootcamp
  • 7.5 Months
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 5 Months
upGrad KnowledgeHutupGrad KnowledgeHutSAFe® 6.0 POPM Certification
  • 16 Hours
upGradupGradDigital Marketing Accelerator Program
  • 05 Months
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
upGradupGradData Science Bootcamp with AI
  • 6 Months
Popular
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Bestseller
upGradupGradUI/UX Bootcamp
  • 3 Months
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 4 Months
upGradupGradCertificate Course in Business Analytics & Consulting in association with PwC India
  • 06 Months
upGradupGradDigital Marketing Accelerator Program
  • 05 Months
  • Home
  • Blog
  • Data Science
  • Linear Programming Problems (LPP): Formulas and Real-World Examples With Solutions

Linear Programming Problems (LPP): Formulas and Real-World Examples With Solutions

By Rohit Sharma

Updated on Feb 03, 2025 | 19 min read

Share:

Linear programming problems (LPP) are mathematical techniques used to optimize outcomes while adhering to constraints. These problems help solve resource allocation, cost reduction, and profit maximization challenges across industries such as logistics, manufacturing, and finance. 

By converting real-world situations into mathematical models, LPP provides precise and effective solutions. This blog explains the key formulas, fundamental concepts, and practical examples of LPP, along with solutions, to demonstrate how it simplifies complex decision-making.

Understanding Linear Programming Problems (LPP): Importance and Key Terminologies

Linear Programming Problems (LPP) are used in various industries, including logistics, manufacturing, and finance, to optimize resource allocation and maximize profit while adhering to constraints like cost, time, and capacity. These problems aim to optimize a particular outcome, such as cost, profit, or resource allocation while considering specific limitations like resources, time, or budget.

This technique is important because it helps businesses solve complex problems by providing optimal solutions that satisfy multiple constraints simultaneously. For example, a company may want to maximize profit while considering constraints like material availability, labor hours, or production capacity.

Based on constraints or objectives, linear programming problems (LPP) can be divided into four types:

  • Maximization Problem: The aim is to maximize a linear function, commonly seen in profit optimization scenarios.

    Example: A marketing company can maximize its profits without increasing budgets or changing the maximum working hours.

  • Minimization Problem: The objective is to minimize a linear function, often used in cost reduction or loss minimization.

    Example: A logistics company can use linear programming to determine the most efficient routes and minimize transportation costs, reducing its operational expenses.

  • Standard Form: This refers to LPPs where all constraints are written as less than or equal to inequalities, and the objective function is to be maximized.

    Example: A restaurant chain can maximize its revenue by offering the most profitable combination of dishes on the menu.

  • Canonical Form: In this form, all constraints are equalities, and the decision variables are non-negative.

    Example: Optimizing operations of a resort by reducing costs on cleaning, while meeting exact room booking targets.

Learn how to use linear programming to solve real-world problems in machine learning. Enroll in upGrad’s Online Artificial Intelligence & Machine Learning Programs to boost your knowledge of this vital technique. 

By understanding the core principles and types of problems in linear programming, businesses can improve operational efficiency and make data-driven decisions. However, to solve these problems, you need to understand the common terminologies used. Let’s explore them in the following section.

Common Terminologies Used in Linear Programming Problem

Understanding terminologies used in linear programming problems, such as decision variables, the objective function, and constraints, will ensure you solve the problem effectively.

Here are the variables used to solve problems in linear programming.

1. Decision Variables
Decision variables are the variables that represent the choices or quantities that can be controlled and adjusted in order to achieve the desired objective. For example, in a production scenario, decision variables might represent the number of units of different products to produce.

Example: Let x1 represent the number of units of Product A to produce, and x2represent the number of units of Product B.

2. Objective Function
The objective function describes the goal of the optimization. The objective could represent profit, cost, time, or any other measurable factor. The objective function maximizes profits, such as maximizing revenue from product sales based on decision variables like price or quantity.

Example: A typical objective function might look like:

\[MaxZ = 5x_1 + 3x_2\]

Here, Z could represent profit, and the goal is to maximize profit by adjusting the number of units x1 and x2​ produced.

3. Constraints
Constraints are the limitations or restrictions representing available resources, time, budget, or capacity. In mathematical terms, constraints are usually expressed as inequalities or equations involving decision variables. 

For instance, a factory may have constraints on the amount of raw materials or labor hours available for production.

Example: A constraint could be:

\[5x_1 + 3x_2 < 100\]

This constraint could represent a limitation on resources (e.g., material availability), indicating that the combined use of resources for both products must not exceed 100 units.

4. Non-Negativity Restrictions
The values of decision variables in linear programming problems cannot be less than zero because negative quantities of products, resources, or time are not feasible in real-world scenarios. 

For instance, a transport company allocating a number of trucks to deliver goods cannot give a negative number of trucks.

Example:

\[x_1 \geq 0,x_2 \geq 0\]

These restrictions ensure that the decision variables give feasible and realistic solutions (e.g., you can’t produce a negative number of units).

5. Additional Characteristics

  • Finiteness: A solution is considered feasible if it satisfies all constraints, including non-negativity, and lies within the feasible region. For instance, a food delivery service can minimize delivery time by ensuring that all routes respect time limits and capacity constraints.
  • Linearity: The objective function and the constraints can only involve linear terms of the decision variables, and there are no exponents or products of decision variables. For instance, the number of units produced in a factory will directly contribute to an increase in profits.

Example:

The objective function and constraints are linear if they involve only terms such as

\[5x_1 + 3x_2\]

but not terms like

\[x_1^2,orx_1x_2\]

Also Read: What is Linear Programming in Data Science: Overview

upGrad’s Exclusive Data Science Webinar for you –

ODE Thought Leadership Presentation

 

Now that you’ve seen the common terminologies involved in solving a linear programming problem, let’s explore the different methods involved in solving these problems.

Linear Programming Methods: An Overview

The simplex method and graphical method are the two most common methods used for solving linear programming problems. Each method has its own approach and application, depending on the complexity and the number of variables in the problem.

Here’s how problems in linear programming are solved using these two methods.

Simplex Method:

This method is used when there are multiple decision variables and constraints. It traverses from one feasible solution to another, always improving the objective function until it reaches the optimal solution.

For instance, an NGO might use the Simplex Method to optimize the distribution of its limited funds across various community programs.

To understand the steps in detail, consider the following example.

\[MaxZ = 3x_1 + 2x_2\] \[Where , 2x_1 + x_2 \leq 10\] \[x_1 + 2x_2 \leq 8\] \[x_1\geq0,x_2\geq0\]

Steps Involved:

1. Creating the Simplex Table:

Convert the inequalities into equalities by introducing slack variables. The constraints become:

2 x 1 + x 2 + s 1 = 10 x 1 + 2 x 2 + s 2 = 8

where s1 and s2 are the slack variables.

Basic Variable x x2 s1 s2 RHS
s1 2 1 1 0 10
s1 1 2 0 1 8
Z -3 -2 0 0 0

Here, -3 and -2 are negative of the original coefficients of the objective function.

2. Pivot Element Calculation:

To start the iteration, identify the pivot column, which is the column with the most negative value in the objective row (for maximization problems). In this case, x1x_1x1​ has the most negative coefficient (-3), so it enters the basis.

Now, calculate the ratios for each row to determine the pivot row:

  • Row 1: 10/2 = 5
  • Row 2: 8/1 = 8

The smallest ratio is 5, which corresponds to Row 1. Thus, x1 will replace s1in the basis.

3. Iterative Optimization Process:

Perform row operations to make the pivot element equal to 1 and adjust the rest of the table accordingly.

Basic Variable x x2 s1 s2 RHS
s1 1 0.5 0.5 0 5
s1 0 1.5 -0.5 1 3
Z 0 -0.5 1.5 0 15

Repeat the process until there are no negative values left in the objective row, which indicates that the optimal solution has been reached.

After the next iteration, the Simplex method gives the optimal solution:

x1= 5 and x20, and the maximum value of Z = 15.

Graphical Method:

The Graphical Method is a visual approach to solving linear programming problems, useful when the problem has only two decision variables. It plots the constraints and identifies the feasible region, then finds the optimal solution at one of the corner points.

For instance, a marketing company might use the Graphical Method to optimize ad budgets based on constraints.

Here’s an example to understand the workings of the graphical method.

Example:

\[MaximizeZ = 4x_1 + 3x_2\\\] \[Where,\\x_1 + x_2\leq6\\2\] \[x_1+x_2\leq8\\\] \[x_1\geq0\\and\\x_1\geq0\]

Steps Involved:

1. Graphical Representation:

Plot the constraint lines on a graph by converting inequalities into equalities:

\[x_1+x_2=6 \] and \[2x_1+x_2=8\]

These lines will intersect the axes, and the feasible region is the overlapping area that satisfies all constraints.

2. Finding Feasible Regions and Corner Points:

Identify the feasible region that satisfies all the constraints. It is formed by the intersection of the constraint lines and the axes.

The corner points (vertices) of the feasible region are the key points where the optimal solution could lie.

When you plot this on the graph, you get the following corner points: (0,6), (2,4), (4, 0).

3. Calculating Maxima/Minima for the Objective Function:

Calculate the value of the objective function at each corner point:

  • At (0,6), Z = 4(0)+3(6) = 18
  • At (2,4), Z = 4(2)+3(4) = 14
  • At (4,0), Z = 4(4)+3(0) = 16

The maximum value of Z occurs at the corner point (0,6) with Z = 18.

Also Read: Linear Programming Projects Ideas & Topics For Beginners 2025

Now that you’ve seen how to solve a linear programming problem using simplex and graphical methods, let’s explore the formulas and techniques involved in solving such problems.

Essential Formulas and Components To Solve Linear Programming Problems

Knowledge of formulas and techniques is essential for solving real-world linear programming problems in fields such as operations research, economics, and logistics. 

Here are the main components involved in solving problems in linear programming.

1. General Formula

The general formula of linear programming can be represented as:

Maximize (or Minimize)

Z = c 1 x 1 + c 2 x 2 + . . . . + c n x n

Where:

  • Z is the objective function value (profit, cost, etc.).
  • c 1 , c 2 , c 3 , c 4 , . . . , c n are the coefficients that represent the contribution of each decision variable to the objective function.
  • x1,x2,. . .xn​ are the decision variables

2. Objective Function

This is the equation that represents the goal of the optimization problem, whether it's maximizing profit or minimizing cost. It is represented using the following formula:

Z=ax+by

Where,  

a and b and coefficients

x and y are decision variables

3. Constraints

Constraints limit the values the decision variables can take. These are linear equations or inequalities that represent limitations like resource availability, budget, or time. They can be represented in the form of:

\[cx + dy\geq e or px + qy\leq r\]

4. Non-Negativity Restrictions

Since decision variables in real-world problems (like quantities) can't be negative, LP problems have non-negativity constraints. This ensures that the variables are greater than or equal to zero.

\[x\geq 0 , y\geq0\]

5. Decision Variables

The variables represent the unknown quantities that need to be optimized. The coefficients in the objective function and constraints reflect the relationships between the variables and the quantities being optimized or restricted.

In this objective function

Z = a x + b y ,

x and y are decision variables
Now that you’ve identified all the components that influence the outcome of linear programming problems, let’s take a detailed look at the steps involved in solving these problems.

Step-by-Step Guide to Solving Linear Programming Problems

Solving a linear programming problem (LPP) involves defining the variables, constraints, and objective functions. These steps will help you systematically optimize an objective function subject to certain constraints.

Here are the steps to solve linear programming problems.

1. Identify decision variables

The decision variables represent real-world quantities like the number of units of a product or time to be invested in a task. 

By clearly defining the decision variables, you can represent the quantities that you need to determine in order to achieve the objective.

2. Define the objective function

The objective function reflects the goal of the problem, such as maximizing profit or minimizing cost. Represent the objective function in terms of the decision variables. For example, in a maximization problem, it could be in the form of  Z=ax+by.

Here, Z is the total profit or cost, and a and b are coefficients representing the profit or cost contribution. 

3. Specify constraints

Constraints are limitations or restrictions on the decision variables, representing limitations on available resources, budget, time, etc. You will have to formulate each constraint as a linear inequality or equation involving the decision variables.

For example, a constraint could be in the form of:

\[cx + dy \geq e\]

The left-hand side represents the relationship between the variables, and the right-hand side represents the available resource or limit.

4. Ensure non-negativity restrictions are applied

Non-negativity restrictions prevent decision variables from taking negative values, as negative quantities might not make sense in many real-world scenarios (like the number of items produced).

Negative restrictions are expressed as  x>=0    y>=0 to ensure decision variables are non-negative.

5. Solve the Problem

Once you’ve defined the decision variables, objective function, and constraints, you can proceed to solve the problem using appropriate methods, such as graphical methods for simple two-variable problems or the Simplex method for larger, more complex problems.

After being introduced to the steps for solving linear programming problems, you can now apply these techniques to real-world examples and gain a better understanding of how to use them effectively.

Real-World Examples of Linear Programming Problems with Solutions

Linear programming can be applied to solve problems arising in industries like manufacturing, finance, logistics, and marketing, which require decision-making with limited resources.

Here are three real-world linear programming problems, followed by step-by-step solutions to solve them.

1. Example: A company manufactures two types of products: Product A and Product B. The company wants to maximize its profit, given the following information:

  • Each unit of Product A yields a profit of INR 5.
  • Each unit of Product B yields a profit of INR 8.
  • Product A requires 1 hour of labor to produce, while Product B requires 2 hours of labor.
  • The company has a total of 100 labor hours available.
  • The company is limited to producing 50 units of Product A and 40 units of Product B.

Develop a linear programming model to maximize the total profit and determine how many units of each product should be produced.

Solution: This problem focuses on the manufacturing industry, looking to maximize its profits. 

Objective Function in this problem:

= 5+ 8y

Constraints:

Productivity constraint: x + 2y ≤ 100

Product A constraint: x ≤ 50

Product B constraint: y ≤ 40

Non-negative constraints: x ≥ 0 and y ≥ 0

Step 1: Introduce slack variables

x+2y+s1=100

x+s2=50

y+s3=40

Step 2: Set up the table:

Basic Variable x y s1 s2 s3 RHS
s1 1 2 1 0 0 100
s2 1 0 0 1 0 50
s3 0 1 0 0 1 40
-Z -5 -8 0 0 0 0

Step 3: Perform the Simplex method

  • Identify the pivot column (most negative value in the last row, excluding the RHS).
  • Identify the pivot row by dividing the RHS values by the corresponding values in the pivot column (only positive values).
  • Perform pivoting to update the tableau.

To identify the pivot row, divide the RHS values by the respective coefficients in the y column:

  • Row 1: 100 ÷ 2 = 50
  • Row 2: 50 ÷ 0= ∞  (ignore)
  • Row 3: 40 ÷ 1 = 40

The smallest positive value is 40, so the pivot element is in the y-column and the s3 row.

Step 4: Perform pivoting and update the tableau

After pivoting, the updated table will look like this:

Basic Variable x y s1 s2 s3 RHS
s1 1   1 0 -2 60
x 0 1 0   1 50
y 1 0 0 1 0 40
-Z 0 0 0 0 8 320

Step 5: Check for optimality

Since there are no negative values in the bottom row (other than the RHS), the optimal solution has been found.

X = 50 and y = 40

Thus, maximum profit, = 5(50) + 8(40) = 590

2. Example: A nutritionist is trying to create a diet plan that satisfies the nutritional needs of a patient at the minimum cost. The patient requires at least 50 grams of protein and 40 grams of carbohydrates. The following food options are available:

  • Food X: Costs ₹10 per serving, provides 10 grams of protein and 5 grams of carbohydrates.
  • Food Y: Costs ₹12 per serving, provides 15 grams of protein and 10 grams of carbohydrates.

Determine a linear programming model to minimize the cost of the diet, while meeting the required nutritional values.

Solution: This type of problem is usually encountered in the health and wellness industries.

The objective function can be written as:

\[Z = 10x + 12y\\\] \[Protein constraint:10x + 15y\geq 50\\\] \[Carbohydrates Constraint:5x + 10y \geq 40\\\] \[Non - negativity Constraints:x \geq 0, y \geq 0\]

Step 1: Set up the Simplex method

Introduce slack variables and write the constraints:

\[10x + 15y - s_1 = 50\\\] \[5x + 10y - s_2 = 40\]

Step 2: Set up the Table

Basic Variable x y s1 s2 RHS
Z -10 -12 0 0 0
x 10 15 1 0 50
y 5 10 0 1 40

Step 3: Perform Pivoting

Look for the most negative value in the objective function row (Z row). In this case, -12 in column y. This means we will pivot around the y column. Divide the RHS values by the corresponding values in the y column to determine which row is the pivot row.

\[Row1:\frac{50}{15} = 3.33\\\] \[Row2:\frac{40}{10} = 4\]

Since the smallest ratio is 3.33 (Row 1), Row 1 is the pivot row.

After performing the row operations to eliminate values in the pivot column, you get the following table:

Basic Variable x y s1 s2 RHS
Z -2 0 0 0 120
x 5 0 1 -1 10
y 13 1 0 13 4

 

From the table, we get x = 10 and y = 4. Inserting this into the objective function, you get:

Z=10(10)+12(4)=148 

Thus, the minimum cost of the diet is INR 148.

3. Example: A company produces two products, A and B, using limited resources. The company wants to maximize its profit. The resources and profit data are as follows:

  • Product A:
    • Profit = ₹20 per unit
    • Requires 3 units of Resource 1 and 2 units of Resource 2 per unit
  • Product B:
    • Profit = ₹15 per unit
    • Requires 2 units of Resource 1 and 4 units of Resource 2 per unit

The company has a total of 18 units of Resource 1 and 16 units of Resource 2 available.

Solution: This problem is also an example of the manufacturing industry, looking to increase profits while keeping production limits in mind.

The objective function can be written as:

Z=20x+15y 

Constraints: 

\[Resource1:3x + 2y\leq18\\\] \[Resource2:2x + 4y\leq16\]

Non-negativity constraints: x ≥ 0 y ≥ 0

Step 1: Set up the Simplex method

Write constraints using the slack variables.

\[3x + 2y + s_1 = 18\\\] \[2x + 4y + s_2 = 16\]

Step 2: Set up the table

Basic Variable x y s1 s2 RHS
Z -20 -15 0 0 0
s1 3 2 1 0 18
s2 2 4 0 1 16

Step 4: Perform the Simplex Method

Look at the Z row. The most negative value is -20 in the x column, so the pivot column is x. Divide the values in the RHS column by the corresponding values in the x column (for positive values)

\[Row1:\frac{6}{\frac{2}{3}} = 9\\\] \[Row2:\frac{4}{\frac{8}{3}} = 1.5\]

The smallest ratio is 6, so Row 1 is the pivot row. The pivot element is 3 (in Row 1, Column x). Divide the Row 1 by 3 to make the pivot element 1. You get the following table.

Basic Variable x y s1 s2 RHS
Z 0 -5 0 0 120
x 1 23 13 0 6
s2 0 83 -23 1 4

The most negative value is -5 in the y column, so the pivot column is y. Divide the values in the RHS column by the corresponding values in the y column (for positive values only).

The smallest ratio is 1.5, so Row 2 is the pivot row. Perform row operations again to update the table.

Basic Variable x y s1 s2 RHS
Z 0 0 0 0 135
x 1 0 15 -13 7.5
y 0 1 -15 13 3

Since no further pivoting is possible, you obtain x = 7.5 and y = 3

To calculate the maximum profit, insert these values in the objective function:

Z=20(7.5)+15(3)=195

Thus, the company should produce 7.5 units of Product A and 3 units of Product B. The maximum profit the company can achieve is INR 195.

To master linear programming, applying what you've learned through practice is key. This will help you solidify your understanding of the topic by tackling a variety of problems Let’s check out some sample problems in the next section.

10 Practice Problems on Linear Programming (LPP)  for Skill Development

The following practice problems will cover important concepts like optimization of resources and production planning. By solving these problems, you will gain a deeper understanding of key concepts like decision variables, constraints, objective functions, and the Simplex Method.

Here are some linear programming problems for you to practice.

  1. A delivery company needs to determine the most cost-effective route to deliver goods to 5 different cities. Formulate a linear programming problem to minimize transportation costs.
  2. A company wants to allocate its production capacity between two products, A and B, to maximize total revenue, given limited raw materials and production time.
  3. A restaurant wants to decide how many meals of different types to prepare daily in order to maximize profit, given limited ingredients and labor.
  4. A company is deciding how many units of two products to produce, each requiring different raw materials and labor hours.
  5. A farmer wants to determine how much of two crops to plant on his land in order to maximize profit, given limitations on water and land space.
  6. A telecommunications company wants to determine how to allocate resources between different regions to maximize market coverage while staying within a budget.
  7. A company needs to decide how much to invest in advertising on TV and social media to maximize the number of responses within a budget constraint.
  8. A transportation company needs to decide how many vehicles to send to each destination to minimize transportation costs while meeting delivery requirements.
  9. A manufacturer wants to determine the most efficient use of raw materials to produce two types of products that require different combinations of materials.
  10. A construction company wants to allocate its workers to different tasks on a project in order to minimize labor costs while meeting project deadlines.

You may have encountered challenges while solving these problems, such as formulating the equations or finding solutions. In the next section, you can explore the common difficulties you may face and provide strategies to overcome them.

Challenges in Linear Programming and How to Overcome Them

Challenges like formulating the objective function, handling constraints, or applying the Simplex Method can sometimes impact progress. By understanding these challenges and learning practical tips to address them, you’ll be better equipped to solve LPPs effectively.

Here are some common challenges in linear programming problems and practical solutions to address them.

Challenge  Practical Solution
Formulating the objective function Start by clearly identifying the goal (maximize/minimize) and the variables involved. Use real-world examples to practice.
Handling constraints Break down each constraint into simpler terms. Use slack, surplus, or artificial variables to convert inequalities into equalities.
Infeasible solutions Re-check the constraints for errors or inconsistencies. Consider adjusting constraints or using techniques like dual simplex for better insights.
Non-negativity restrictions Ensure all decision variables and slack variables have non-negative constraints. Keep track of each variable’s role in the solution.
Choosing between Simplex and Graphical methods For 2-variable problems, use the graphical method. For more than 2 variables, the Simplex Method is more efficient. Familiarize yourself with both approaches.
Interpreting results Cross-check your results against the original problem context. Use sensitivity analysis to confirm the robustness of the solution.

Learn how advanced knowledge in data science can help you overcome challenges like handling constraints while implementing linear programming. Join Executive Diploma in Data Science & AI course now!

Linear programming is a powerful technique for solving practical problems, such as maximizing profits or minimizing costs. Its wide-ranging applications in industries like logistics management and manufacturing make it an essential tool. To deepen your understanding and expand your knowledge in this field, explore the following section.

How upGrad Can Help You Excel Linear Programming and Data Science

Applications of linear programming are spreading across emerging fields like machine learning and data analytics, helping them in optimal decision-making and resource allocation. 

To master this concept, upGrad’s courses will provide a comprehensive foundation. These courses will introduce you to the basics of LP while preparing you for advanced learning.

Here are some courses offered by upGrad to help you understand linear programming.

Do you need help deciding which courses can help you in linear programming? Contact upGrad for personalized counseling and valuable insights. For more details, you can also visit your nearest upGrad offline center.

Similar Read:

Unlock the power of data with our popular Data Science courses, designed to make you proficient in analytics, machine learning, and big data!

Elevate your career by learning essential Data Science skills such as statistical modeling, big data processing, predictive analytics, and SQL!

Stay informed and inspired  with our popular Data Science articles, offering expert insights, trends, and practical tips for aspiring data professionals!

Frequently Asked Questions (FAQs)

1. What is the principle of LP?

2. What are the applications of linear programming?

3. What are the limitations of LP?

4. What is the largest coefficient rule?

5. When to stop simplex?

6. Why is duality used in linear programming?

7. What is a degeneracy in linear programming?

8. What is the Big M method?

9. What is shadow pricing in linear programming?

10. What is the binding constraint in linear programming?

11. What is primal in linear programming?

Rohit Sharma

616 articles published

Get Free Consultation

+91

By submitting, I accept the T&C and
Privacy Policy

Start Your Career in Data Science Today

Suggested Blogs