Presentation is loading. Please wait.

Presentation is loading. Please wait.

Studi Kasus PL dgn Simpleks Pertemuan 4: Mata kuliah:K0164-Pemrograman Matematika Tahun: 2008.

Similar presentations


Presentation on theme: "Studi Kasus PL dgn Simpleks Pertemuan 4: Mata kuliah:K0164-Pemrograman Matematika Tahun: 2008."— Presentation transcript:

1

2 Studi Kasus PL dgn Simpleks Pertemuan 4: Mata kuliah:K0164-Pemrograman Matematika Tahun: 2008

3 Learning Outcomes Mahasiswa dapat menghitung solusi masalah/kasus model PL dengan menggunakan metode Simpleks..

4 Outline Materi: Pemecahan studi kasus PL dengan metode Simpleks. Studi kasus Maksimisasi Studi kasus Minimisasi. Pembahasan..

5 Standard form: Maximize 5x 1 + 4x 2 + 3x 3 Subject to 2x 1 + 3x 2 + x 3  5 4x 1 + x 2 + 2x 3  11 3x 1 + 4x 2 + 2x 3  8 x 1, x 2, x 3  0.

6 Slack form: we add “slack” variables Maximize 5x 1 + 4x 2 + 3x 3 Subject to 2x 1 + 3x 2 + x 3 + x 4 = 5 4x 1 + x 2 + 2x 3 + x 5 = 11 3x 1 + 4x 2 + 2x 3 + x 6 = 8 x 1, x 2, x 3, x 4, x 5, x 6  0. In slack form all constraints are of equality except the non-negativity constraints.

7 Basic and nonbasic variables. Basic solution. The basic variables are the ones on the left (in red). The nonbasic variables are the rest. The basic solution is produced by setting all nonbasic variables to 0: x 1 =x 2 =x 3 =0. we get x 4 =5, x 5 =11, x 6 =8, z=0. z = 5x 1 + 4x 2 + 3x 3 x 4 = 5 - 2x 1 - 3x 2 - x 3 x 5 = 11 - 4x 1 - x 2 - 2x 3 x 6 = 8 - 3x 1 - 4x 2 - 2x 3

8 The idea: Choose a nonbasic variable such that increasing it will increase the basic solution. Increase it until one of the basic variables becomes 0. This step is called "pivot".

9 1 st Iteration We want to increase the value of z from its current value of 0. Clearly, increasing the value of x 1 will increase the value of z. By how much can we increase it? z = 5x 1 + 4x 2 + 3x 3 x 4 = 5 - 2x 1 - 3x 2 - x 3 x 5 = 11 - 4x 1 - x 2 - 2x 3 x 6 = 8 - 3x 1 - 4x 2 - 2x 3 x 4  0  5 – 2x 1  0  5  2x 1  x 1  5/2 x 5  0  11 – 4x 1  0  11  4x 1  x 1  11/4 x 6  0  8 – 3x 1  0  8  3x 1  x 1  8/3

10 1 st Iteration We want to increase the value of z from its current value of 0. Clearly, increasing the value of x 1 will increase the value of z. By how much can we increase it? z = 5x 1 + 4x 2 + 3x 3 x 4 = 5 - 2x 1 - 3x 2 - x 3 x 5 = 11 - 4x 1 - x 2 - 2x 3 x 6 = 8 - 3x 1 - 4x 2 - 2x 3 x 4  0  5 – 2x 1  0  5  2x 1  x 1  5/2 x 5  0  11 – 4x 1  0  11  4x 1  x 1  11/4 x 6  0  8 – 3x 1  0  8  3x 1  x 1  8/3 “entering variable”  “leaving variable” 

11 X1’s row: x 4 = 5 - 2x 1 - 3x 2 - x 3  x 1 = (5 - 3x 2 - x 3 - x 4 )/2 = x 1 = 5/2 - 3/2x 2 - 1/2x 3 - 1/2x 4 The other rows (substitute X1): x 5 = 11 - 4x 1 - x 2 - 2x 3 x 5 = 11- 4(5/2 - 3/2x 2 - 1/2x 3 - 1/2x 4 ) - x 2 - 2x 3 x 5 = 1 + 5x 2 +2x 4 x 6 = ….

12 2 nd Iteration Now we see that increasing the value of x 3 will improve the value of z. z = 25/2 - 7/2x 2 + 1/2x 3 - 1/2x 4 x 1 = 5/2 - 3/2x 2 - 1/2x 3 - 1/2x 4 x 5 = 1 + 5x 2 + 2x 4 x 6 = 1/2 + 1/2x 2 - 1/2x 3 + 3/2x 4 x 1  0  5/2 – 1/2x 3  0  5/2  1/2x 3  x 3  5 x 5  0  x 3 unbounded x 6  0  1/2 – 1/2x 3  0  1/2  1/2x 3  x 1  1

13 z = 13 - 3x 2 - x 4 - x 6 x 1 = 2 - 2x 2 - 2x 4 + x 6 x 5 = 1 + 5x 2 + 2x 4 x 3 = 1 + x 2 + 3x 4 - 2x 6 Optimal!!! The solution: x 1 = 2, x 2 = 0, x 3 = 1 x 4 = 0, x 5 = 1, x 6 = 0. z = 13.

14 The algorithm: Assume we have a procedure “Init-Simplex” that takes a LP in standard form and returns a LP in slack form with basic feasible solution, or a message “infeasable”. Notation: n Maximize  c i x i i=1 Subject to n  a ij x j  b i, 1  i  m j=1 x j  0, 1  j  n

15 Maximize- x 0 Subject to n  a ij x j – x 0  b i, 1  i  m j=1 x j  0, 0  j  n let Laux be the following program n Maximize  c i x i i=1 Subject to n  a ij x j  b i, 1  i  m j=1 x j  0, 1  j  n Note: 1.The objective function does not affect the feasibility of the program. 2.If x 1, …, x n is a feasable solution to L then x 0 =0, x 1, …, x n is a feasable solution to Laux, and it’s optimal since we have x 0  0. 3. If x 0 =0, x 1, …, x n is the optimal solution to Laux then x 1, …, x n is a feasable solution to L.

16 Maximize- x 0 Subject to n  a ij x j – x 0  b i, 1  i  m j=1 x j  0, 0  j  n Maximize- x 0 Subject to n x n+i = b i –  a ij x j + x 0, 1  i  m j=1 x j  0, 0  j  n+m Denote by b l the minimal b i for 1  i  m. By choosing x 0 as the entering variable and x l as the leaving variable we get a basic feasable solution: We get: n x n+l = b l –  a ij x j + x 0 j=1 n x 0 = -b l +  a ij x j + x n+l, 1  i  m j=1 Now for each other row x i we get after subtituting x 0 that b i ‘= b i + x 0  0 because b l was minimal Transformed to slack form:

17 1.The original program: Maximize 2x 1 - x 2 Subject to 2x 1 - x 2  2 x 1 - 5x 2  -4 x 1, x 2  0. Finding the initial feasable solution: an example 2.The auxiliary program: Maximize - x 0 Subject to 2x 1 - x 2 - x 0  2 x 1 - 5x 2 - x 0  -4 x 1, x 2, x 0  0.

18 3.In slack form (basic solution not feasable!): z = - x 0 x 3 = 2 - 2x 1 + x 2 + x 0 x 4 = -4 - x 1 + 5x 2 + x 0 4.Pivoting. Minimal ( x 4 ) is leaving, x 0 is entering: x 4 = -4 - x 1 + 5x 2 + x 0  x 0 = 4 + x 1 - 5x 2 + x 4 x 3 = 2 - 2x 1 + x 2 + x 0 x 3 = 2 - 2x 1 + x 2 + 4 + x 1 - 5x 2 + x 4 = 4 + …..

19 3.In slack form (basic solution not feasible!): z = - x 0 x 3 = 2 - 2x 1 + x 2 + x 0 x 4 = -4 - x 1 + 5x 2 + x 0 4.Pivoting. Minimal ( x 4 ) is leaving, x 0 is entering: x 4 = -4 - x 1 + 5x 2 + x 0  x 0 = 4 + x 1 - 5x 2 + x 4 x 3 = 2 - 2x 1 + x 2 + x 0 x 3 = 2 - 2x 1 + x 2 + 4 + x 1 - 5x 2 + x 4 = 4 + ….. Now that we have slack form with the basic solution feasible we can call Simplex!

20 The primal problem (1): n Maximize  c j x j j=1 Subject to n  a ij x j  b i, 1  i  m j=1 x j  0, 1  j  n The dual problem (2): m Minimize  b j y j j=1 Subject to m  a ij y j  c i, 1  j  n i=1 y j  0, 1  i  m Maximize 5x 1 + 4x 2 + 3x 3 Subject to 2x 1 + 3x 2 + x 3  6 4x 1 + x 2 + 2x 3  11 x 1, x 2, x 3  0. Minimize 6y 1 + 11y 2 Subject to 2y 1 + 4y 2  5 3y 1 + y 2  4 y 1 + 2y 2  3 y 1, y 2  0.

21


Download ppt "Studi Kasus PL dgn Simpleks Pertemuan 4: Mata kuliah:K0164-Pemrograman Matematika Tahun: 2008."

Similar presentations


Ads by Google