CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of...

34

Transcript of CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of...

Page 1: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.
Page 2: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

DIET PROBLEM

REFERENCES

WHO WE ARE

بسم الله الرحمن الرحيم

Page 3: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• CONTENTS

DIET PROBLEM

BASIC CONCEPTS

EXERCISES

DIET PROBLEM

Linear programming problems Graphical method of solution

Problem 1 Problem 2 Problem 3 Graphical solution exercise

REFERENCES

Page 4: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• DIET PROBLEM

DIET PROBLEM

http://www-neos.mcs.anl.gov/CaseStudies/dietpy/WebForms/table.html

Weight is a big problem in our live , but do you know that there are some linear programming online solutions ?

Diet Problem

From here I invite you to visit the following link and have more benefits in your life .

Page 5: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

WHO WE ARE?

• WHO WE ARE

HANAN HASAN AL-MARHABI

GRADUATED FROM KING ABDULAZIZ UNIVERSITY

WORK AS A TEACHER ASSESTANT IN KING SAUD UNIVERSITY

FOR MORE INFORMATION, WELCOME AT HANAN’S WEBSITEhttp://faculty.ksu.edu.sa/techpen/techhome/Pages/techhome1.aspx

EMAILTO: [email protected]

DIET PROBLEM

Page 6: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

Basic concepts involve ;

• BASIC CONCEPTS

- Linear programming problems

- Graphical method of solution

DIET PROBLEM

Page 7: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

LINEAR PROGRAMMING PROBLEMES

• BASIC CONCEPTS

A linear programming problem is one in which we are to find the maximum or minimum value of a linear expression;

(called the objective function), It would be Max z Or Min c

subject to a number of linear constraints of the form

aX1 + bX2 + cX3 + . . .≤ N

aX1 + bX2 + cX3 + . . .

Or aX1 + bX2 + cX3 + . . .≥ N.

X1 , X2 , X3 , . . .> 0

DIET PROBLEM

Page 8: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

LINEAR PROGRAMMING PROBLEMES

• BASIC CONCEPTS

The largest or smallest value of the objective function is called the optimal value, and

a collection of values of X1, X2, X3, . . . that gives the optimal value constitutes an optimal solution.

The variables X1, X2, X3, . . . are called the decision variables.

EXSERCISE

DIET PROBLEM

Page 9: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

LINEAR PROGRAMMING PROBLEMES

• BASIC CONCEPTS

If the objective function is

And the constraints are;4X1 + 3X2 – X3 ≥ 3

Max z = 3X1- 2X2 + 4X3

X1+ 2X2 + X3 ≤ 4X1 , X2 , X3 , . . .> 0

Why can't I simply choose, say, X3 to be really large (X3 = 1,000,000 say) and thereby make Max z as large as I want? You can't because;

A - That would make z too large.B – You have to change X1 first.C – It would violate the second constrain .

DIET PROBLEM

Page 10: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

GRAPHICAL METHOD OF SOLUTION

• BASIC CONCEPTS

The graphical method for solving linear programming problems in two unknowns is as follows;

A- Graph the feasible region by Draw the line ax + by = c ...(1) For each constraint,.

B- Compute the coordinates of the corner points.

C- Substitute the coordinates of the corner points into the objective function to see which gives the optimal value.

D- Optimal solutions always exist when the feasible region is bounded, but may or may not exist when the feasible region is unbounded.

X2

X1

DIET PROBLEM

Page 11: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Problem 1 Problem 2

problem 3 Graphical solution exercise

Page 12: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

A cargo plane has three compartments for storing cargo: front, centre and rear. These compartments have the following limits on both weight and space:

Compartment Weight capacity (tones) Space capacity (cubic meters)

Front 10 6800

Center 16 8700

rear 18 5300

Furthermore, the weight of the cargo in the respective compartments must be the same proportion of that compartment's weight capacity to maintain the balance of the plane.

Problem 1

Page 13: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

The following four cargoes are available for shipment on the next flight:

Any proportion of these cargoes can be accepted. The objective is to determine how much (if any) of each cargo C1, C2, C3 and C4 should be accepted and how to distribute each among the compartments so that the total profit for the flight is maximized.

Cont …

Cargo Weight capacity (tones) Volume (cubic meters/tone)

Profit (£/tone)

C1 18 480 310

C2 15 650 380

C3 23 580 350

C4 12 390 285

Formulate the above problem as a linear program

Page 14: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM constraints :

here I have 4 cargoes and I need to distribute them among three compartments in the plane,Cargoes : C1 , C2 , C3 , C4 Compartments : front , center , rear My problem is search how can I get best distribution that subject to mentioned constraints.

solution

Here I have tow major types of constraints, Cargoes constraints - compartment constraints

Page 15: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Cont …First : cargo constraints :

Weights constraints of each cargo respected among each compartment , and as I have 4 cargoes I will have 4 constraints

C1 C2 C3 C4

X11 + X12 +X13

let assume Xij , i =cargo , j = plane compartment

< 18

X21 + X22 +X23 < 15

X31 + X32 +X33 < 23

X41 + X42 +X43 < 12

Weights

Page 16: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Cont …Second: compartment constraints :

here I have 3 compartments so I will have 4 constraints related to weights and volumes as mentioned.

C1 C2 C3 C4

X11 + X21 +X31

let assume Xij , i =cargo , j = plane compartment

< 10Weight constraints

+X41

X12 + X22 +X32 < 16+X42

X13 + X23 +X33 < 8+X43

480X11 + 650X21+580X31 < 6800

Volume constraints

+390X41

480X12 + 650X22+580X32 < 8700+390X42

480X13 + 650X23+580X33 < 5300+390X43

Page 17: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Final constraints is Cont…

those proportions should be same , so proportion for any compartment equal to all cargos divided by weight of that compartment , so constraint will be :

the weight of the cargo in the respective compartments must be the same proportion of that compartment's weight capacity to maintain the balance of the plane

8 16 10

X11 + X21 +X31 +X41

10= X12 + X22 +X32 +X42

16X13 + X23 +X33 +X43=

8

Xij > 0

Page 18: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Objective

Cont…

The objective is to maximize total profit :

310(X11 + X12 +X13) + 380(X21+ X22 +X23)

+ 350(X31 + X32 +X33) + 385 (X41 + X42 +X43)

Max z =

Page 19: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

A company manufactures four products (1,2,3,4) on two machines (X and Y). The time (in minutes) to process one unit of each product on each machine is shown below:

The profit per unit for each product (1,2,3,4) is £10, £12, £17 and £8 respectively. Product 1 must be produced on both machines X and Y but products 2, 3 and 4 can be produced on either machine.

Problem 2

product X Y1 10 27

2 12 19

3 13 33

4 8 23

Page 20: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

The factory is very small and this means that floor space is very limited. Only one week's production is stored in 50 square meters of floor space where the floor space taken up by each product is 0.1, 0.15, 0.5 and 0.05 (square meters) for products 1, 2, 3 and 4 respectively.

Customer requirements mean that the amount of product 3 produced should be related to the amount of product 2 produced. Over a week approximately twice as many units of product 2 should be produced as product 3.

Cont ….

Machine X is out of action (for maintenance/because of breakdown) 5% of the time and machine Y 7% of the time.

Assuming a working week 35 hours long formulate the problem of how to manufacture these products as a linear program.

Page 21: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

So variables are :

here 4 products produced by tow machinessolution

Let assume

Xi = the amount of product i(1,2,3,4) produced by machine X Yi = the amount of product (1,2,3,4) produced by machine Y

each product can be produced by any of tow machines so will expressed by tow variables (X2 , Y2). ( X3,Y3), (X4,Y4 ) , just product 1 should produced by both machines so it will expressed on one variable ( X1 )

X1 , X2 , Y2 , X3 , Y3 , X4 , Y4

Page 22: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Constraints :Cont…

• Floor space :

The factory is very small and this means that floor space is very limited. Only one week's production is stored in 50 square meters of floor space where the floor space taken up by each product is 0.1, 0.15, 0.5 and 0.05 (square meters) for products 1, 2, 3 and 4 respectively.

0.1X1 + 0.15(X2 + Y2) + 0. 5(X3 + Y3)

+ 0.05(X4 + Y4) < 50

• Costumer requirement :

Over a week approximately twice as many units of product 2 should be produced as product 3.

X2 + Y2 = 2(X3 + Y3)

• Available time :

Machine X is out of action (for maintenance/because of breakdown) 5% of the time and machine Y 7% of the time.

10X1 +12 X2 +13X3 < 0.95+8X4 (35) (60)

27Y1 + 19Y2 +33Y3 <+23Y4 0.93 (35) (60)

Xij > 0

Page 23: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Objective :

Cont…

10X1 + 12(X2 + Y2) + 17(X3 + Y3) + 8(X4 + Y4)

The profit per unit for each product (1,2,3,4) is £10, £12, £17 and £8 respectively.

Max z =

Page 24: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

A company assembles four products (1, 2, 3, 4) from delivered components. The profit per unit for each product (1, 2, 3, 4) is £10, £15, £22 and £17 respectively. The maximum demand in the next week for each product (1, 2, 3, 4) is 50, 60, 85 and 70 units respectively.

Problem 3

Sages Product 1 Product 2 Prod6uct 3 Product 4

A 2 2 1 1

B 2 4 1 2

C 3 6 1 5

There are three stages (A, B, C) in the manual assembly of each product and the man-hours needed for each stage per unit of product are shown below:

Page 25: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

The nominal time available in the next week for assembly at each stage (A, B, C) is 160, 200 and 80 man-hours respectively.

Cont…

It is possible to vary the man-hours spent on assembly at each stage such that workers previously employed on stage B assembly could spend up to 20% of their time on stage A assembly and workers previously employed on stage C assembly could spend up to 30% of their time on stage A assembly.

Production constraints also require that the ratio (product 1 units assembled)/(product 4 units assembled) must lie between 0.9 and 1.15.

Formulate the problem of deciding how much to produce next week as a linear program.

Page 26: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

here 4 products produced solution

Let assume

Xi = the amount of product i(1,2,3,4) produced by machine X

Variables : X1 , X2 , X3 , X4

additional transferred time variables : TBA ,TCA

TBA be the amount of time transferred from B to A

TCA be the amount of time transferred from C to A

Page 27: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Constraints :Cont…

• Maximum demand :

The maximum demand in the next week for each product (1, 2, 3, 4) is 50, 60, 85 and 70 units respectively.

X1 < 50 X2 < 60

X3 < 85

• Work time :

The nominal time available in the next week for assembly at each stage (A, B, C) is 160, 200 and 80 man-hours respectively.

workers previously employed on stage B assembly could spend up to 20% of their time on stage A assembly and workers previously employed on stage C assembly could spend up to 30% of their time on stage A assembly.

2X1 +2 X2 + X3 < 160+ X4

2X1 + 4X2 +X3 <+2X4 160

X3 < 70

3X1 + 6X2 +X3 <+5X4 80

+ TBA+ TCA

- TBA

- TCA

TBA < 0.2(200)

TCA < 0.3(80)

Page 28: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Constraints :Cont…

• Ratio constraint :the ratio (product 1 units assembled)/(product 4 units assembled) must lie between 0.9 and 1.15.

0.9 <X1

X4 < 1.15

The profit per unit for each product (1, 2, 3, 4) is £10, £15, £22 and £17 respectively

10X1+15 X2 + 22X3+ 17X4

Objective :

Max z =

Xij > 0

Page 29: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Max Z = 50x + 18y

Subject to the constraints : 2X + Y < 100 X + Y < 80 X , Y > 0

Graphical solution exercise

Sep 1 : Turn constrains into equations

2X + Y = 100

X + Y = 80

Page 30: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Cont…

Sep 2 : Draw straight lines for the following equations ,

2X + Y = 100X + Y = 80

To determine tow points on straight line 2X + Y = 100

Put Y = 0 2X = 100

=> X = 50

Put X = 0 y = 100

=> Y = 100 (50, 0) , (0 , 100 ) are the points on the line (1)

To determine tow points on straight line X + Y = 80

Put Y = 0 X = 80

=> X = 80

Put X = 0 y = 80

=> Y = 80 (80, 0) , (0 , 80 ) are the points on the line (2)

Page 31: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Cont…

(50, 0) , (0 , 100 ) line (1)(80, 0) , (0 , 80 ) line (2)

Y

X

(0 , 100 )

(0 , 80 )

(50,

0)

(80,

0)

A- Draw the feasible .

B- Mark the corner points then determine values of (X,Y ) on each corner’s point.

(0 , 0 )

A

B

C

D

(20 , 60 )

Page 32: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Cont…Y

X

(0 , 100 )

(0 , 80 )

(50,

0)

(80,

0)

(0 , 0 )

A

B

C

D

(20 , 60 ) Step 3 : Substitute the coordinates of the corner points into the objective function to see which gives the optimal value.

Corner points O.F. O.S.

A ( 0 , 80 )B ( 20 , 60 )

C ( 50 , 0 )

D ( 0 , 0 )

50 (0) + 18 (80)= 1440

50 (20) + 18 (60)= 2080

50 (50) + 18 (0)= 2500

50 (0) + 18 (0)= 0

B ( 20 , 60 )

X = 20 Y = 60 Max z = 2080

Page 33: CONTENTS BASIC CONCEPTS EXERCISES DIET PROBLEM Linear programming problems Graphical method of solution Problem 1 Problem 2 Problem 3 Graphical solution.

CONTENTS

BASIC CONCEPTS

EXERCISES

REFERENCES

WHO WE ARE

• EXERCISES

DIET PROBLEM

Cont…

Accurate results : By use the mathematical method

2X + Y = 100X + Y = 80

Then use ( X=20 ) to determine Y on any equation

(- 1 ) ×

X = 20

X + Y = 80 X = 20Y = 80

X + Y = ( 20 , 80 )

Max Z = 50x + 18y

= 50 (20) + 18 (60)= 2080