e1605 simplex algorithm

Upload: davidmine

Post on 03-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 E1605 Simplex Algorithm

    1/11

    Simplex Algorithm

    Solving linear programming

    problems algebraically

  • 7/28/2019 E1605 Simplex Algorithm

    2/11

    Initial Example: Maximise P = 10x + 12y

    subject to the constraints:

    x + y 40 (i)

    x + 2y 75 (ii)

    x 0, y 0.Step 1: Introduce slack variables to convert the

    non-trivial inequalities into equalities:

    Equation (i): x + y + s = 40 s 0Equation (ii): x + 2y + t = 75 t 0

    s, t are slack variables.

  • 7/28/2019 E1605 Simplex Algorithm

    3/11

    Step 2: Rewrite the objective function so

    that the RHS is a number:

    P = 10x + 12y P 10x 12y = 0.

    Step 3: Write the objective function and the

    non-trivial constraints in tableau format:

  • 7/28/2019 E1605 Simplex Algorithm

    4/11

    Tableau Format

    P x y s t l Equationobjective 1 -10 -12 0 0 0 (1)

    0 1 1 1 0 40 (2)constraints

    0 1 2 0 1 75 (3)

    Last

    column

    The shaded

    cells shouldbe non-

    negative

    The aim is to solve the equations by combining rows

    together. The solution is reached when all entries in the

    first row (except possibly the value in the last column)

    are non-negative.

    We begin by identifying the most negative entry in the

    objective function row, here -12 in the y column.

    P-10x-12y=0

    x+y+s=40x+2y+t=75 Piv

    otal column

  • 7/28/2019 E1605 Simplex Algorithm

    5/11

    P x y s t l Equation Ratio1 -10 -12 0 0 0 (1) 0/-12=0

    0 1 1 1 0 40 (2) 40/1=40

    0 1 0 1 75 (3) 75/2=37.52

    pivot

    Pivotal

    column

    We highlight the pivotal column.

    We then divide every entry in the l column by the corresponding

    value in the highlighted column.Pick the least positive of these. This is the pivotal row.

  • 7/28/2019 E1605 Simplex Algorithm

    6/11

    P x y s t l Equation Ratio1 -10 -12 0 0 0 (1) 0/-12=0

    0 1 1 1 0 40 (2) 40/1=40

    0 1 0 1 75 (3) 75/2=37.52

    Divide the pivotal row by the pivot value.

    P x y s t l Equation Ratio1 -4 0 0 6 450 (4)=(1)+12(6) 450/-4=-112.5

    0 0 0 - 2.5 (5) = (2) (6) 2.5/0.5 = 5

    0 1 0 37.5 (6) = (3)/2 37.5/0.5 = 75

    The aim is to now get 0 entries elsewhere in the pivotal column.

    We now repeat the process, first selecting the new pivotal column,

    i.e. the one with the most negative value in the objective function

    row.

  • 7/28/2019 E1605 Simplex Algorithm

    7/11

    P x y s t l Equation Ratio1 -4 0 0 6 450 (4)=(1)+12(6) 450/-4=-112.5

    0 0 0 - 2.5 (5) = (2)

    (6) 2.5/0.5 = 50 1 0 37.5 (6) = (3)/2 37.5/0.5 = 75

    Having identified the pivotal row and the pivot value, we now

    divide every entry in the pivotal row by the pivot value.

    P x y s t l Equation1 0 0 0 2 470 (7)=(4)+4(8)

    0 1 0 0 -1 5 (8) = (5) 0 0 1 0 1 35 (9) = (6)(8)

    The process is now finished as every entry on the objective

    function row is non-negative.

  • 7/28/2019 E1605 Simplex Algorithm

    8/11

    P x y s t l Equation1 0 0 0 2 470 (7)

    0 1 0 0 -1 5 (8)

    0 0 1 0 1 35 (9)

    The values of x, y and P can be read from

    the table:

    x = 5, y = 35, P = 470. This is the

    optimal solution.

  • 7/28/2019 E1605 Simplex Algorithm

    9/11

    Interpretation

  • 7/28/2019 E1605 Simplex Algorithm

    10/11

    Examination Question

    A clocksmith makes 3 types of luxury watches. The mechanism for

    each watch is assembled by hand by a skilled watchmaker andthen the complete watch is formed, weatherproofed and

    packaged for sale by a fitter.

    The table below shows the times (in mins) for each stage of the

    process. It also gives the profits to be made on each watch.

    Watch type Watchmaker Fitter Profit ()

    A 54 60 12

    B 72 36 24

    C 36 48 20

    The watchmaker works for a maximum of 30 hours per week; the fitter

    for 25 hours per week.

    Let x, y, z represent the number of type A, B, C watches to be made

    (respectively).

  • 7/28/2019 E1605 Simplex Algorithm

    11/11

    Setting up the problem

    Profit function: P =

    Constraint 1:

    Constraint 2:

    Watch type Watchmaker Fitter Profit ()A 54 60 12

    B 72 36 24

    C 36 48 20