SlideShare a Scribd company logo
1 of 32
Linear Programming
 Many problems take the form of maximizing or minimizing an objective, given limited
resources and competing constraints.
 If we can specify the objective as a linear function of certain variables, and if we can specify
the constraints on resources as equalities or inequalities on those variables, then we have a
linear- programming problem.
 Linear programs arise in a variety of practical applications.
Linear Programming
General Linear Programs
 In the general linear-programming problem, we wish to optimize a linear function subject to a
set of linear inequalities. Given a set of real numbers a1, a2, …an and a set of variables x1,
x2,… xn, we define a linear function f on those variables by
 If b is a real number and f is a linear function, then the equation
is a linear equality
and
and are linear inequalities.
 We use the general term linear constraints to denote either linear equalities or linear
inequalities.
Linear Programming
 a linear-programming problem is the problem of either minimizing or maximizing a linear
function subject to a finite set of linear constraints.
 If we are to minimize, then we call the linear program a minimization linear program, and if
we are to maximize, then we call the linear program a maximization linear program.
Standard and Slack
 A linear program in standard form is the maximization of a linear function subject to linear
inequalities.
 A linear program in slack form is the minimization of a linear function subject to linear equalities.
Standard form
 In standard form, we are given n real numbers c1, c2, … cn and m real numbers b1, b2, …bm and mn
real numbers aij for i = 1, 2,…m and j = 1, 2, … n. We wish to find n real numbers x1, x2, …xn that
 Generalizing the terminology, introduced two-variable linear program, we call expression (29.16) the
objective function and the n + m inequalities in lines (29.17) and (29.18) the constraints. The n
constraints in line (29.18) are the non-negativity constraints.
Standard and slack
 some of this terminology in the earlier example of a two-variable linear program.
 We call a setting of the variables x that satisfies all the constraints a feasible solution, whereas
a setting of the variables x that fails to satisfy at least one constraint is an infeasible solution.
 A feasible solution x whose objective value is maximum over all feasible solutions is an
optimal solution.
 If a linear program has no feasible solutions, we say that the linear program is infeasible;
otherwise it is feasible
Standard and slack
Converting linear programs into standard form
It is always possible to convert a linear program, given as minimizing or maximizing a linear
function subject to linear constraints, into standard form.
A linear program might not be in standard form for any of four possible reasons:
1. The objective function might be a minimization rather than a maximization.
2. There might be variables without nonnegativity constraints.
3. There might be equality constraints, which have an equal sign rather than a less-than-
or-equal-to sign.
4. There might be inequality constraints, but instead of having a less-than-or-equal-to
sign, they have a greater-than-or-equal-to sign.
Standard and slack
Converting linear programs into standard form
 To convert a minimization linear program L into an equivalent maximization linear program
L1, we simply negate the coefficients in the objective function. Since L and L0 have identical
sets of feasible solutions and, for any feasible solution, the objective value in L is the negative
of the objective value in L0, these two linear programs are equivalent.
 For example, if we have the linear program
and we negate the coefficients of the objective function, we obtain
Standard and slack
Converting linear programs into standard form
 Next, we show how to convert a linear program in which some of the variables do not have
nonnegativity constraints into one in which each variable has a non-negativity constraint.
 Suppose that some variable xj does not have a nonnegativity constraint. Then, Replace each
occurrence of x with x'-x‘’ and add the non-negativity constraints x'≥0 and x'' ≥0. and if
constraint i has a term aij , we replace it by aij j aij .
Standard and slack
Converting linear programs into standard form
 Next, we convert equality constraints into inequality constraints. Suppose that a linear
program has an equality constraint f(x1,x2, …xn) = b. Since x = y if and only if both x >= y and x
<= y, we can replace this equality constraint by the pair of inequality constraints f(x1,x2, …xn)
<= b and f(x1,x2, …xn) >= b. Repeating this conversion for each equality constraint yields a
linear program in which all constraints are inequalities.
Replace equality
constraints by pair
of inequality
constraints
Standard and slack
 Finally, we can convert the greater-than-or-equal-to constraints to less-than-or- equal-to
constraints by multiplying these constraints through by -1. Finishing our example, we replace
the equality in constraint (29.22) by two inequalities, obtaining
Convert >= to <=
by multiplying
these constraints
by -1
For consistency in
variable names, we
rename x’2 to x2 and x’’2
to x3, obtaining the
standard form
Standard and slack
Converting linear programs into slack form
 A linear program in slack form is the maximization of a linear function subject to linear
equalities.
 To efficiently solve a linear program with the simplex algorithm, we prefer to express it in a
form in which some of the constraints are equality constraints.
 Let be an inequality constraint. We introduce a new variable s and rewrite
inequality as the two constraints.
 We call s a slack variable because it measures the slack, or difference between the left-hand
and right-hand sides of equation.
 Because inequality is true if and only if both equation and inequality are true
Standard and slack
Converting Standard into Slack form
 When converting from standard to Slack form, we shall use Xn+1 (instead of s) to denote the
slack variable associated with the ith inequality. The ith constraint is therefore
=
Standard and slack
Converting linear programs into slack form
 Furthermore, each equation has the same set of variables on the right-hand side, and these
variables are also the only ones that appear in the objective function. We call the variables on
the left-hand side of the equalities basic variables and those on the right-hand side nonbasic
variables.
 For linear programs that satisfy these conditions, we shall sometimes omit the words
“maximize” and “subject to” as well as the explicit nonnegativity constraints.
 We shall also use the variable z to denote the value of the objective function. We call the
resulting format slack form. If we write the linear program given in in slack form, we obtain
Standard and slack
Converting linear programs into slack form
Standard and slack
Converting linear programs into slack form
 We use N to denote the set of indices of the nonbasic variables and B to denote the set of
indices of the basic variables.
 we also use v to denote an optional constant term in the objective function.
 As in standard form, we use bi , cj , and aij to denote constant terms and coefficients.
 Thus, we can concisely define a slack form by a tuple (N, B,A, b, c) denoting the slack form
 For example, in the slack form
Standard and slack
Converting linear programs into slack form
As an example of the entries of A being the negatives of the coefficients as they appear in the
slack form, observe that the equation for x1 includes the term 3/6, yet the coefficient a13 is
actually -1/6 rather than +1/6.
Simplex Method (Algebraic View)
Basic Steps
1. Write the given linear program into the slack form.
2. Find the initial basic solution by setting all non-basic variables to 0 and compute all basic
variables.
3. Iterate from one slack form to another by making a basic variable as nonbasic and a
nonbasic variable as basic in such a way that:
• Objective value of the function does not decrease.
 Select a nonbasic variable xehaving positive coefficient in objective function.
 Increase value of xe as much as possible without violating any of constraints, and
identify tightest constraint. Find basic variable xl corresponding to the tightest
constraint.
 Swap the role of xl and xe.
• Underlying LP problem does not change
Simplex Method (Algebraic View) Example
Consider a Linear program given in standard
form Maximize
Subject
to:
3x1+x2+2x3
x1+x2+3x3 ≤ 30
2x1+2x2+5x3 ≤ 24
4x1+x2+2x3 ≤ 36
x1, x2, x3≥0
□ Step 1: Change to slack form:
z= 3x1+x2+2x3
x4=30- x1-x2-3x3
x5=24- 2x1-2x2-
5x3 x6=36- 4x1-
x2-2x3
x1, x2, x3, x4, x5, x6 ≥0
□ Step 2: Initial Basic solution:
(x1,x2,x3,x4,x5,x6) =(0,0,0,30,24,36).
– The result is z = 3⋅0 + 0 + 2⋅0 = 0. Not
maximum.
Recall: To get basic
sol., set each non-
basic variable to 0.
* 3
7
Simplex Method (Algebraic View)
•Our goal, in each iteration, is to reformulate the linear program so that the basic
solution has a greater objective value.
•We select a non-basic variable xe whose coefficient in the objective function is positive,
and we increase the value of xe as much as possible without violating any of the
constraints.
z= 3x1+x2+2x3
•The variable xe becomes basic, and some other variable xl becomes nonbasic. The
values of other basic variables and of the objective function may also change.
* 3
8
Simplex Method (Algebraic View)
•As we increase x1, the values of x4, x5, and x6 all decrease. Because we have a nonnegativity
constraint for each variable, we cannot allow any of them to become negative.
• If x1 increases above 30, then x4 becomes negative, and x5 and x6 become negative when x1
increases above 12 and 9, respectively.
• The third constraint is the tightest constraint, and it limits how much we can increase x1. Therefore, we
switch the roles of x1 and x6.
x4=30- x1-x2-3x3
x5=24- 2x1-2x2-5x3
x6=36- 4x1-x2-2x3
x1, x2, x3, x4, x5, x6 ≥0
•Solving x6 =36 - 4 x1 - x2 -2 x3 for x1 we get
Simplex Method (Algebraic View)
□ Step 3: Iteration (Recall)
1. Select a nonbasic variable xe having positive coefficient in objective function
2. Increase value of xe as much as possible without violating any of constraints, and identify tightest
constraint. Find basic variable x l corresponding to the tightest constraint.
3. Swap the role of xl and xe .
 In objective function 3x1+x2+2x3, each variable x1, x2, x3 has positive
value. Let us try to increase the value of x1.
 x4=30- x1-x2-3x3
 x5=24- 2x1-2x2-5x3
 x6=36- 4x1-x2-2x3
So only 9 corresponding to x6 will be OK .
Therefore, it acts as xl
 Change x1to basic variable and change the equations accordingly.
entering
variable
Basic Solution (0,0,0,30,24,36)
leaving variable
x4 = 30 - x1 - x2 - 3.x3
= 30 - (9 - x2/4 - x3/2 - x6/4) - x2-
3.x3
= 30 - 9 + x2/4 + x3/2 + x6/4 - x2-
3.x3
= 21 - 3.x2/4 + 5.x3/2 + x6/4
entering
variable
Pivoting
new objective value
Basic Solution
(0,0,0,30,24,36) leaving variable
We call this operation a pivot. As
demonstrated , a pivot chooses a
nonbasic variable xe (here x1), called
the entering variable, and a basic
variable xl (here x6) , called the
leaving variable, and exchanges their
roles.
Basic Solution (9,0,0,21,6,0)
entering
variable
Pivotin
g
new objective value
Basic Solution
(0,0,0,30,24,36) leaving variable
Basic Solution
(9,0,0,21,6,0)
Continuing, we wish to find a new variable whose
value we wish to increase. We do not want to
increase x6, since as its value increases, the
objective value decreases. (pick a positive
variable) We can attempt to increase either x2 or
x3; let us choose x3.
How far can we increase x3 without
violating any of the constraints?
entering
variable
Pivotin
g
new objective value
Basic Solution
(0,0,0,30,24,36) leaving variable
Basic Solution
(9,0,0,21,6,0)
How far can we increase x3
without violating any of the
constraints?
Constraint 1 limits x3 to 18, constraint 2
limits it to 42/5 and constraint 3 limits it
x3 to 3/2.
The third constraint is again the
tightest one, and therefore we
rewrite
the third constraint so that x3 is on
the left-hand side and x5 is on the
right-hand
side. We then substitute this new
equation,
x3 =3/2 – 3.x2/8 – x5/4 +x6/8 in all these
equations.
entering
variable
Pivoting
new objective value
Basic Solution
(9,0,0,21,6,0)
Pivotin
g
entering
variable
Basic Solution
(0,0,0,30,24,36) leaving variable
leaving variable
Entering
variable
Basic Solution (33/4,
0,3/2,69/4,0,0)
Pivotin
g
We then substitute this new equation, x3 D 3=2 3x2=8 x5=4 C x6=8, into equations
and obtain the new, but equivalent, system
Example
entering
variable
Pivoting
new objective value
Basic Solution
(9,0,0,21,6,0)
Pivotin
g
entering
variable
Basic Solution
(0,0,0,30,24,36) leaving variable
leaving variable
Entering
variable
Basic Solution (33/4,
0,3/2,69/4,0,0)
Pivotin
g
Basic Solution (8, 4,0,18,
0,0)
4
6
• At this point, all coefficients in the objective function are
negative.
• This situation occurs only when we have rewritten the linear program
so that the basic solution is an optimal solution.
• Thus, for this problem, the solution (8, 4, 0, 18, 0, 0), with objective
value 28, is optimal.
• The only variables in the original linear program are x1, x2, and x3, and
so our solution is x1 = 8, x2 = 4, and x3 = 0, with objective value
z= 3x1+x2+x3 = (3 * 8)+(1*4)+(2*0) = 28
• Note that the values of the slack variables in the final solution
measure how much slack remains in each inequality.
1 2 3
• Slack variable x4 is 18, and in inequality x +x +3x ≤ 30, the left-
hand side,
with value 8+4+0 = 12, is 18 less than the right-hand side
of 30.
• Slack variables x5 and x6 are 0 and indeed, in inequalities 2x +2x +5x
≤ 24 and
1 2 3
* 4x1+x2+2x3 ≤ 36, the left-hand and right-hand sides are equal.
Recall: Slack
form
• A slack form can also be represented as a
tuple
(N, B, A, b, c, v) denoting the slack form:
Where :
all variables x are non-negatives
N, B denotes the set of non-basic and basic variables
resp. and A is a matrix having elements aij .
Recall: Slack form (cont…)
As an example, in the slack form
given as:
Applications of linear programming
Linear programming has a large number of applications. Any textbook on opera-tions research is
filled with examples of linear programming, and linear program-ming has become a standard tool
taught to students in most business schools. Theelection scenario is one typical example. Two
more examples of linear program-ming are the following:
An airline wishes to schedule its flight crews. The Federal Aviation Adminis-tration imposes
many constraints, such as limiting the number of consecutivehours that each crew member can
work and insisting that a particular crew workonly on one model of aircraft during each month.
The airline wants to schedulecrews on all of its flights using as few crew members as possible.
An oil company wants to decide where to drill for oil. Siting a drill at a particu-lar location has an
associated cost and, based on geological surveys, an expectedpayoff of some number of barrels
of oil. The company has a limited budget forlocating new drills and wants to maximize the
amount of oil it expects to find,given this budget.

More Related Content

Similar to Unit-4-BSR-11-1-2024 (1)linear programming.pptx

A Systematic Approach To Probabilistic Pointer Analysis
A Systematic Approach To Probabilistic Pointer AnalysisA Systematic Approach To Probabilistic Pointer Analysis
A Systematic Approach To Probabilistic Pointer AnalysisMonica Franklin
 
Ch11_LPIntro.pdf
Ch11_LPIntro.pdfCh11_LPIntro.pdf
Ch11_LPIntro.pdfyebegashet
 
Theory of linear programming
Theory of linear programmingTheory of linear programming
Theory of linear programmingTarun Gehlot
 
Numerical analysis dual, primal, revised simplex
Numerical analysis  dual, primal, revised simplexNumerical analysis  dual, primal, revised simplex
Numerical analysis dual, primal, revised simplexSHAMJITH KM
 
Lasso and ridge regression
Lasso and ridge regressionLasso and ridge regression
Lasso and ridge regressionSreerajVA
 
Simplex method material for operation .pptx
Simplex method material for operation .pptxSimplex method material for operation .pptx
Simplex method material for operation .pptxbizuayehuadmasu1
 
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic NetsData Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic NetsDerek Kane
 
Econometria Jose Nieves
Econometria Jose NievesEconometria Jose Nieves
Econometria Jose Nievespaquitootd
 
nonlinear programming
nonlinear programmingnonlinear programming
nonlinear programmingAngelineOdaya
 
Machine learning
Machine learningMachine learning
Machine learningShreyas G S
 

Similar to Unit-4-BSR-11-1-2024 (1)linear programming.pptx (20)

A Systematic Approach To Probabilistic Pointer Analysis
A Systematic Approach To Probabilistic Pointer AnalysisA Systematic Approach To Probabilistic Pointer Analysis
A Systematic Approach To Probabilistic Pointer Analysis
 
n7-LP-simplex.ppt
n7-LP-simplex.pptn7-LP-simplex.ppt
n7-LP-simplex.ppt
 
Ch11_LPIntro.pdf
Ch11_LPIntro.pdfCh11_LPIntro.pdf
Ch11_LPIntro.pdf
 
R linear regression
R   linear regressionR   linear regression
R linear regression
 
201977 1-1-4-pb
201977 1-1-4-pb201977 1-1-4-pb
201977 1-1-4-pb
 
Theory of linear programming
Theory of linear programmingTheory of linear programming
Theory of linear programming
 
Numerical analysis dual, primal, revised simplex
Numerical analysis  dual, primal, revised simplexNumerical analysis  dual, primal, revised simplex
Numerical analysis dual, primal, revised simplex
 
Lasso and ridge regression
Lasso and ridge regressionLasso and ridge regression
Lasso and ridge regression
 
R - Multiple Regression
R - Multiple RegressionR - Multiple Regression
R - Multiple Regression
 
Simplex method material for operation .pptx
Simplex method material for operation .pptxSimplex method material for operation .pptx
Simplex method material for operation .pptx
 
Linear programing problem
Linear programing problemLinear programing problem
Linear programing problem
 
PRIMAL & DUAL PROBLEMS
PRIMAL & DUAL PROBLEMSPRIMAL & DUAL PROBLEMS
PRIMAL & DUAL PROBLEMS
 
Linear programing
Linear programingLinear programing
Linear programing
 
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic NetsData Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
 
Graphical method
Graphical methodGraphical method
Graphical method
 
working with python
working with pythonworking with python
working with python
 
Chapter 15
Chapter 15Chapter 15
Chapter 15
 
Econometria Jose Nieves
Econometria Jose NievesEconometria Jose Nieves
Econometria Jose Nieves
 
nonlinear programming
nonlinear programmingnonlinear programming
nonlinear programming
 
Machine learning
Machine learningMachine learning
Machine learning
 

More from IronMan665214

Unit-5 BSR-1-02-2024 advanced algorithms .pptx
Unit-5 BSR-1-02-2024 advanced algorithms .pptxUnit-5 BSR-1-02-2024 advanced algorithms .pptx
Unit-5 BSR-1-02-2024 advanced algorithms .pptxIronMan665214
 
Unit-5-BasicProcessing_Parallel-26-1-2023-5am.pptx
Unit-5-BasicProcessing_Parallel-26-1-2023-5am.pptxUnit-5-BasicProcessing_Parallel-26-1-2023-5am.pptx
Unit-5-BasicProcessing_Parallel-26-1-2023-5am.pptxIronMan665214
 
UHV_IntroductionClass-11-6-2023-7am.pptx
UHV_IntroductionClass-11-6-2023-7am.pptxUHV_IntroductionClass-11-6-2023-7am.pptx
UHV_IntroductionClass-11-6-2023-7am.pptxIronMan665214
 
Unit-2-Stack_basic_Input_Output-4-12-2022-8am.ppt
Unit-2-Stack_basic_Input_Output-4-12-2022-8am.pptUnit-2-Stack_basic_Input_Output-4-12-2022-8am.ppt
Unit-2-Stack_basic_Input_Output-4-12-2022-8am.pptIronMan665214
 
2_Effects of Human activities.pptx
2_Effects of Human activities.pptx2_Effects of Human activities.pptx
2_Effects of Human activities.pptxIronMan665214
 
Unit1_Basic_Structure_of_Computer-7-11-2022-11am.ppt.pdf
Unit1_Basic_Structure_of_Computer-7-11-2022-11am.ppt.pdfUnit1_Basic_Structure_of_Computer-7-11-2022-11am.ppt.pdf
Unit1_Basic_Structure_of_Computer-7-11-2022-11am.ppt.pdfIronMan665214
 

More from IronMan665214 (7)

Unit-5 BSR-1-02-2024 advanced algorithms .pptx
Unit-5 BSR-1-02-2024 advanced algorithms .pptxUnit-5 BSR-1-02-2024 advanced algorithms .pptx
Unit-5 BSR-1-02-2024 advanced algorithms .pptx
 
Dev AAT.pptx
Dev AAT.pptxDev AAT.pptx
Dev AAT.pptx
 
Unit-5-BasicProcessing_Parallel-26-1-2023-5am.pptx
Unit-5-BasicProcessing_Parallel-26-1-2023-5am.pptxUnit-5-BasicProcessing_Parallel-26-1-2023-5am.pptx
Unit-5-BasicProcessing_Parallel-26-1-2023-5am.pptx
 
UHV_IntroductionClass-11-6-2023-7am.pptx
UHV_IntroductionClass-11-6-2023-7am.pptxUHV_IntroductionClass-11-6-2023-7am.pptx
UHV_IntroductionClass-11-6-2023-7am.pptx
 
Unit-2-Stack_basic_Input_Output-4-12-2022-8am.ppt
Unit-2-Stack_basic_Input_Output-4-12-2022-8am.pptUnit-2-Stack_basic_Input_Output-4-12-2022-8am.ppt
Unit-2-Stack_basic_Input_Output-4-12-2022-8am.ppt
 
2_Effects of Human activities.pptx
2_Effects of Human activities.pptx2_Effects of Human activities.pptx
2_Effects of Human activities.pptx
 
Unit1_Basic_Structure_of_Computer-7-11-2022-11am.ppt.pdf
Unit1_Basic_Structure_of_Computer-7-11-2022-11am.ppt.pdfUnit1_Basic_Structure_of_Computer-7-11-2022-11am.ppt.pdf
Unit1_Basic_Structure_of_Computer-7-11-2022-11am.ppt.pdf
 

Recently uploaded

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 

Recently uploaded (20)

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 

Unit-4-BSR-11-1-2024 (1)linear programming.pptx

  • 1. Linear Programming  Many problems take the form of maximizing or minimizing an objective, given limited resources and competing constraints.  If we can specify the objective as a linear function of certain variables, and if we can specify the constraints on resources as equalities or inequalities on those variables, then we have a linear- programming problem.  Linear programs arise in a variety of practical applications.
  • 2. Linear Programming General Linear Programs  In the general linear-programming problem, we wish to optimize a linear function subject to a set of linear inequalities. Given a set of real numbers a1, a2, …an and a set of variables x1, x2,… xn, we define a linear function f on those variables by  If b is a real number and f is a linear function, then the equation is a linear equality and and are linear inequalities.  We use the general term linear constraints to denote either linear equalities or linear inequalities.
  • 3. Linear Programming  a linear-programming problem is the problem of either minimizing or maximizing a linear function subject to a finite set of linear constraints.  If we are to minimize, then we call the linear program a minimization linear program, and if we are to maximize, then we call the linear program a maximization linear program.
  • 4. Standard and Slack  A linear program in standard form is the maximization of a linear function subject to linear inequalities.  A linear program in slack form is the minimization of a linear function subject to linear equalities. Standard form  In standard form, we are given n real numbers c1, c2, … cn and m real numbers b1, b2, …bm and mn real numbers aij for i = 1, 2,…m and j = 1, 2, … n. We wish to find n real numbers x1, x2, …xn that  Generalizing the terminology, introduced two-variable linear program, we call expression (29.16) the objective function and the n + m inequalities in lines (29.17) and (29.18) the constraints. The n constraints in line (29.18) are the non-negativity constraints.
  • 5. Standard and slack  some of this terminology in the earlier example of a two-variable linear program.  We call a setting of the variables x that satisfies all the constraints a feasible solution, whereas a setting of the variables x that fails to satisfy at least one constraint is an infeasible solution.  A feasible solution x whose objective value is maximum over all feasible solutions is an optimal solution.  If a linear program has no feasible solutions, we say that the linear program is infeasible; otherwise it is feasible
  • 6. Standard and slack Converting linear programs into standard form It is always possible to convert a linear program, given as minimizing or maximizing a linear function subject to linear constraints, into standard form. A linear program might not be in standard form for any of four possible reasons: 1. The objective function might be a minimization rather than a maximization. 2. There might be variables without nonnegativity constraints. 3. There might be equality constraints, which have an equal sign rather than a less-than- or-equal-to sign. 4. There might be inequality constraints, but instead of having a less-than-or-equal-to sign, they have a greater-than-or-equal-to sign.
  • 7. Standard and slack Converting linear programs into standard form  To convert a minimization linear program L into an equivalent maximization linear program L1, we simply negate the coefficients in the objective function. Since L and L0 have identical sets of feasible solutions and, for any feasible solution, the objective value in L is the negative of the objective value in L0, these two linear programs are equivalent.  For example, if we have the linear program and we negate the coefficients of the objective function, we obtain
  • 8. Standard and slack Converting linear programs into standard form  Next, we show how to convert a linear program in which some of the variables do not have nonnegativity constraints into one in which each variable has a non-negativity constraint.  Suppose that some variable xj does not have a nonnegativity constraint. Then, Replace each occurrence of x with x'-x‘’ and add the non-negativity constraints x'≥0 and x'' ≥0. and if constraint i has a term aij , we replace it by aij j aij .
  • 9. Standard and slack Converting linear programs into standard form  Next, we convert equality constraints into inequality constraints. Suppose that a linear program has an equality constraint f(x1,x2, …xn) = b. Since x = y if and only if both x >= y and x <= y, we can replace this equality constraint by the pair of inequality constraints f(x1,x2, …xn) <= b and f(x1,x2, …xn) >= b. Repeating this conversion for each equality constraint yields a linear program in which all constraints are inequalities. Replace equality constraints by pair of inequality constraints
  • 10. Standard and slack  Finally, we can convert the greater-than-or-equal-to constraints to less-than-or- equal-to constraints by multiplying these constraints through by -1. Finishing our example, we replace the equality in constraint (29.22) by two inequalities, obtaining Convert >= to <= by multiplying these constraints by -1 For consistency in variable names, we rename x’2 to x2 and x’’2 to x3, obtaining the standard form
  • 11. Standard and slack Converting linear programs into slack form  A linear program in slack form is the maximization of a linear function subject to linear equalities.  To efficiently solve a linear program with the simplex algorithm, we prefer to express it in a form in which some of the constraints are equality constraints.  Let be an inequality constraint. We introduce a new variable s and rewrite inequality as the two constraints.  We call s a slack variable because it measures the slack, or difference between the left-hand and right-hand sides of equation.  Because inequality is true if and only if both equation and inequality are true
  • 12. Standard and slack Converting Standard into Slack form  When converting from standard to Slack form, we shall use Xn+1 (instead of s) to denote the slack variable associated with the ith inequality. The ith constraint is therefore =
  • 13. Standard and slack Converting linear programs into slack form  Furthermore, each equation has the same set of variables on the right-hand side, and these variables are also the only ones that appear in the objective function. We call the variables on the left-hand side of the equalities basic variables and those on the right-hand side nonbasic variables.  For linear programs that satisfy these conditions, we shall sometimes omit the words “maximize” and “subject to” as well as the explicit nonnegativity constraints.  We shall also use the variable z to denote the value of the objective function. We call the resulting format slack form. If we write the linear program given in in slack form, we obtain
  • 14. Standard and slack Converting linear programs into slack form
  • 15. Standard and slack Converting linear programs into slack form  We use N to denote the set of indices of the nonbasic variables and B to denote the set of indices of the basic variables.  we also use v to denote an optional constant term in the objective function.  As in standard form, we use bi , cj , and aij to denote constant terms and coefficients.  Thus, we can concisely define a slack form by a tuple (N, B,A, b, c) denoting the slack form  For example, in the slack form
  • 16. Standard and slack Converting linear programs into slack form As an example of the entries of A being the negatives of the coefficients as they appear in the slack form, observe that the equation for x1 includes the term 3/6, yet the coefficient a13 is actually -1/6 rather than +1/6.
  • 17. Simplex Method (Algebraic View) Basic Steps 1. Write the given linear program into the slack form. 2. Find the initial basic solution by setting all non-basic variables to 0 and compute all basic variables. 3. Iterate from one slack form to another by making a basic variable as nonbasic and a nonbasic variable as basic in such a way that: • Objective value of the function does not decrease.  Select a nonbasic variable xehaving positive coefficient in objective function.  Increase value of xe as much as possible without violating any of constraints, and identify tightest constraint. Find basic variable xl corresponding to the tightest constraint.  Swap the role of xl and xe. • Underlying LP problem does not change
  • 18. Simplex Method (Algebraic View) Example Consider a Linear program given in standard form Maximize Subject to: 3x1+x2+2x3 x1+x2+3x3 ≤ 30 2x1+2x2+5x3 ≤ 24 4x1+x2+2x3 ≤ 36 x1, x2, x3≥0 □ Step 1: Change to slack form: z= 3x1+x2+2x3 x4=30- x1-x2-3x3 x5=24- 2x1-2x2- 5x3 x6=36- 4x1- x2-2x3 x1, x2, x3, x4, x5, x6 ≥0 □ Step 2: Initial Basic solution: (x1,x2,x3,x4,x5,x6) =(0,0,0,30,24,36). – The result is z = 3⋅0 + 0 + 2⋅0 = 0. Not maximum. Recall: To get basic sol., set each non- basic variable to 0.
  • 19. * 3 7 Simplex Method (Algebraic View) •Our goal, in each iteration, is to reformulate the linear program so that the basic solution has a greater objective value. •We select a non-basic variable xe whose coefficient in the objective function is positive, and we increase the value of xe as much as possible without violating any of the constraints. z= 3x1+x2+2x3 •The variable xe becomes basic, and some other variable xl becomes nonbasic. The values of other basic variables and of the objective function may also change.
  • 20. * 3 8 Simplex Method (Algebraic View) •As we increase x1, the values of x4, x5, and x6 all decrease. Because we have a nonnegativity constraint for each variable, we cannot allow any of them to become negative. • If x1 increases above 30, then x4 becomes negative, and x5 and x6 become negative when x1 increases above 12 and 9, respectively. • The third constraint is the tightest constraint, and it limits how much we can increase x1. Therefore, we switch the roles of x1 and x6. x4=30- x1-x2-3x3 x5=24- 2x1-2x2-5x3 x6=36- 4x1-x2-2x3 x1, x2, x3, x4, x5, x6 ≥0 •Solving x6 =36 - 4 x1 - x2 -2 x3 for x1 we get
  • 21. Simplex Method (Algebraic View) □ Step 3: Iteration (Recall) 1. Select a nonbasic variable xe having positive coefficient in objective function 2. Increase value of xe as much as possible without violating any of constraints, and identify tightest constraint. Find basic variable x l corresponding to the tightest constraint. 3. Swap the role of xl and xe .  In objective function 3x1+x2+2x3, each variable x1, x2, x3 has positive value. Let us try to increase the value of x1.  x4=30- x1-x2-3x3  x5=24- 2x1-2x2-5x3  x6=36- 4x1-x2-2x3 So only 9 corresponding to x6 will be OK . Therefore, it acts as xl  Change x1to basic variable and change the equations accordingly.
  • 22. entering variable Basic Solution (0,0,0,30,24,36) leaving variable x4 = 30 - x1 - x2 - 3.x3 = 30 - (9 - x2/4 - x3/2 - x6/4) - x2- 3.x3 = 30 - 9 + x2/4 + x3/2 + x6/4 - x2- 3.x3 = 21 - 3.x2/4 + 5.x3/2 + x6/4
  • 23. entering variable Pivoting new objective value Basic Solution (0,0,0,30,24,36) leaving variable We call this operation a pivot. As demonstrated , a pivot chooses a nonbasic variable xe (here x1), called the entering variable, and a basic variable xl (here x6) , called the leaving variable, and exchanges their roles. Basic Solution (9,0,0,21,6,0)
  • 24. entering variable Pivotin g new objective value Basic Solution (0,0,0,30,24,36) leaving variable Basic Solution (9,0,0,21,6,0) Continuing, we wish to find a new variable whose value we wish to increase. We do not want to increase x6, since as its value increases, the objective value decreases. (pick a positive variable) We can attempt to increase either x2 or x3; let us choose x3. How far can we increase x3 without violating any of the constraints?
  • 25. entering variable Pivotin g new objective value Basic Solution (0,0,0,30,24,36) leaving variable Basic Solution (9,0,0,21,6,0) How far can we increase x3 without violating any of the constraints? Constraint 1 limits x3 to 18, constraint 2 limits it to 42/5 and constraint 3 limits it x3 to 3/2. The third constraint is again the tightest one, and therefore we rewrite the third constraint so that x3 is on the left-hand side and x5 is on the right-hand side. We then substitute this new equation, x3 =3/2 – 3.x2/8 – x5/4 +x6/8 in all these equations.
  • 26. entering variable Pivoting new objective value Basic Solution (9,0,0,21,6,0) Pivotin g entering variable Basic Solution (0,0,0,30,24,36) leaving variable leaving variable Entering variable Basic Solution (33/4, 0,3/2,69/4,0,0) Pivotin g We then substitute this new equation, x3 D 3=2 3x2=8 x5=4 C x6=8, into equations and obtain the new, but equivalent, system
  • 28. entering variable Pivoting new objective value Basic Solution (9,0,0,21,6,0) Pivotin g entering variable Basic Solution (0,0,0,30,24,36) leaving variable leaving variable Entering variable Basic Solution (33/4, 0,3/2,69/4,0,0) Pivotin g Basic Solution (8, 4,0,18, 0,0)
  • 29. 4 6 • At this point, all coefficients in the objective function are negative. • This situation occurs only when we have rewritten the linear program so that the basic solution is an optimal solution. • Thus, for this problem, the solution (8, 4, 0, 18, 0, 0), with objective value 28, is optimal. • The only variables in the original linear program are x1, x2, and x3, and so our solution is x1 = 8, x2 = 4, and x3 = 0, with objective value z= 3x1+x2+x3 = (3 * 8)+(1*4)+(2*0) = 28 • Note that the values of the slack variables in the final solution measure how much slack remains in each inequality. 1 2 3 • Slack variable x4 is 18, and in inequality x +x +3x ≤ 30, the left- hand side, with value 8+4+0 = 12, is 18 less than the right-hand side of 30. • Slack variables x5 and x6 are 0 and indeed, in inequalities 2x +2x +5x ≤ 24 and 1 2 3 * 4x1+x2+2x3 ≤ 36, the left-hand and right-hand sides are equal.
  • 30. Recall: Slack form • A slack form can also be represented as a tuple (N, B, A, b, c, v) denoting the slack form: Where : all variables x are non-negatives N, B denotes the set of non-basic and basic variables resp. and A is a matrix having elements aij .
  • 31. Recall: Slack form (cont…) As an example, in the slack form given as:
  • 32. Applications of linear programming Linear programming has a large number of applications. Any textbook on opera-tions research is filled with examples of linear programming, and linear program-ming has become a standard tool taught to students in most business schools. Theelection scenario is one typical example. Two more examples of linear program-ming are the following: An airline wishes to schedule its flight crews. The Federal Aviation Adminis-tration imposes many constraints, such as limiting the number of consecutivehours that each crew member can work and insisting that a particular crew workonly on one model of aircraft during each month. The airline wants to schedulecrews on all of its flights using as few crew members as possible. An oil company wants to decide where to drill for oil. Siting a drill at a particu-lar location has an associated cost and, based on geological surveys, an expectedpayoff of some number of barrels of oil. The company has a limited budget forlocating new drills and wants to maximize the amount of oil it expects to find,given this budget.