- Blog Categories
- Software Development
- Data Science
- AI/ML
- Marketing
- General
- MBA
- Management
- Legal
- Software Development Projects and Ideas
- 12 Computer Science Project Ideas
- 28 Beginner Software Projects
- Top 10 Engineering Project Ideas
- Top 10 Easy Final Year Projects
- Top 10 Mini Projects for Engineers
- 25 Best Django Project Ideas
- Top 20 MERN Stack Project Ideas
- Top 12 Real Time Projects
- Top 6 Major CSE Projects
- 12 Robotics Projects for All Levels
- Java Programming Concepts
- Abstract Class in Java and Methods
- Constructor Overloading in Java
- StringBuffer vs StringBuilder
- Java Identifiers: Syntax & Examples
- Types of Variables in Java Explained
- Composition in Java: Examples
- Append in Java: Implementation
- Loose Coupling vs Tight Coupling
- Integrity Constraints in DBMS
- Different Types of Operators Explained
- Career and Interview Preparation in IT
- Top 14 IT Courses for Jobs
- Top 20 Highest Paying Languages
- 23 Top CS Interview Q&A
- Best IT Jobs without Coding
- Software Engineer Salary in India
- 44 Agile Methodology Interview Q&A
- 10 Software Engineering Challenges
- Top 15 Tech's Daily Life Impact
- 10 Best Backends for React
- Cloud Computing Reference Models
- Web Development and Security
- Find Installed NPM Version
- Install Specific NPM Package Version
- Make API Calls in Angular
- Install Bootstrap in Angular
- Use Axios in React: Guide
- StrictMode in React: Usage
- 75 Cyber Security Research Topics
- Top 7 Languages for Ethical Hacking
- Top 20 Docker Commands
- Advantages of OOP
- Data Science Projects and Applications
- 42 Python Project Ideas for Beginners
- 13 Data Science Project Ideas
- 13 Data Structure Project Ideas
- 12 Real-World Python Applications
- Python Banking Project
- Data Science Course Eligibility
- Association Rule Mining Overview
- Cluster Analysis in Data Mining
- Classification in Data Mining
- KDD Process in Data Mining
- Data Structures and Algorithms
- Binary Tree Types Explained
- Binary Search Algorithm
- Sorting in Data Structure
- Binary Tree in Data Structure
- Binary Tree vs Binary Search Tree
- Recursion in Data Structure
- Data Structure Search Methods: Explained
- Binary Tree Interview Q&A
- Linear vs Binary Search
- Priority Queue Overview
- Python Programming and Tools
- Top 30 Python Pattern Programs
- List vs Tuple
- Python Free Online Course
- Method Overriding in Python
- Top 21 Python Developer Skills
- Reverse a Number in Python
- Switch Case Functions in Python
- Info Retrieval System Overview
- Reverse a Number in Python
- Real-World Python Applications
- Data Science Careers and Comparisons
- Data Analyst Salary in India
- Data Scientist Salary in India
- Free Excel Certification Course
- Actuary Salary in India
- Data Analyst Interview Guide
- Pandas Interview Guide
- Tableau Filters Explained
- Data Mining Techniques Overview
- Data Analytics Lifecycle Phases
- Data Science Vs Analytics Comparison
- Artificial Intelligence and Machine Learning Projects
- Exciting IoT Project Ideas
- 16 Exciting AI Project Ideas
- 45+ Interesting ML Project Ideas
- Exciting Deep Learning Projects
- 12 Intriguing Linear Regression Projects
- 13 Neural Network Projects
- 5 Exciting Image Processing Projects
- Top 8 Thrilling AWS Projects
- 12 Engaging AI Projects in Python
- NLP Projects for Beginners
- Concepts and Algorithms in AIML
- Basic CNN Architecture Explained
- 6 Types of Regression Models
- Data Preprocessing Steps
- Bagging vs Boosting in ML
- Multinomial Naive Bayes Overview
- Bayesian Network Example
- Bayes Theorem Guide
- Top 10 Dimensionality Reduction Techniques
- Neural Network Step-by-Step Guide
- Technical Guides and Comparisons
- Make a Chatbot in Python
- Compute Square Roots in Python
- Permutation vs Combination
- Image Segmentation Techniques
- Generative AI vs Traditional AI
- AI vs Human Intelligence
- Random Forest vs Decision Tree
- Neural Network Overview
- Perceptron Learning Algorithm
- Selection Sort Algorithm
- Career and Practical Applications in AIML
- AI Salary in India Overview
- Biological Neural Network Basics
- Top 10 AI Challenges
- Production System in AI
- Top 8 Raspberry Pi Alternatives
- Top 8 Open Source Projects
- 14 Raspberry Pi Project Ideas
- 15 MATLAB Project Ideas
- Top 10 Python NLP Libraries
- Naive Bayes Explained
- Digital Marketing Projects and Strategies
- 10 Best Digital Marketing Projects
- 17 Fun Social Media Projects
- Top 6 SEO Project Ideas
- Digital Marketing Case Studies
- Coca-Cola Marketing Strategy
- Nestle Marketing Strategy Analysis
- Zomato Marketing Strategy
- Monetize Instagram Guide
- Become a Successful Instagram Influencer
- 8 Best Lead Generation Techniques
- Digital Marketing Careers and Salaries
- Digital Marketing Salary in India
- Top 10 Highest Paying Marketing Jobs
- Highest Paying Digital Marketing Jobs
- SEO Salary in India
- Content Writer Salary Guide
- Digital Marketing Executive Roles
- Career in Digital Marketing Guide
- Future of Digital Marketing
- MBA in Digital Marketing Overview
- Digital Marketing Techniques and Channels
- 9 Types of Digital Marketing Channels
- Top 10 Benefits of Marketing Branding
- 100 Best YouTube Channel Ideas
- YouTube Earnings in India
- 7 Reasons to Study Digital Marketing
- Top 10 Digital Marketing Objectives
- 10 Best Digital Marketing Blogs
- Top 5 Industries Using Digital Marketing
- Growth of Digital Marketing in India
- Top Career Options in Marketing
- Interview Preparation and Skills
- 73 Google Analytics Interview Q&A
- 56 Social Media Marketing Q&A
- 78 Google AdWords Interview Q&A
- Top 133 SEO Interview Q&A
- 27+ Digital Marketing Q&A
- Digital Marketing Free Course
- Top 9 Skills for PPC Analysts
- Movies with Successful Social Media Campaigns
- Marketing Communication Steps
- Top 10 Reasons to Be an Affiliate Marketer
- Career Options and Paths
- Top 25 Highest Paying Jobs India
- Top 25 Highest Paying Jobs World
- Top 10 Highest Paid Commerce Job
- Career Options After 12th Arts
- Top 7 Commerce Courses Without Maths
- Top 7 Career Options After PCB
- Best Career Options for Commerce
- Career Options After 12th CS
- Top 10 Career Options After 10th
- 8 Best Career Options After BA
- Projects and Academic Pursuits
- 17 Exciting Final Year Projects
- Top 12 Commerce Project Topics
- Top 13 BCA Project Ideas
- Career Options After 12th Science
- Top 15 CS Jobs in India
- 12 Best Career Options After M.Com
- 9 Best Career Options After B.Sc
- 7 Best Career Options After BCA
- 22 Best Career Options After MCA
- 16 Top Career Options After CE
- Courses and Certifications
- 10 Best Job-Oriented Courses
- Best Online Computer Courses
- Top 15 Trending Online Courses
- Top 19 High Salary Certificate Courses
- 21 Best Programming Courses for Jobs
- What is SGPA? Convert to CGPA
- GPA to Percentage Calculator
- Highest Salary Engineering Stream
- 15 Top Career Options After Engineering
- 6 Top Career Options After BBA
- Job Market and Interview Preparation
- Why Should You Be Hired: 5 Answers
- Top 10 Future Career Options
- Top 15 Highest Paid IT Jobs India
- 5 Common Guesstimate Interview Q&A
- Average CEO Salary: Top Paid CEOs
- Career Options in Political Science
- Top 15 Highest Paying Non-IT Jobs
- Cover Letter Examples for Jobs
- Top 5 Highest Paying Freelance Jobs
- Top 10 Highest Paying Companies India
- Career Options and Paths After MBA
- 20 Best Careers After B.Com
- Career Options After MBA Marketing
- Top 14 Careers After MBA In HR
- Top 10 Highest Paying HR Jobs India
- How to Become an Investment Banker
- Career Options After MBA - High Paying
- Scope of MBA in Operations Management
- Best MBA for Working Professionals India
- MBA After BA - Is It Right For You?
- Best Online MBA Courses India
- MBA Project Ideas and Topics
- 11 Exciting MBA HR Project Ideas
- Top 15 MBA Project Ideas
- 18 Exciting MBA Marketing Projects
- MBA Project Ideas: Consumer Behavior
- What is Brand Management?
- What is Holistic Marketing?
- What is Green Marketing?
- Intro to Organizational Behavior Model
- Tech Skills Every MBA Should Learn
- Most Demanding Short Term Courses MBA
- MBA Salary, Resume, and Skills
- MBA Salary in India
- HR Salary in India
- Investment Banker Salary India
- MBA Resume Samples
- Sample SOP for MBA
- Sample SOP for Internship
- 7 Ways MBA Helps Your Career
- Must-have Skills in Sales Career
- 8 Skills MBA Helps You Improve
- Top 20+ SAP FICO Interview Q&A
- MBA Specializations and Comparative Guides
- Why MBA After B.Tech? 5 Reasons
- How to Answer 'Why MBA After Engineering?'
- Why MBA in Finance
- MBA After BSc: 10 Reasons
- Which MBA Specialization to choose?
- Top 10 MBA Specializations
- MBA vs Masters: Which to Choose?
- Benefits of MBA After CA
- 5 Steps to Management Consultant
- 37 Must-Read HR Interview Q&A
- Fundamentals and Theories of Management
- What is Management? Objectives & Functions
- Nature and Scope of Management
- Decision Making in Management
- Management Process: Definition & Functions
- Importance of Management
- What are Motivation Theories?
- Tools of Financial Statement Analysis
- Negotiation Skills: Definition & Benefits
- Career Development in HRM
- Top 20 Must-Have HRM Policies
- Project and Supply Chain Management
- Top 20 Project Management Case Studies
- 10 Innovative Supply Chain Projects
- Latest Management Project Topics
- 10 Project Management Project Ideas
- 6 Types of Supply Chain Models
- Top 10 Advantages of SCM
- Top 10 Supply Chain Books
- What is Project Description?
- Top 10 Project Management Companies
- Best Project Management Courses Online
- Salaries and Career Paths in Management
- Project Manager Salary in India
- Average Product Manager Salary India
- Supply Chain Management Salary India
- Salary After BBA in India
- PGDM Salary in India
- Top 7 Career Options in Management
- CSPO Certification Cost
- Why Choose Product Management?
- Product Management in Pharma
- Product Design in Operations Management
- Industry-Specific Management and Case Studies
- Amazon Business Case Study
- Service Delivery Manager Job
- Product Management Examples
- Product Management in Automobiles
- Product Management in Banking
- Sample SOP for Business Management
- Video Game Design Components
- Top 5 Business Courses India
- Free Management Online Course
- SCM Interview Q&A
- Fundamentals and Types of Law
- Acceptance in Contract Law
- Offer in Contract Law
- 9 Types of Evidence
- Types of Law in India
- Introduction to Contract Law
- Negotiable Instrument Act
- Corporate Tax Basics
- Intellectual Property Law
- Workmen Compensation Explained
- Lawyer vs Advocate Difference
- Law Education and Courses
- LLM Subjects & Syllabus
- Corporate Law Subjects
- LLM Course Duration
- Top 10 Online LLM Courses
- Online LLM Degree
- Step-by-Step Guide to Studying Law
- Top 5 Law Books to Read
- Why Legal Studies?
- Pursuing a Career in Law
- How to Become Lawyer in India
- Career Options and Salaries in Law
- Career Options in Law India
- Corporate Lawyer Salary India
- How To Become a Corporate Lawyer
- Career in Law: Starting, Salary
- Career Opportunities: Corporate Law
- Business Lawyer: Role & Salary Info
- Average Lawyer Salary India
- Top Career Options for Lawyers
- Types of Lawyers in India
- Steps to Become SC Lawyer in India
- Tutorials
- Software Tutorials
- C Tutorials
- Recursion in C: Fibonacci Series
- Checking String Palindromes in C
- Prime Number Program in C
- Implementing Square Root in C
- Matrix Multiplication in C
- Understanding Double Data Type
- Factorial of a Number in C
- Structure of a C Program
- Building a Calculator Program in C
- Compiling C Programs on Linux
- Java Tutorials
- Handling String Input in Java
- Determining Even and Odd Numbers
- Prime Number Checker
- Sorting a String
- User-Defined Exceptions
- Understanding the Thread Life Cycle
- Swapping Two Numbers
- Using Final Classes
- Area of a Triangle
- Skills
- Explore Skills
- Management Skills
- Software Engineering
- JavaScript
- Data Structure
- React.js
- Core Java
- Node.js
- Blockchain
- SQL
- Full stack development
- Devops
- NFT
- BigData
- Cyber Security
- Cloud Computing
- Database Design with MySQL
- Cryptocurrency
- Python
- Digital Marketings
- Advertising
- Influencer Marketing
- Performance Marketing
- Search Engine Marketing
- Email Marketing
- Content Marketing
- Social Media Marketing
- Display Advertising
- Marketing Analytics
- Web Analytics
- Affiliate Marketing
- MBA
- MBA in Finance
- MBA in HR
- MBA in Marketing
- MBA in Business Analytics
- MBA in Operations Management
- MBA in International Business
- MBA in Information Technology
- MBA in Healthcare Management
- MBA In General Management
- MBA in Agriculture
- MBA in Supply Chain Management
- MBA in Entrepreneurship
- MBA in Project Management
- Management Program
- Consumer Behaviour
- Supply Chain Management
- Financial Analytics
- Introduction to Fintech
- Introduction to HR Analytics
- Fundamentals of Communication
- Art of Effective Communication
- Introduction to Research Methodology
- Mastering Sales Technique
- Business Communication
- Fundamentals of Journalism
- Economics Masterclass
- Free Courses
- 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
Updated on Feb 03, 2025 | 19 min read
Share:
Table of Contents
- Understanding Linear Programming Problems (LPP): Importance and Key Terminologies
- Essential Formulas and Components To Solve Linear Programming Problems
- Step-by-Step Guide to Solving Linear Programming Problems
- Real-World Examples of Linear Programming Problems with Solutions
- 10 Practice Problems on Linear Programming (LPP) for Skill Development
- Challenges in Linear Programming and How to Overcome Them
- How upGrad Can Help You Excel Linear Programming and Data Science
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.
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:
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:
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:
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
but not terms like
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.
Steps Involved:
1. Creating the Simplex Table:
Convert the inequalities into equalities by introducing slack variables. The constraints become:
where s1 and s2 are the slack variables.
Basic Variable | x1 | 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 s1 in 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 | x1 | 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 x2= 0, 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:
Steps Involved:
1. Graphical Representation:
Plot the constraint lines on a graph by converting inequalities into equalities:
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)
Where:
- Z is the objective function value (profit, cost, etc.).
- 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:
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.
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
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:
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:
Z = 5x + 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, Z = 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:
Step 1: Set up the Simplex method
Introduce slack variables and write the constraints:
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.
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:
Non-negativity constraints: x ≥ 0 y ≥ 0
Step 1: Set up the Simplex method
Write constraints using the slack variables.
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)
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.
- 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.
- 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.
- A restaurant wants to decide how many meals of different types to prepare daily in order to maximize profit, given limited ingredients and labor.
- A company is deciding how many units of two products to produce, each requiring different raw materials and labor hours.
- 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.
- A telecommunications company wants to determine how to allocate resources between different regions to maximize market coverage while staying within a budget.
- 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.
- A transportation company needs to decide how many vehicles to send to each destination to minimize transportation costs while meeting delivery requirements.
- A manufacturer wants to determine the most efficient use of raw materials to produce two types of products that require different combinations of materials.
- 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.
- Unsupervised Learning: Clustering
- Executive Diploma in Machine Learning and AI
- Post Graduate Certificate in Machine Learning & NLP (Executive)
- Fundamentals of Deep Learning and Neural Networks
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!
Explore our Popular Data Science Courses
Elevate your career by learning essential Data Science skills such as statistical modeling, big data processing, predictive analytics, and SQL!
Top Data Science Skills to Learn
Stay informed and inspired with our popular Data Science articles, offering expert insights, trends, and practical tips for aspiring data professionals!
Read our popular Data Science Articles
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?
Get Free Consultation
By submitting, I accept the T&C and
Privacy Policy
Start Your Career in Data Science Today
Top Resources