+ All Categories
Home > Science > Linear Programming - Simplex Algorithm by Yunus Hatipoglu

Linear Programming - Simplex Algorithm by Yunus Hatipoglu

Date post: 22-Jan-2018
Category:
Upload: yunus-hatipoglu
View: 61 times
Download: 1 times
Share this document with a friend
20
07 December, 2017 Simplex Algorithm 1 Linear Programming Simplex Algorithm Yunus Hatipoğlu 201671209 Çankaya University CENG511 Advanced Algorithm
Transcript
Page 1: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 Simplex Algorithm 1

Linear Programming

Simplex Algorithm

Yunus Hatipoğlu

201671209

Çankaya University

CENG511 – Advanced Algorithm

Page 2: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 2

Content

• Linear Programming– what is that?

• The Simplex Algorithm – background

• Usage Areas in real life

• How it works (Pseudo)

• Example Question – Maximize

Page 3: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 3

Linear Programming– what is

that?A technique to achieve optimal distribution of resources, minimize costs and maximize profits.

Page 4: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 4

The Simplex Algorithm

• based on algebraic iteration.

• the initial simplex table is edited

• then the operations are continued until it reaches the optimal solution

Page 5: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 5

The Simplex Algorithm

• Simplex algorithm visits all 2n vertices in worst case and this turns out to be true for and deterministic pivot rule.

• Pivot rule takes exponential time in worst case.

• The performance of simplex algorithm depend on the specific pivot rule used.

Page 6: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 6

Usage Areas in real life

• limited use of resources (capacity, raw material, labor force, etc.) and maximizing profits or minimizing costs.

Determination of optimum

production schedule:

Page 7: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 7

Usage Areas in real life

• tries to ensure optimum application in determining the sales, storage or purchases of the warehouse capacity determined within a certain time to maximize profits (or minimize costs).

Storage problems:

Page 8: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 8

How it works?

Page 9: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 9

Maximize & Minimize

• Subjected to constraints :

• 0<= ax + by + cz + ... <= P1

• 0<= dx + ey + fz + ... <= P2

• ...

To maximize:

To minimize:

f = c1x+c2y+c3z ...We maximize

g = -f = -(c1x+c2y+c3z ...)

Page 10: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 10

Example Question

• Constraints:

2x1 + x2 <= 14

5x1 + 5x2 <=40

x1 + 3x2 <= 18

Maximize the following

n= 50x1 + 30x2

x1, x2 >= 0

Page 11: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 11

Example Question(Cont.)

• 1. Create simplex table

– transform them into equations by adding increasing variables to the inequalities

2x1 + x2 + s1 = 14

5x1 + 5x2+ s2 = 40

x1 + 3x2 + s3 = 18

Maximize the following

n= 50x1 + 30x2

Page 12: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 12

Example Question(Cont.)

– Write constraint equations in matrix form

2 1 1 0 0

5 5 0 1 0 =

1 3 0 0 1

Maximize the following

n= 50x1 + 30x2

x1

x2

s1

s2

s3

14

40

18

Page 13: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 13

Example Question(Cont.)

x1 x2 s1 s2 s3

2 1 1 0 0 14

5 5 0 1 0 40

1 3 0 0 1 18

-50 -30 0 0 0 0

having the greatest absolute value of negative value

indicates pivot column --> -50

Fixed values are divided

to pivot line and minimum

value determines pivot

line

14/2 = 7 which is minumum

40/5 = 8

18/1 = 18

So 2 is pivot line

Page 14: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 14

Example Question(Cont.)

x1 x2 s1 s2 s3

2 1 1 0 0 14

5 5 0 1 0 40

1 3 0 0 1 18

-50 -30 0 0 0 0

multiply the first line by 1/2 and make the pivot line 1

x1 x2 s1 s2 s3

1 1/2 1/2 0 0 7

5 5 0 1 0 40

1 3 0 0 1 18

-50 -30 0 0 0 0

Page 15: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 15

Example Question(Cont.)

• Multiply the first line by 5 and subtract from the

second line

• Substract first line from 3. line

• First line multiplied by 50 and added to forth line

• Clean pivot column.

x1 x2 s1 s2 s3

1 1/2 1/2 0 0 7

0 5/2 -5/2 1 0 5

0 5/2 -1/2 0 1 11

0 -5 25 0 0 350

x1 x2 s1 s2 s3

1 1/2 1/2 0 0 7

5 5 0 1 0 40

1 3 0 0 1 18

-50 -30 0 0 0 0

Page 16: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 16

Example Question(Cont.)• Change basis and repeat pivotting.

• Second column pivot

• Second line pivot line

x1 x2 s1 s2 s3

1 1/2 1/2 0 0 7

0 5/2 -5/2 1 0 5

0 5/2 -1/2 0 1 11

0 -5 25 0 0 350

7 / 1/2 = 14

5 / 5/2 = 2

11 / 5/2 = 4.4

So pivot element is 5/2 which is

in second line

Page 17: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 17

Example Question(Cont.)

multiply the second line by 2/5 and make the pivot

line 1

x1 x2 s1 s2 s3

1 1/2 1/2 0 0 7

0 1 -1 2/5 0 2

0 5/2 -1.2 0 1 11

0 -5 25 0 0 350

x1 x2 s1 s2 s3

1 1/2 1/2 0 0 7

0 5/2 -5/2 1 0 5

0 5/2 -1/2 0 1 11

0 -5 25 0 0 350

Page 18: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 18

Example Question(Cont.)

• Multiply the second line by 1/2 and subtract from

the first line

• Multiply the second line by 5/2 and subtract from

third line

• Second line is multiplied by 5 and added to forth

line

x1 x2 s1 s2 s3

1 0 1 -1/5 0 6

0 1 -1 2/5 0 2

0 0 2 -1 1 6

0 0 20 2 0 360

x1 x2 s1 s2 s3

1 1/2 1/2 0 0 7

0 1 -1 2/5 0 2

0 5/2 -1/2 0 1 11

0 -5 25 0 0 350

Page 19: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 19

Example Question(Cont.)

• Since there are no negative indicators left, this is

the last table

x1 x2 s1 s2 s3

1 0 1 -1/5 0 6

0 1 -1 2/5 0 2

0 0 2 -1 1 6

0 0 20 2 0 360

x1 = 6

x2 = 2

s3 = 6

n = 360

Page 20: Linear Programming - Simplex Algorithm by Yunus Hatipoglu

07 December, 2017 The Simplex Algorithm 20

Question

• What is worst case complexity of Simplex Algorithm

and what kind of areas complexity algorithm can be

used?


Recommended