Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Operations Research

Similar presentations


Presentation on theme: "Introduction to Operations Research"— Presentation transcript:

1 Introduction to Operations Research
Integer Programming

2 Integer Programming Linear Programming makes the assumption that all variables can take on non-integer values However, in certain cases, the variables make sense only when they are restricted to integer values Assignment of people, machines, and vehicles to activities Pure Integer Programming – All variables are restricted to integer values Mixed Integer Programming – Only some variables are restricted to integer values Binary Integer Programming – All variables are restricted to values of 0 and 1 Use binary variables to answer yes/no questions

3 Discrete Variables There are many situations where we need solutions to problems which are not allowed to fall in a continuous range Capital budgeting Site selections for factories/warehouses Distribution Network Dispatching shipments Scheduling Activities Investment portfolio

4 Design Problem In designing a network, we need to decide whether to place a link between two particular nodes In this case a decision is either “yes” or “no” We could represent this as a variable which had only two possible values, 0 or 1

5 Distribution Select a route (sequence of customers) to transport shipments Should a certain route be selected? Represent with a logical variable (1 if yes, 0 otherwise) The cost of using a specific route could include a “set-up” cost which would not be paid if the route was not used at all

6 Modular Equipment Equipment, such as switches, have to be bought with traffic capacity consideration A switch could have capacity equal to 100, 200,…400 Gbps, but it might be impossible to purchase anything between these numbers

7 No Separate Method No separate technique has been developed to solve this type of problem The best solutions adapt the techniques of linear programming and look for discrete solutions in the vicinity of the continuous solution

8 Variable Integer program
Maximize: x + 4y Subject to: 5x + 8y  24 x, y  0 and x, y are integers What is the optimal solution?

9 The Feasible Region Question: What is the optimal integer solution?
Question: What is the optimal integer solution? What is the optimal linear solution? Can one use linear programming to solve the integer program?

10 Solution Solve LP (ignore integrality) get x=24/5, y=0 and z =14 2/5.
Solve LP (ignore integrality) get x=24/5, y=0 and z =14 2/5. Round, get x=5, y=0, infeasible! Truncate, get x=4, y=0, and z =12 Same solution value at x=0, y=3. Optimal is x=3, y=1, and z =13

11 Why integer programs? Advantages of restricting variables to take on integer values More realistic More flexibility Disadvantages More difficult to model

12 Branch and Bound The most popular and successful method of obtaining discrete solutions today is called “branch and bound” This method relies on our being able to solve a LP problem by the simplex method

13 Branch and Bound The first step is to solve the problem as a LP problem, using the simplex method This will, in general produce solutions with variables in a continuous range We take one of these variables and constrain it to take the allowed value below its current one

14 Branch and Bound This defines a new problem which can also be solved by the simplex method However, it is also possible that the allowed value above the LP solution gives a better cost function Therefore we should also try this constraint

15 Example Maximize Z = x1+x2 subject to: x1 + 3x2 ≤ 3 3x1 + x2 ≤ 6
x1, x2 integers ≥ 0

16 Example The optimal solution to the LP problem is x1 = 1.875
Z = 2.25 We will choose x2 to constrain x2 can be either 0 or 1 Let’s start with x2 = 0

17 Example The new solution is x1 = 2 x2 = 0 Z = 2
Now let’s try solving with constraint x2 = 1

18 Example The new solution is x1 = 0 x2 = 1 Z = 1
Both of these solutions have given us integral values of x1 We choose the first solution because it has a higher Z

19 Branching Tree We do not need to explore any more values in the region
We can illustrate what we have just done with a “branching tree” x1 = x2 = z = 2.25 x2 = 1 x2 = 0 x1 = 0 x2 = 1 z = 1 x1 = 2 x2 = 0 z = 2 Best Solution

20 More Branching In general we are not able to find suitable solutions after so few trials The procedure may need to proceed through several branches We now consider a more complicated example

21 Example 2 Maximize Z = 4x1 + 6x2 + 10x3 subject to 2x1 + x2 + 2x3 ≤ 13
x1, x2, x3 are integers ≥ 0 We will branch left (down) on the non-integer with the lowest subscript

22 x1 = 45/7, x2 = 34/7, x3 = 0, z1 = 402/7 n1 x1 = 4 x1 = 5 x1 = 4, x2 = 21/2, x3 = 0, z2 = 31 n2 x2 ≥ 3 x2 = 2 x1 = 4, x2 = 2, x3 = 1/4, z3 = 301/2 n3 x3 = 0 x3 ≥ 1 x1 = 4, x2 = 2, x3 = 0, z4 = 28 n4

23 Moving down the Tree In this tree, node n1 is the LP solution, and represents an upper bound on the objective function As we move through nodes n2, n3 and n4, we add more and more constraints on the variables Notice that as we move down, Z never increases Why?

24 Bound Node n4 is the first node we have found with all integer variables Therefore, 28 is a lower bound on the solution When we reach such a solution, we have reached a “bound” in the branch and bound technique

25 Other Branches We have not yet explored all the possibilities near the LP solution We now backtrack and explore some of the possibilities in the right hand branches The next slide shows some of the results

26 x1 = 45/7, x2 = 34/7, x3 = 0, z1 = 402/7 n1 x1 = 4 x1 = 5 x1 = 4, x2 = 21/2, x3 = 0, z2 = 31 x1 = 5, x2 = 3, x3 = 0, z5 = 38 n2 n5 x2 = 3 x2 = 2 x1 = 4, x2 = 2, x3 = 1/4, z3 = 301/2 n6 No feasible solution n3 x3 = 0 x3 = 1 x1 = 4, x2 = 2, x3 = 0, z4 = 28 x1 = 4, x2 = 1/2, x3 = 1, z7 = 29 n4 n7

27 Further Branching Node n5 has an all-integer solution, so we do not branch any further from this node Node n6 does not have any feasible solutions: so no further branches Node n7 does allow further branches

28 Fathoming Notice that z5 = 38, and z7 = 29
If we had evaluated node n5 before n7, we need not have proceeded any further, since it would be impossible for z7 to be more than z3, which is 301/2 This is called “fathoming”

29 Binary Tree The structure of solutions is called a “binary tree”. Every node in the tree represents a problem which must be solved by the simplex method To reduce computing time, we try to keep the number of nodes in the tree as small as possible

30 Depth First Strategy The “depth first” strategy takes the left hand branch until the tree can be “pruned” Then it backtracks to the last node where it could take another branch (to the right) Then it continues with left branches

31 Breadth First Strategy
The “breadth first” strategy evaluates all nodes at level 2 before going to examine all nodes at level 3 and so on On the average, it has been found that “depth first” strategies are faster than “breadth first” strategies

32 Branch-and-Bound Technique
Branch-and-bound technique is a divide-and-conquer method Large problem is divided into smaller and smaller non-overlapping sub-problems until the sub-problems can be conquered Dividing (Branching) – Partition the entire set of feasible solutions into smaller and smaller subsets Conquering (Fathoming) – Done by bounding how good the best solution in the subset can be and then discarding the subset if its bound indicates it can’t contain an optimal solution to the original problem

33 The game of fiver Click on a circle, and flip its color and that of adjacent colors. Can you make all of the circles red?

34 The game of fiver

35 The game of fiver

36 The game of fiver Let’s write an optimization problem whose solution solves the problem in the fewest moves.

37 Optimizing the game of fiver
1 2 3 4 5 Let x(i,j) = 1 if I click on the square in row i and column j. x(i,j) = 0 otherwise. 1 2 Focus on the element in row 3, and column 2. To turn it red, we require that x(2,2) + x(3,1) + x(3,2) + x(3,3) + x(4,2) is odd 3 4 5

38 Optimizing the game of fiver
(i, j) to be red for i = 1 to 5 and for j = 1 to 5 We want to minimize the number of moves. Minimize Si,j=1 to 5 x(i,j) Subject to x(i, j) + x(i, j-1) + x(i, j+1) + x(i-1, j) + x(i+1, j) - 2y(i,j) = 1 for i = 1 to 5, j = 1 to 5 x(i, j) is 0 or 1 for i = 1 to 5 and j = 1 to 5 y(i,j) is integral x(i, j) = 0 otherwise. This is an integer program.

39 Should I give away the solution?

40 Stockco example Stockco is considering 6 investments. The cash required from each investment as well as the NPV of the investment is given next. The cash available for the investments is $14,000. Stockco wants to maximize its NPV. What is the optimal strategy? An investment can be selected or not. One cannot select a fraction of an investment.

41 Fire Station Problem Locate fire stations so that each district has a fire station in it, or next to it. 1 2 3 5 6 7 Minimize the number of fire stations needed. 4 8 9 11 12 13 10 14 15 16


Download ppt "Introduction to Operations Research"

Similar presentations


Ads by Google