You are on page 1of 23

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

Engineering Department
Computer Systems Engineering

Software Engineering
Operation Research

Homework 1

Prepared By

Name : Ibrahim Essam Al Magharee


Student.NO : 20163320

Under Supervisor

Dr. Iyad Albayouk


1) NaserCo wants to produce 5 products (A, B, C, D, E) according to the
following data: 1. Capital = 2 million Dinars 2. Working days needed for the
production is 1500 days 3. Units need of the capital as follows:

Let x1=A, x2=B , x3=C , x4=D ,x5=E


objective function:
Max z=15x1 +9x2+12x3 +8X4 +10x5
Subject to:
1)25000x1 +20000x2 +20000x3 + 15000x4 + 20000x5 <=2000000
2)25x1 +15x2+20x3+10x4+15x5 <=1500
3)x1<=500 , x2<=200 ,x3 <=300 ,x4<=400 ,x5<=250
2) NaserCo Wants to display it products within 10,000 feet square according to the
following Data:

Let x1=A, x2=B , x3=C , x4=D


objective function:
Max z=(80-(50+2+5))x1+(115-(90+3+7))x2+(250-(180+5+10))x3 +(300-(230+7+8))X4
Subject to:
1)20x1+15x2+30x3+40x4<=10000
2)x1>=10 ,x2>=10
3)x3+x4<=20
4) (50+2+5)x1 +(9+3+7)x2 +(180+15+10)x3 +(230+7+8)x4<=250000

3) A firm makes three products 1,2, and 3. Each product requires production time in
three departments as shown.
Solution:
Let product 1 is x1
Let product 2 is x2
Let product 3 is x3
Subject to :
3x1 + 4x2 + 2x3 <= 600
2x1 + x2 + 2x3 <= 400
x1 + 3x2 + 3x3 <= 300
x1,x2,x3 >= 0
The optimal solution is : z = 2x1 + 4x2 + 2.5x3
4) Consider this problem
Max Z = x1 + 3x2
Subject to:
x1 - 3x2 <= 3
-2 x1 + x2 <= 2
-3x1 + 4x2 <= 12
3x1 + x2 <= 9
x1, x2> = 0
a) Solve by graphic method
b) Identify all extreme points
c) Solve by simplex method
solution :
a)
 x1-3x2 = 3
Let x1 = 0,
-3x2 = 3 ==> x2 = -1
P11 (0, -1)
Let x2 = 0,
x1 = 3
P12 (3,0)
 -2x1 + x2 = 2
Let x1 = 0,
x2 = 2
P21 (0,2)
Let x2 = 0,
-2x1 = 2 ==> x1 = -1
P22 (-1,0)
 -3x1 + 4x2 = 12
Let x1 = 0,
4x2 = 12 ==> x2 = 3
P31 (0,3)
Let x2 = 0,
-3x1 = 12 ==> x1 = -4
P32 (-4,0)
 3x1 + x2 = 9
Let x1 = 0,
x2 = 9
P41 (0,9)
Let x2 = 0,
3x1 = 9 ==> x1 = 3
P42(3,0)
b) .

 Point A is the result of the intersection of the seconds and third equations.
-2x1 + x2 = 2 ----------- 1
-3x1 + 4x2 = 12 ----------- 2
Multiply the first equation by -4
8x1-4x2 = -8
-3x1 + 4x2 = 12 Sum of equations
5x1 = 4, ---------- x1 = 0.8 Instead of the first equation x2 = 3.6 A (0.8,3.6)

 Point B is the result of the intersection of the third and fourth equations
-3x1 + 4x2 = 12 -------------1
3x1 + x2 = 9 ------------ 2
Multiply the second equation by -4
-3x1 + 4x2 = 12 -12x1-4x2 = -36
Sum of equations
-15x1 = -24 >>> x1 = 1.6
Instead of the first equation x2 = 4.2 B (1.6,4.2)

To find the optimal solution, we must substitute the points A, B, C, D, F into the
objective function:

POINTS Z
A(0.8,3.6) 11.6
B(1.6,4.2) 14.2
C(0,2) 6
D(0,0) 0
F(3,0) 3

The optimal solution :


Max z = 14.2
x1 = 1.6
x2 = 4.2
c) Solve by simplex method
Max Z - x1 - 3x2 = 0
Subject to:
1) x1 - 3x2+s1 = 3
2) -2x1 + x2 +s2=2
3)-3x1 +4x2 +s3= 12
4) 3x1 + x2 +s4= 9
5) x1,x2,s1,s2,s3,s4 >=0

Basic X1 X2 S1 S2 S3 S4 RHS
Sol -1 -3 0 0 0 0 0
Obj Fun
S1 1 -3 1 0 0 0 3
S2 -2 1 0 1 0 0 2
S3 -3 4 0 0 1 0 12
S4 3 1 0 0 0 1 9

3/-3 =-1 , 2/1 =2 , 12/4 =3 , 9/1 =9

Basic X1 X2 S1 S2 S3 S4 RHS
Sol -7 0 0 3 0 0 6
Obj Fun
S1 -5 0 1 3 0 0 9
X2 -2 1 0 1 0 0 2
S3 5 0 0 -4 1 0 4
S4 5 0 0 -1 0 1 7

9/-5 , 2/-2=-1 , 4/5 =0.8 , 7/5=1.4

Basic X1 X2 S1 S2 S3 S4 RHS
Sol 0 0 0 -13/5 7/5 0 58/5
Obj Fun
S1 0 0 1 -1 1 0 13
X2 0 1 0 -3/5 2/5 0 18/5
X1 0 0 0 -4/5 1/5 0 4/5
S4 0 0 0 3 -1 1 3

13/-1=-13 , 18/5 / -3/5 =-6 , 4/5 / -4/5 =-1 , 3/3=1


Basic X1 X2 S1 S2 S3 S4 RHS
Sol 0 0 0 0 8/15 13/15 71/5
Obj Fun
S1 0 0 1 0 2/3 1/3 14
X2 0 1 0 0 1/5 1/5 21/5
X1 1 0 0 0 -1/15 4/15 8/5
S2 0 0 0 1 -1/3 1/3 1

The optimal solution is Z = 71/5.


(x1,x2) = (8/5, 21/5)

5) Solve this problem


Max z = 5x1 + 4x2
Subject to:
x1 + 2x2 <= 6
-2x1 + x2 <= 4
5x1 + 3x2 <= 15
x1,x2 >= 0
a) Graphically
b) By simplex method

Solution:

a)
 X1+2x2=6
Let x1=0 , => x2=3
P11(0,3)
Let x2=0 , => x1=6
P12(6,0)
 -2x1+x2=4
Let x1=0 , => x2=4
P21(0,4)
Let x2=0 , =>x1=-2
P23(-2,0)
 5x1+3x2=15
Let x1=0 , =>x2=5
P31(0,5)
Let x2=0 , =>x1=3
P32(3,0)
Point B is the result of the intersection of the first and third equations
X1+2x2=6 -------------- 1
5x1 +3x2=15 ------------ 2
Multiply the first equation by -5
-5x1 – 10 x2=-30
5x1 + 3x2 =15
Sum of equations
-7x2=-15 >>>x2=2.14

Instead of the first equation


x1=1.71
B(1.71,2.14)
To find the optimal solution you need to find all extreme points (A,B,C).
POINTS Z
A(0,3) 12
B(1.72,2.14) 17.16
C(3,0) 15
D(0,0) 0

The optimal solution: max z = 17.16 >>>> x1 = 1.72 >>>> x2 = 2.14


Basic X1 X2 S1 S2 S3 RHS
Sol -5 -4 0 0 0 0
Obj Fun
S1 1 2 1 0 0 6
S2 -2 1 0 1 0 4
S3 5 3 0 0 1 15

6/1=6 , 4/-2= -2 , 15/5=5

Basic X1 X2 S1 S2 S3 RHS
Sol 0 -1 0 0 1 15
Obj Fun
S1 0 7/5 1 0 -1/5 3
S2 0 11/5 0 1 2/5 10
X1 1 3/5 0 0 1 3

3 / 7/5 = 2.14 , 10 / 11/5 = 4.54 ,15/ 3/5=25

Basic X1 X2 S1 S2 S3 RHS
Sol 0 0 5/7 0 6/7 120/7
Obj Fun
X2 0 1 5/7 0 -1/7 15/7
S2 0 0 -11/7 1 5/7 37/7
X1 0 0 5/7 0 6/7 12/7

The optimal solution is max Z = 120/7.


x1 = 12/7
x2 = 15/7
6) Solve this problem using simplex method.
Min z= -5x1 - 3x2 + 2x3
Subject to:
x1 + x2 + x3 <= 5
x1 - 2x2 - x3 <=4
3x1 + 3x2 + 2x3 <= 15
x1,x2,x3 >= 0

Min Z +5x1 + 3x2 - 2x3 = 0


Subject to:
1) x1 +x2+x3+s1 = 5
2) x1 - 2x2 –x3 +s2=4
3)3x1 +3x2 +2x3 +s3= 15
4) x1,x2,x3s1,s2,s3 >=0

Basic X1 X2 X3 S1 S2 S3 RHS
Sol 5 3 -2 0 0 0 0
Obj Fun
S1 1 1 1 1 0 0 5
S2 1 -2 -1 0 1 0 4
S3 3 3 2 0 0 1 15

5/1=5 , 4/1= 4 , 15/3=5

Basic X1 X2 X3 S1 S2 S3 RHS
Sol 0 13 3 0 -5 0 -20
Obj Fun
S1 0 3 2 1 -1 0 1
X1 1 -2 -1 0 1 0 4
S3 0 9 5 0 -3 1 3

1/3=0.33 , 4/-2=-2 ,3/9=1/3


Basic X1 X2 X3 S1 S2 S3 RHS
Sol 0 0 -5.67 -4.33 -0.67 0 -24.33
Obj Fun
X2 0 1 0.67 0.33 -0.33 0 0.33
X1 1 0 0.33 0.67 0.33 0 4.67
S3 0 0 0 -1 -3 1 0
The optimal
solution is min Z = -24.33.
X1 = 0.33
X2 = 4.67

7) Solve this problem using the simplex method


Min Z= x1 + x2 -4x3
Subject to:
x1 + x2 + 2x3 <= 9
x1 + x2 - x3 <= 2
-x1 + x2 + x3 <= 4
x1,x2,x3>= 0

Solution :
Max Z -x1 -x2 +4x3 = 0

Subject to:
1) x1 +x2+2x3+s1 = 9
2) x1 + x2 –x3 +s2=2
3)-x1 +x2 +x3 +s3= 4
4) x1,x2,x3s1,s2,s3 >=0

Basic X1 X2 X3 S1 S2 S3 RHS
Sol -1 -1 4 0 0 0 0
Obj Fun
S1 1 1 2 1 0 0 9
S2 1 1 -1 0 1 0 2
S3 -1 1 1 0 0 1 4
9/2=4.5 , 2/-1=-2 , 4/1=4
Basic X1 X2 X3 S1 S2 S3 RHS
Sol 3 -5 0 0 0 -4 -16
Obj Fun
S1 3 -1 0 1 0 -2 1
S2 0 2 0 0 1 1 6
X3 -1 1 1 0 0 1 4

1/3=0.33 , 6/0=∞, 4/-1=-4

Basic X1 X2 X3 S1 S2 S3 RHS
Sol 0 -4 0 -1 0 -2 -17
Obj Fun
X1 1 -0.33 0 0.33 0 -0.67 0.33
S2 0 2 0 0 1 1 6
X3 0 0.67 1 0.33 0 0.33 4.33

The optimal solution is min Z = -17.


X1 = 0.33
X2 = 4.33
8) Solve this problem
Max z = -x1 + 8x2
Subject to:
x1 + x2 >= 1
-x1 + 6x2 <= 3
0x1 + 2x2 <= 2
x1,x2 >= 0
a) Graphically
b) By Big M method

solution:
a)
 X1+x2=1
Let x1=0 , => x2=1
P11(0,1)
Let x2=0 ,=>x1=1
P12(1,0)
 -x1+6x2=3
Let x1=0 ,=> x2=0.5
P21(0,0.5)
Let x2=0 ,=>x1=-3
P22(-3,0)
 2x2=2
X2=1
P31(0,1)
Point B is the result of the intersection of the first and seconds equations
x1+x2=1 ---------------------1
-x1+6x2=3 ------------------2
Sum of equations
7x2=4 >>x2=4\7 =0.57
Instead of the first equation
x1=0.42
B(0.42,0.57)
Point C is the result of the intersection of the second and third equations
-x1+6x2=3 ---------------1
2x2=2 ------------------2
X2=1
Instead of the first equation
x1=3
C(3,1)

To find the optimal solution you need to find all extreme points (A,B,C).
POINTS Z
A(1,0) -1
B(0.42,0.57) 4.14
C(3,1) 5
D(0,0) 0

The optimal solution max z= 5


X1 = 3
X2 = 1
b) By Big M method
Max Z +x1 -8x2 +MR1 = 0
Subject to:
1) x1 +x2-s1+R1 = 1
2) -x1 + 6x2 +s2=3
3)0x1 +2x2 +s3= 2
4) x1,x2,s1,s2,s3,R1 >=0

Basic X1 X2 S1 S2 S3 R1 RHS
Sol 1 -8 0 0 0 M 0
Obj Fun
R1 1 1 -1 0 0 1 1
S2 -1 6 0 1 0 0 3
S3 0 2 0 0 1 0 2

Multiply rows R1 by -M and add to first row (Obj. Function line ).

Basic X1 X2 S1 S2 S3 R1 RHS
Sol -M+1 -M-8 M 0 0 0 -M
Obj Fun
R1 1 1 -1 0 0 1 1
S2 -1 6 0 1 0 0 3
S3 0 2 0 0 1 0 2

1/1=1 ,3/6=0.5 , 2/2 =1

Basic X1 X2 S1 S2 S3 R1 RHS
Sol -1.17M-0.33 0 M 0.17M+1.33 0 0 -0.5M+4
Obj Fun
R1 1.17 0 -1 -0.17 0 1 0.5
X2 -0.17 1 0 0.17 0 0 0.5
S3 0.33 0 0 -0.33 1 0 1

0.5/1.17=0.43 , 0.5/0.17=-3 , 1/0.33=3


Basic X1 X2 S1 S2 S3 R1 RHS
Sol 0 0 -0.29 1.29 0 4.14
Obj Fun M+0.29
R1 1 0 -0.86 -0.14 0 0.86 0.43
X2 0 1 -0.14 0.14 1 0.14 0.57
S3 0 0 0.29 -0.29 0 -0.29 0.86

0.43/-0.86= -0.5 , 0.57/-0.14=-4 , 0.86/0.29 =3

Basic X1 X2 S1 S2 S3 R1 RHS
Sol 0 0 0 1 1 M 5
Obj Fun
R1 1 0 0 -1 3 0 3
X2 0 1 0 0 0.5 0 1
X3 0 0 1 -1 3.5 -1 3

The optimal solution is max Z = 5.


X1 = 3
X2 = 1
9) Solve this problem
Min z = 6x1 + 3x2
Subject to:
2x1 + 4x2 >= 16
4x1 + 3x2 <= 24
x1,x2 >= 0
a) Graphically
b) By Big M method
Solution:
a)

 2x1+4x2=16
Let x1=0 , => 4x2=16 => x2=4
p11(0,4)
Let x2=0 , => 2x1=16 => x1=8
p21(8,0)
 4x1+3x2=24
Let x1=0 , => 3x2=24 , => x2=8
p21(0,8)
Let x2=0 ,4x1=24 ,x1=6
p22(6,0)
Point C is the result of the intersection of the first and seconds equations
2x1+4x2=16 -----------------1
4x1+3x2=24 -------------------2
Multiply the first equation by -2
-4x1-8x2=-32 --------------1
4x1+3x2=24
Sum of equations
-5x2=-8 => x2=-8\-5 =1.6
Instead of the first equation
x1=4.8
C(4.8,1.6)
To find the optimal solution you need to find all extreme points (A,B,C).
POINTS Z
A(0,8) 24
B(0,4) 12
C(4.8,1.6) 33.6

The optimal solution min z = 12 >> x1 = 0 >> x2 = 4


b) By Big M method
Min Z -6x1 -3x2 -MR1 = 0
Subject to:
1) 2x1 +4x2-s1+R1 = 16
2) 4x1 +3x2 +s2=24
3) x1,x2,s1,s2,R1 >=0

Basic X1 X2 S1 S2 R1 RHS
Sol -6 -3 0 0 -M 0
Obj Fun
R1 2 4 -1 0 1 1
S2 4 3 0 1 0 3

Multiply rows R1 by M and add to first row (Obj. Function line ).

Basic X1 X2 S1 S2 R1 RHS
Sol 2M-6 4M-3 -M 0 0 16M
Obj Fun
R1 2 4 -1 0 1 16
S2 4 3 0 1 0 24

16/4=4 , 24/3=8
Basic X1 X2 S1 S2 R1 RHS
Sol -4.5 0 -0.75 0 -M+0.75 12
Obj Fun
X2 0.5 1 -0.25 0 0.25 4
S2 2.5 0 0.75 1 -0.75 12

The optimal solution is min Z = 12.


X1 = 0
X2 = 4
10) Solve this linear problem using the Big M method.
Min z = x1 - 2x2 + x3
Subject to:
x1 + x2 -x3 >= 4
x1 - 4x2 + x3 <= 2
x1,x2,x3 >= 0

solution
Min Z -x1 +2x2 – x3 -MR1 = 0
Subject to:
1) x1 +x2 –x3 -s1+R1 = 4
2) x1 -4x2 +x3 +s2=2
3) x1,x2,x3,s1,s2,R1 >=0

Basic X1 X2 X3 S1 S2 R1 RHS
Sol -1 2 -1 0 0 -M 0
Obj Fun
R1 1 1 -1 -1 0 1 4
S2 1 -4 1 0 1 0 2

Multiply rows R1 by M and add to first row (Obj. Function line ).

Basic X1 X2 X3 S1 S2 R1 RHS
Sol M-1 M+2 -M-1 -M 0 0 4M
Obj Fun
R1 1 1 -1 -1 0 1 4
S2 1 -4 1 0 1 0 2

4/1=4 ,2/-4=-0.5
Basic X1 X2 X3 S1 S2 R1 RHS
Sol -3 0 1 2 0 -M-2 -8
Obj Fun
X2 1 1 -1 -1 0 1 4
S2 5 0 -3 -4 1 4 18

4/-1=-4 , 18/-4=-4.5

Basic X1 X2 X3 S1 S2 R1 RHS
Sol -1 2 -1 0 0 -M 0
Obj Fun
X2 -1 -1 1 1 0 -1 -4
S2 1 -4 1 0 1 0 2

-4/-1=4 , 2/-4=-0.5
Error:
The system has no solutions or has many solutions

You might also like