Download presentation

Presentation is loading. Please wait.

Published byCollin Horlick Modified about 1 year ago

1
1 Convert this problem into our standard form: Minimize 3 x x 2 – 6 x 3 subject to 1 x x 2 – 3 x 3 ≥ x x 2 – 6 x 3 ≤ 5 7 x x 2 – 9 x 3 = -3 x 2, x 3 ≥ 0 How would this problem be input to your program?

2
Interested in meeting other people in your faculty from all different stages in their academic careers? Come join other eager students to make connections and discuss the involvement of women in Computer Science and Engineering. Or just come for cookies and tea! : Where: ECS 660 When: 2:30pm on Friday, September 14 Who: Everyone welcome! 2

3
3 Because the b column is special and the z row is special, I chose to place them in column 0 and row 0 in my matrix for the Simplex algorithm. If you do this, the second phase of the project will probably be a little bit easier to implement.

4
4 public class Repeat_Add public static void main(String [ ] args) { int i, next_print; float x, y; double error; x= 1.0f / 3; // x= 1/3 y=0; next_print=3;

5
5 for (i=1; i <= ; i++) { y= y+x; error= y- (double) i / 3 ; if (i == next_print) { System.out.println(y + " should be " + (i/3) + " Error = " + error); next_print= next_print * 10; }

6
6 Errors resulting from repeatedly adding 1/3 (edited to make this more readable). 1.0 should be 1 Error = should be 10 Error = E should be 100 Error = E should be 1000 Error = should be Error = should be Error = should be Error = The “error” would be zero if the mathematics was 100% precise. But it is not due to floating point errors. This is why we compare values to some small epsilon instead of zero to test if they are zero or not.

7
7 LP problems can be: 1. infeasible, 2. unbounded, or 3. they have at least one basic (corresponding to a dictionary) optimal solution.

8
8 Another sample problem: Maximize 5 x x x 3 subject to x x 2 + x 3 ≤ 3 -x x 3 ≤ 2 2 x 1 - x x 3 ≤ 4 2 x x 2 - x 3 ≤ 2 x 1, x 2, x 3 ≥ 0

9
9 The initial dictionary: X4 = X X X3 X5 = X X X3 X6 = X X X3 X7 = X X X z = X X X3 The program output will be in dictionary format.

10
10 X1 enters. X7 leaves. z = After 1 pivot: X4 = X X X7 X5 = X X X7 X6 = X X X7 X1 = X X X z = X X X7

11
11 X3 enters. X6 leaves. z = After 2 pivots: X4 = X X X7 X5 = X X X7 X3 = X X X7 X1 = X X X z = X X X7

12
12 X2 enters. X5 leaves. z = After 3 pivots: X4 = X X X7 X2 = X X X7 X3 = X X X7 X1 = X X X z = X X X7 How could we argue that this must be the optimal solution?

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google