Sunteți pe pagina 1din 26

Math 328: Linear Optimization, Jan.13-May.

6, 2015

MSU, Lecture Note #02

Math 328: Linear Optimization


Hongxia Yin
Department of Mathematics and Statistics
Minnesota State University, Mankato
271 Wissink Hall

389-2216

Email: hongxia.yin@mnsu.edu

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

General Linear Programming Model


z = c1 x1 + c2 x2 + + cn xn

(1)

a11 x1 + a12 x2 + + a1n xn {, =, }b1 ,

(2)

max(min)
subject to (s.t.)

a21 x1 + a22 x2 + + a1n xn {, =, }b2 ,

(3)

(4)

am1 x1 + am2 x2 + + amn xn {, =, }bm ,

(5)

xj {, }0 j = 1, 2, , n.

(6)

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

A linear programming problem (LP) is an optimization problem for which we do


the following:
1. We attempt to maximize (or minimize) a linear function of the decision
variables. The function that to be maximized or minimized is called the
objective function.
2. The value of the decision variables must satisfy a set of constraints. Each
constraint must be a linear equation or linear inequality.
3. A sign restriction is associated with each variable. For any variable xi , the
sign restriction specifies either that xi must be nonnegative (xi

xi may be unrestricted in sign (urs).

0) or that

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

Characteristics of LP

Proportionality and additivity: The contribution of the objective function


from each decision variable is proportional to the value of the decision
variable.
The contribution to the objective function for any variable is independent of
the value of the other variables.

same for the left hand sides of constraints

Divisibility: variables should be allowed to assume fractional values.

Certainty: each parameter is known with certainty.

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

? Feasible region of LP: The set in which all the points satisfy the constraints
and signal restriction
Example 1:

max

z = 3x1 + 2x2

subject to (s.t.)

2x1 + x2 100
x1 + x2 80

(7)

x1 40
x1 0
x2 0
(x1 = 40, x2 = 20) is a point in the feasible set, we call it a feasible point.
(x1 = 15, x2 = 70), (x1 = 40, x2 = 20) is not in the feasible set, we
call it an infeasible point.
bounded set; unbounded set; empty set.

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

? Optimal Solution of LP: For Maximize problem, the optimal solution of LP is


the point at which the objective function have its maximum value.
For Minimize problem, the optimal solution of LP is the point at which the
objective function have its minimum value.
An LP problem may
have unique optimal solution;
have no optimal solution; the problem is infeasible;
have more that one, even infinite number of optimal solutions;
be unbounded.
Example 1: has unique optimal solution (x1

= 20, x2 = 60), Optimal

objective value is:

z = 3x1 + 2x2 = 3 20 + 2 60 = 180.

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

? binding constraints/active constraints and nonbinding constraints/inactive


constraints
Example 1:

2x1 + x2 = 2 20 + 60 = 100 = Finishing constraint is

a binding constraint.

x1 = 20 < 40 = Constraint on demand for soldiers is an nonbinding


constraint.

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

Other forms of LP

? Brief Form:
max(or min)
s.t.

Pn

j=1 cj xj
Pn
j=1 aij xj

(=, )bi , (i = 1, , m)

(8)

xj 0 (j = 1, , n).
Let

x1

a1j

.
..
c = (c1 , , cn ), x = . , pj = ..

amj
xn

b1

..

, b = . , (9)

bn

Math 328: Linear Optimization, Jan.13-May.6, 2015

a11

a21

A= .
..

am1

MSU, Lecture Note #02

a12

...

a22

...

..
.

a1n

a2n

..
.

am2

(10)

. . . amn

? Vector Form:
max(or min) cx
Pn
s.t.

j=1

pj xj (=, )b,

(11)

x 0.
? Matrix-vector Form(A is called the coefficient matrix of the constraints)
max(or min) cx
s.t.

Ax (=, )b,
x 0.

(12)

Math 328: Linear Optimization, Jan.13-May.6, 2015

? Important concepts in LP
decision variable/activity, data/parameter
objective/goal/target
constraint/limitation/requirement
equality/inequality constraint
constraint function/the right-hand side
direction of inequality
coefficient vector/coefficient matrix
nonnegativity constraint
satisfied/violated

MSU, Lecture Note #02

10

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

extreme point
A set of points S is a convex set if the line segment joining any pair of
points in S is wholly contained in S .
For any convex set S , a point is an extreme point if each line segment
that lied completely in S and contains the point P has P as an endpoint of
the line segment.
slack/surplus (introduce later)

11

Math 328: Linear Optimization, Jan.13-May.6, 2015

A Diet problem

MSU, Lecture Note #02

12

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

13

Example 2 Suppose my diet requires that all the food I eat come from one of the
four basic food groups (chocolate cake, ice cream, soda, and cheesecake). At
present, the following four foods are available for consumption: brownies,
chocolate ice cream, cola, and pineapple cheesecake. Each brownie costs 50c,
each scoop of chocolate ice cream costs 20c, each bottle of cola costs 30c, and
each piece of pineapple cheesecake costs 80c. Each day, I must ingest at least
500 calorie, 6 oz of chocolate, 10 oz of sugar, and 8 oz of fat. The nutritional
content per unit of each food is shown in the table below,
Calories

Chocolate oz

sugar (oz)

fatoz

Brownie

400

Chocolate ice cream

200

Cola

150

Pineapple cheesecake

500

Formulate a mathematical model that can be used to satisfy my daily nutritional


requirements at minimum cost.

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

Define decision variables


x1 =number of brownies eaten daily;
x2 =number of scoops of chocolate ice cream eaten daily;
x3 =bottles of cola drunk daily;
x4 = pieces of pineapple cheesecake eaten daily.
Objective function; The total cost of the foot for each day:
z = 50x1 + 20x2 + 30x3 + 80x4 .
The decision variables must satisfy the following constraints
1:
2:

400x1 + 200x2 + 150x3 + 500x4 500, (Calorie constraint)


3x1 + 2x2 6, (Chocolate constraint)

3:

2x1 + 2x2 + 4x3 + 4x4 10, (Sugar constraint)

4:

2x1 + 4x2 + x3 + 5x4 8, (F at constraint)

Sign limitation xi 0, i = 1, 2, 3, 4.

14

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

15

Thus, we obtain the LP model for the problem

min

z = 50x1 + 20x2 + 30x3 + 80x4

subject to (s.t.)

400x1 + 200x2 + 150x3 + 500x4 500


3x1 + 2x2 6
2x1 + 2x2 + 4x3 + 4x4 10
2x1 + 4x2 + x3 + 5x4 8
xi 0, i = 1, 2, 3, 4.

(13)

Math 328: Linear Optimization, Jan.13-May.6, 2015

A work-scheduling problem

MSU, Lecture Note #02

16

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

Example 3: A post office requires different number of full-time employees on


different days of the week. The number of full-time employees required on each
day is given in the following table:
Number of Employees Required
Day 1=Mon.

17

Day 2=Tue.

13

Day 3=Wed.

15

Day 4=Thur.

19

Day 5=Fri.

14

Day 6=Sat.

16

Day 7=Sun.

11

Each full-time employee must work 5 consecutive days and then receive 2 days
off. Formulate an LP to minimize the number of full-time employees must be hired.

17

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

Solution:

? Decision Variables:

xi = the number of employees beginning work on day i i = 1, 2, , 7.

For example, x1 is the number of people beginning work on Monday, these


people work Monday to Friday.

? Objective Function:
Since each employee begins work on exactly one day of the week, thus we
can obtain the objective function:

z = x1 + x2 + x3 + x4 + x5 + x6 + x7

? Constraints:
The post office must ensure that enough employees are working on each day
of the week. For example, at least 17 employees must be working on Monday.
Who is working on Monday?

18

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

Everybody except the employee who begin work on Tuesday or on


Wednesday (they get, respectively, Sunday and Monday, and Monday and
Tuesday off). This means that
Constraint 1:

x1

+ x4 + x5 + x6 + x7 17.

Constraint 2: at least 13 employees must be working on Tuesday

x1 + x2

+ x5 + x6 + x7 13.

Constraint 3: at least 15 employees must be working on Wednesday

x1 + x2 + x3

+ x6 + x7 15.

Constraint 4: at least 19 employees must be working on Thursday

x1 + x2 + x3 + x4 + x7 19.
Constraint 5: at least 14 employees must be working on Friday

x1 + x2 + x3 + x4 + x5

14.

Constraint 6: at least 16 employees must be working on Saturday

x2 + x3 + x4 + x5 + x6

16.

Constraint 7: at least 11 employees must be working on Sunday

19

Math 328: Linear Optimization, Jan.13-May.6, 2015

x3 + x4 + x5 + x6 + x7 11.
? Sign Restrictions:
xi 0, i = 1, , 7.

MSU, Lecture Note #02

20

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

21

? LP model for post office work-scheduling problem:

min

z = x1 + x2 + x3 + x4 + x5 + x6 + x7

s.t.

x1

+ x4 + x5 + x6 + x7 17

x1 + x2

+ x5 + x6 + x7 13

x1 + x2 + x3

+ x6 + x7 15

x1 + x2 + x3 + x4 + x7 19
x1 + x2 + x3 + x4 + x5

14

x2 + x3 + x4 + x5 + x6

15

x3 + x4 + x5 + x6 + x7 11
xi 0, i = 1, , 7.

(14)

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

The optimal solution for (14) is

x1 = 4/3, x2 = 10/3, x3 = 2, x4 = 22/3, x5 = 0, x6 = 10/3, x7 =


5, z = 67/3
Since we are only allowing full-time employees, the variables must be integers,
and the Divisibility Assumption is not satisfied.
In am attempt to find a reasonable answer in which all variable are integer, we
could try to round the fractional variables up, yielding the feasible solution:

x1 = 2, x2 = 3, x3 = 2, x4 = 8, x5 = 0, x6 = 4, x7 = 5. and z = 25.

22

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

Integer programming model ( in which the variables are integer) can be used
the solve this problem. An optimal solution to the post office problem is

x1 = 4, x2 = 4, x3 = 2, x4 = 6, x5 = 0, x6 = 4, x7 = 3, and z = 23.
Notice: There is no way that the optimal linear programming solution could have
been rounded to obtain the optimal all-integer solution.

23

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

24

Homework

Graph the feasible set and solve the problems

max

z = x1 + x2

s.t.

x1 + x2 4

(15)

x1 x2 5
x1 , x2 0.
max

z = 4x1 + x2

s.t.

8x1 + 2x2 16
5x1 + 2x2 12
x1 , x2 0.

(16)

Math 328: Linear Optimization, Jan.13-May.6, 2015

max

z = x1 + 3x2

s.t.

x1 x2 4

MSU, Lecture Note #02

25

(17)

x1 + 2x2 4
x1 , x2 0.
max

z = 3x1 + x2

s.t.

2x1 + x2 6
x1 + 3x2 9
x1 , x2 0.

(18)

Math 328: Linear Optimization, Jan.13-May.6, 2015

MSU, Lecture Note #02

Homework:
In the post office example (Example 2 of Lecture 2), suppose that each full-time
employee works 8 hours per day. Thus, Mondays requirement of 17 workers may
be viewed as a requirement of 8(17)=136 hours. The post office may meet its
daily labor requirements by using both full-time and part-time employees. during
each week, a full-time employee works 8 hours a day for five consecutive days,
and a part-time employee works 4 hours a day for five consecutive days. A
full-time employee costs the post office $15per hour, whereas a part-time
employee (with reduced fringe benefits) costs the post office only 10 per hour.
Union requirements limit part-time labor to25% of weekly labor requirements.
Formulate an LP to minimize the post offices weekly labor costs.

26

S-ar putea să vă placă și