advertisement

Integer Programming - When all variables are requited to be integers, then we have a pure integer programming problem (IP). - When some of the variables are requited to be integers, then we have a mixed integer programming problem (MIP). - An integer programming problem in which all the variables must equal 0 or 1 is called a 0-1 IP ot Binary IP. The concept of LP relaxation of an IP problem plays a key role in the solution of IP’s. Definition: The LP obtained by omitting all integer or 0 – 1 constraints on variables is called the LP relaxation of the IP. e.g. IP Max Z = 3x1 + 2x2 s.t. x1 + x2 ≤ 6 → x1, x2 ≥ 0 x1, x2 integer Max Z = 3x1 + 2x2 s.t. x1 + x2 ≤ 6 x1, x2 ≥ 0 LP relaxation An IP may be viewed as the LP relaxation plus additional constraints (e.g. integer values). Hence, the feasible region for any IP must be contained in the feasible region for the corresponding LP relaxation. For any IP that is a max. problem implies that, Optimal Z-value for LP relaxation ≥ Optimal Z-value for IP. Many practical solutions can be formulated as IP’s (see section 9.2 on p.477 in text book). Examples: Capital budgeting (choosing among investments), fixed charge problem (cost related to activity, not on level of activity), credit card processing operations, facility locations, etc. The following are some examples. Formulating IPs (Examples are from Winston or based on Winston) Capital Budgeting Example Suppose we wish to invest $14 000. We have identified four investment opportunities. Investment 1 requires an investment of $5 000 and has a n e t present value (NPV) of $16 000; investment 2 requires $7,000 and has a NPV of $22 000; investment 3 requires $4 000 and has a N P V of $12 000; and investment 4 requires $3 000 and has a N P V of $8 000. Into which investments should we place our money so as to maximize our total NPV? As in LP, we begin by defining a variable for each decision. In this case, we use a 0-1 variable xj for each investment. If xj is 1 then we will make investment j. If it is 0, we will not make the investment. Then, the problem is, Max Z = 16 x1 + 22x2 + 12x3 + 8x4 s.t 5x1 +7x2 + 4x3 + 3x4 < 14 xj = 0 or 1 (j = 1, 2, 3, 4) Note: The optimal solution to above is x1 = 0, x2 = x3 = x4 = 1, Z = $42 000. Investment 1, even though it yields a higher NPV per dollar, is not chosen because investing in 1 would 1 only allow $12 000 to be invested whereas the optimum choices allow all $14 000 to be invested). Capital Budgeting (Continued) There are a number of additional constraints we might want to add. Logical restrictions can be enforced using 0-1 variables. For instance, consider the following requirements: We can only invest in at most two investments – simply add the constraint, x1 + x2 + x3 + x4 ≤ 2 If we invest in 2,must also invest in investment 1 – we add the constraint, x2 < x1 or x2 – x1 < 0 If x2 is 1, then x1 is also 1 as required; if x2 is 0, then there is no restriction for x1 (x1 is 0 or 1) If investment 2 is made, can not invest in 4 – add the constraint, x2 + x4 < 1 If x2 is 1, then x4 is 0 as required; if x2 is 0, then there is no restriction for x4 (x3 is 0 or 1) Fixed Charge Problems This example illustrates an important trick can be used to formulate many production and location problems as IPs. Gandhi Cloth Company is capable of manufacturing three types of clothing: shirts, shorts, and pants. The manufacture of each type of clothing requires that Gandhi have the ap- propriate type of machinery available. The machinery needed to manufacture each type of clothing must be rented at the following rates: shirt machinery, $200 per week; shorts machinery, $150 per week; pants machinery, $100 per week. The manufacture of each type of clothing also requires the amounts of cloth and labor shown in Table 2. Each week, 150 hours of labor and 160 sq yd of cloth are available. The variable unit cost and sell- ing price for each type of clothing are shown in Table 3. Formulate an IP whose solution will maximize Gandhi’s weekly profits. As in LP formulations, we define a decision variable for each decision that Gandhi must make. We define, x1 = number of shirts produced each week x2 = number of shorts produced each week x3 = number of pants produced each week Resource Requirements for Gandhi Revenue and Cost Information for Gandhi Clothing Type Shirt Shorts Pants Clothing Type Shirt Shorts Pants Labour (Hours) 3 2 6 Cloth (Sq Yards) 4 3 4 Sales Price ($) 12 8 15 Variable Cost ($) 6 4 8 Note that the cost of renting machinery depends only on the types of clothing produced, not 2 on the amount of each type of clothing. This enables us to express the cost of renting machinery by using the following variables: y1 = 1 if any shirts are manufactured, y1 = 0 otherwise y2 = 1 if any shorts are manufactured, y2 = 0 otherwise y3 = 1 if any pants are manufactured, y3 = 0 otherwise In short, if xj > 0, then yj = 1, and if xj = 0, then yj = 0. Thus, Gandhi’s weekly profits = (weekly sales revenue) - weekly variable costs) - (weekly costs of renting machinery). Also, weekly cost of renting machinery = 200y1 + 150y2 + 100y3 (A) To justify (A), note that it picks up the rental costs only for the machines needed to manufacture those products that Gandhi is actually manufacturing. For example, suppose that shirts and pants are manufactured. Then y1 = y3 = 1 and y2 = 0, and the total weekly rental cost will be (200 + 100) = $300. Because the cost of renting, say, shirt machinery does not depend on the number of shirts produced, the cost of renting each type of machinery is called a fixed charge. A fixed charge for an activity is a cost that is assessed whenever the activity is undertaken at a nonzero level. The presence of fixed charges will make the formulation of the Gandhi problem much more difficult. Gandhi’s weekly profits will be, Weekly profit = (12x1 + 8x2 + 15x3) - (6x1 + 4x2 + 8x3) - (200y1 + 150y2 + 100y3) = 6x1 + 4x2 + 7x3 - 200y1 - 150y2 - 100y3 Thus, Gandhi wants to maximize z = 6x1 + 4x2 + 7x3 - 200y1 - 150y2 - 100y3 Because its supply of labor and cloth is limited, Gandhi faces the following two constraints: Constraint 1: At most, 150 hours of labor can be used each week. Constraint 2: At most, 160 sq yd of cloth can be used each week. Then, 3x1 + 2x2 + 6x3 ≤ 150 4x1 + 3x2 + 4x3 ≤ 160 (Labor constraint) (Cloth constraint) (IP1) Combining above, Max s.t. s.t. z = 6x1 + 4x2 + 7x3 - 200y1 - 150y2 - 100y3 3x1 + 2x2 + 6x3 ≤ 150 4x1 + 3x2 + 4x3 ≤ 160 x1, x2, x3 ≥ 0; x1, x2, x3 integer 3x1 y1, y2, y3 = 0 or 1 The optimal solution to this problem is found to be x1 = 30, x3 = 10, x2 = y1 = y2 = y3 = 0. This cannot be the optimal solution to Gandhi’s problem because it indicates that Gandhi can manufacture shirts and pants without incurring the cost of renting the needed machinery. The current formulation is incorrect because the variables y1, y2, and y3 are not present in the constraints. This means that there is nothing to stop us from setting y1 = y2 = y3 = 0. Setting yi = 0 is certainly less costly than setting yi = 1, so a minimum- cost solution to IP1 will always set yi = 0. Somehow we must modify (IP 1) so that whenever xi > 0, yi = 1 must 3 hold. The following trick will accomplish this goal. Let M1, M2, and M3 be three large positive numbers, and add the following constraints to (IP 1): x1 ≤ M1y1 (a) x2 ≤ M2y2 (b) x3 ≤ M3y3 (c) Adding these to IP 1 will ensure that if xi > 0, then yi = 1. To illustrate, if x1 > 0, then y1 cannot be 0. For if y1 = 0, then the above (a) would imply x1 ≤ 0 or x1 = 0. Thus, if x1 > 0, y1 = 1 must hold. If any shirts are produced (x1 > 0), (a) ensures that y1 = 1, and the objective function will include the cost of the machinery needed to manufacture shirts. Note that if y1 = 1, then (a) becomes x1 ≤ M1, which does not unnecessarily restrict the value of x1. If M1 were not chosen large, however (say, M1 = 10), then (a) would unnecessarily restrict the value of x1. In general, Mi should be set equal to the maximum value that xi can attain. In the current problem, at most 40 shirts can be produced (if Gandhi produced more than 40 shirts, the company would run out of cloth), so we can safely choose M1 = 40. Also, M2 = 53 and M3 = 25. If x1 = 0, (a) becomes 0 ≤ M1y1. This allows either y1 = 0 or y1 = 1. Because y1 = 0 is less costly than y1 = 1, the optimal solution will choose y1 = 0 if x1 = 0. In summary, if (a)–(c) are added to (IP 1), then xi > 0 will imply yi = 1, and xi = 0 will imply yi = 0. The optimal solution to the Gandhi problem is z = $75, x3 = 25, y3 = 1. Thus, Gandhi should produce 25 pants each week. The Gandhi problem is an example of a fixed-charge problem. In a fixed-charge problem, there is a cost associated with performing an activity at a nonzero level that does not depend on the level of the activity. Thus, in the Gandhi problem, if we make any shirts at all (no matter how many we make), we must pay the fixed charge of $200 to rent a shirt machine. Problems in which a decision maker must choose where to locate facilities are often fixedcharge problems. The decision maker must choose where to locate various facilities (such as plants, warehouses, or business offices), and a fixed charge is often associated with building or operating a facility. 4 The Lockbox Example Consider a national firm that receives checks from all over the United States. There is a variable delay from when the check is postmarked (and hence the customer has met her obligation) and when the check clears (the firm can use the money). It is in the firm's interest to have the check clear as quickly as possible since then the firm can use the money. To speed up this clearing, firms open offices (lockboxes) in different cities to handle the checks. For example, suppose we receive payments from four regions (West, Midwest, East, and South). The average daily value from each region is as follows: $70,000 from the West, $50,000 from the Midwest, $60,000 from the East, and $40,000 from the South. We are considering opening lockboxes in L.A., Chicago, New York, and/or Atlanta. Operating a lockbox costs $50,000 per year. The average days from mailing to clearing is given in the table. West Midwest East South LA 2 6 8 8 Chicago 6 2 5 5 NY 8 5 2 5 Atlanta 8 5 5 2 Which lockboxes should we open? Formulate an IP that we can use to minimize the sum of costs due to lost interest and lockbox operations. Assume that each region must send all its money to a single city and investment rate is 20%. First we must calculate the losses due to lost interest for each possible assignment. For example, if the West sends to New York, then on average there will be $560,000 (= 8 * $70.000) in process on any given day. Assuming an investment rate of 20%, this corresponds to a yearly loss of $112,000. We can calculate the losses for the other possibilities in a similar fashion to get the following table. West Midwest East South LA 28 60 96 64 Chicago 84 20 60 40 NY 112 50 24 40 Atlanta 112 50 60 16 Let yj be a 0-1 variable that is 1 if lockbox j is opened and 0 if it is not. Let xij be 1 if region i sends to lockbox j; and 0 otherwise. Our objective is to minimize our total yearly costs. That is, Min z = 28 x11 + 84 x12 + 112 x13 + … + 50 y1 + 50 y2 + 50 y3 + 50 y4 One set of constraint is that each region must be assigned to one lockbox: 𝑛 ∑ xij = 1 𝑗=1 A more difficult set of constraint is that a region can only be assigned to an open lockbox. This can be written as x1j + x2j + x3j + x4j < M yj 5 M is any number that should be at least 4 as there are four regions. (Suppose we do not open LA lockbox; then y1 = 0, so all of x11, x21, x31, and x41 must also be 0. If y1 = 1, then there is no restriction on the x values.) For this problem we would have twenty variables (four y variables, sixteen x variables) and eight constraints. This gives the following 0-1 linear program: Min Z = 28 x11 + 84 x12 + 112 x13 + 112 x14 + 60 x21 + 20 x22 + 50 x23 + 50x24 + 96 x31 + 60 x32 + 24 x33 + 60 x34 + 64 x41 + 40 x42 + 40 x43 + 16 x44 + 50 y1 + 50 y2 + 50 y3 + 50 y4 s.t. x11 + x12 + x13 + x14 = 1 x21 + x22 + x23 + x24 = 1 x31 + x32 + x33 + x34 = 1 x41 + x42 + x43 + x44 = 1 x11 + x21 + x31 + x41 < 4y1 x12 + x22 + x32 + x42 < 4y2 x13 + x23 + x33 + x43 < 4y3 x14 + x24 + x34 + x44 < 4y4 All xij and yj = 0 or 1 There are other formulations, however. For instance, instead of four constraints of the form x1j + x2j + x3j + x4j < M yj , consider the sixteen constraints of the form: xij < yj i = 1, 2, 3, 4; j = 1, 2, 3, 4 These constraints also force a region to only use open lockboxes. (Suppose yj is 0, so by using four corresponding constraints all of x1j, x2j, x3j, and x4j must also be 0. If yj is 1, then there is no restriction on the x values. Another point of view: If xij = 1, then yj = 1 as required. Also if x1j = x2j = x3j = x4j = 0, then there is no restriction on the y values. The act of minimizing costs will result yj = 0. 6 Set-Covering Problems The following example is typical of an important class of IPs known as set-covering problems. Example: There are six cities (cities 1–6) in Kilroy County. The county must determine where to build fire stations. The county wants to build the minimum number of fire stations needed to ensure that at least one fire station is within 15 minutes (driving time) of each city. The times (in minutes) required to drive between the cities in Kilroy County are shown in Table below. Formulate an IP that will tell Kilroy how many fire stations should be built and where they should be located. For each city, Kilroy must determine whether to build a fire station there. We define the 0–1 variables x1, x2, x3, x4, x5, and x6 by xi = 1 if a fire station is built in city 1, otherwise xi = 0. Then the total number of fire stations that are built is given by ( x1 + x2 + x3 + x4 + x5 + x6), and Kilroy’s objective function is to minimize z = x1 + x2 + x3 + x4 + x5 + x6 What are Kilroy’s constraints? Kilroy must ensure that there is a fire station within 15 minutes of each city. Table below indicates which locations can reach the city in 15 minutes or less. To ensure that at least one fire station is within 15 minutes of city 1, we add the constraint x1 + x2 ≥ 1 (City 1 constraint) This constraint ensures that x1 = x2 = 0 is impossible, so at least one fire station will be built within 15 minutes of city 1. Similarly the constraint x1 + x2 + x6 ≥ 1 (City 2 constraint) ensures that at least one fire station will be located within 15 minutes of city 2. In a similar fashion, we obtain constraints for cities 3–6. Combining these six constraints with the objective function ( and the fact that each variable must equal 0 or 1), we obtain the following 0 – 1 IP: Time Required to Travel between Cities in Kilroy County To From City 1 City 2 City 3 City 4 City 5 City 6 City 1 0 10 20 30 30 20 City 2 10 0 25 35 20 10 City 320 25 0 15 30 20 7 City 4 30 35 15 0 15 25 City 5 30 20 30 15 0 14 City 620 10 20 25 14 0 Cities within 15 Minutes of Given City City Within 15 Minutes 1 2 3 4 5 6 1, 1,2 2, 3, 3,4 4, 4, 5, 2, 5, 6 5 6 6 Min z = x1 + x2 + x3 + x4 + x5 + x6 s.t. x1 x1 + x2 + x2 x6 x3 x3 + x4 + x4 x4 x2 + x5 + x5 + x5 + x6 + x6 ≥1 ≥1 ≥1 ≥1 ≥1 ≥1 (City 1 constraint) (City 2 constraint) (City 3 constraint) (City 4 constraint) (City 5 constraint) (City 6 constraint) xi = 0 or 1 ( i = 1, 2, 3, 4, 5, 6) One optimal solution to this IP is z =2, x2 = x4 = 1, x1 = x3 = x5 = x6 = 0. Thus, Kilroy County can build two fire stations: one in city 2 and one in city 4. Dealing with Either – or Constraints The following is a commonly occurring mathematical programming problem. We have two constraints: f(x1, x2,...... ,xn) ≤ 0 g(x1, x2,...... ,xn) ≤ 0 We want to ensure that at least one of the constraints is satisfied. To ensure that, we write f(x1, x2,...... ,xn) ≤ My (1) g(x1, x2,...... ,xn) ≤ M(1 – y) (2) where y is a 0 – 1 variable and M is a number chosen large enough to ensure that f(x1,x2,......,xn) ≤ M and g(x1, x2,...... ,xn) ≤ M are satisfied for all values of x1, x2, ..., xn that satisfy other constraints in the problem. [y = 0, (1) is satisfied, possibly also (2). If y = 1, (2) is satisfied and possibly (1) also] If – The Constraints We want to ensure that if a constraint f(x1, x2, ...,xn) > 0 is satisfied, then the constraint g(x1,x2,.....xn) ≥ 0 must be satisfied while if f(x1, x2, .... xn) > 0 is not satisfied, then g(x1,x2,......xn) ≥ 0 may or may not be satisfied. To ensure this, we include the following constraints in the formulations: - g(x1, x2, ......, xn) ≤ My f(x1, x2, ......., xn) ≤ M(1 – y) y = 0 or 1 (3) (4) 8 (M is chosen large enough that f ≤ M and –g ≤ M for all values of x1, x2, ...., xn that satisfy the other constraints). f > 0 can only be satisfied if y = 0; then (3) is satisfied. If f > 0 is not satisfied and y = 1, (3) is satisfied, then g < 0 or g ≥ 0 are both possible. Primary determinants of computational difficulty for an IP problem are (1) the number of integer variables and (2) any special structure in the problem. In LP, the number of functional constraints is much more important than the number of variables. In IP, number of functional constraints are of secondary importance. For MIP problems, it is the number of integer variables rather than the total number of variables that is important. The Branch – and – Bound Method for Solving Pure IP Problems In practice, most IP’s are solved by using this technique. Note: If we solve the LP relaxation of a pure IP and obtain a solution in which all variables are integers, then the optimal solution to the LP relaxation is also the optimal solution to the IP. Let us consider the example of pure IP: Max Z = 8x1 + 5x2 s.t. x1 + x2 ≤ 6 9x1 + 5x2 ≤ 45 x1, x2 ≥ 0; x1, x2 integer. The branch-and-bound method begins by solving LP relaxation of the IP ( i.e. no integer constraint). If in the optimal solution variables are integers, then it is also optimal solution for the IP. However, LP relaxation solution yields Z = 165/4, x1 = 15/4, x2 = 9/4. We now know that optimal Z-value for IP ≤ 165/4 (= 41.25). Upper bound = 41 since we have integer values in IP. The next step is to partition the feasible region for the LP relaxation. We arbitrarily choose a variable that is fractional in the optimal solution to the LP relaxation – say x1. Now, every point in the feasible region for the IP must have either x1 ≤ 3 or x1 ≥ 4. Subproblem 2 = Subproblem 1 (LP relaxation) + constraint x1 ≥ 4 Subproblem 3 = Subproblem 1 (LP relaxation) + constraint x1 ≤ 3 9 10 9 9x1 + 5x2 = 45 8 7 x1 + x2 = 6 6 5 4 3 2 F Optimal LP solution to Subproblem 1 1 C x1 = 3.75, x2 = 2.25 0 0 1 2 3 4 A5 6 7 We see that every point described by integer numbers in the feasible region are the feasible points (intersections of dotted lines and intersections of the dotted lines and the axes). We also see that every feasible point is included in the feasible region for subproblem 2 or subproblem3. We say that subproblems 2 and 3 were created by branching on x1. We now choose arbitrarily to solve subproblem 2. Solution is the point C where Z = 41, x1 = 4, and x2 = 9/5 Solution step at this stage is as follows. t=1 Subproblem 1 Z = 165/4 x1= 15/4 x2 = 9/4 x1 ≥ 4 x1 ≤ 3 Subproblem 2 Z = 41 x1= 4 x2 = 9/5 Subproblem 3 A display of all subproblems that have been created is called a tree. Each subproblem is referred to as a node of the tree and each line connecting two nodes is called an arc. Subproblem 2 did not yield all integer solution. So, we choose subproblem 2 to create two new subproblems. In this case we branch on x2 (only fractional variable). 10 Subproblem 4 = Subproblem 1 + constraint x1 ≥ 4 and x2 ≥ 2 = subproblem 2 + constraint x2 ≥ 2 Subproblem 5 = Subproblem 2 + constraint x2 ≤ 1 For feasible regions for subproblems 4 and 5 see figure. (B,A,I,H for subpr. 5). C H B x2 = 2 I A x2 = 1 4 5 Now, unsolved problems are: Subproblems 3, 4, and 5. We now choose one to solve. We choose to solve the most recently created subproblem (LIFO, last in first out rule). We should then solve subproblem 4 or 5. Arbitrarily we choose subproblem 4. However, we see that subproblem 4 is infeasible and, therefore, can not yield optimal solution. We place an ‘X’ by the subproblem 4 as any branch from it will not yield useful information. When further branching on a subproblem can not yield any useful information, we say that the subproblem (or node) is fathomed. Now, unsolved problems are Subpr. 3 and Subpr. 5. With LIFO rule, we choose to solve subpr. 5. Solution is point I where Z = 365/9, x1 = 40/9, and x2 = 1. No immediate useful information (one variable is not an integer). We therefore choose to partition Subpr. 5 by branching on x1. Subpr. 6 – Subpr. 5 + Constraint x1 ≥ 5 Subpr. 7 – Subpr. 5 + Constraint x1 ≤4 We should now solve subpr. 6 or 7. Arbitrarily we choose subpr. 7. Solution point is H where Z = 37, x1 = 4, and x2 =1. Both variables have integer values, so this solution is feasible for the original IP. (Subpr. 7 can not yield any solution where Z > 37). Further branching will not yield new information, hence subpr. 7 is fathomed (see tree). This, at the same time, is a candidate solution since all variables are integer values. We keep the candidate solution until a better one is found. This is now a lower bound for Z. Optimal Z ≥ 37. We indicate Lower Bound by placing LB = 37 in the box corresponding to the next solved subproblem. Next to sove is Subpr. 6. The solution is point A where Z = 40, x1 = 5, and x2 = 0. All decision variables are integers. Z = 40 is larger than Z = 37 of subpr. 7. We then place ‘X’ by subproblem 7, we update LB to 40 and make this solution candidate solution. 11 Subproblem 3 is the only unsolved problem. Solution is point F where Z = 39, x 1 = x2 = 3. Subpr. 3 can not yield a Z-value exceeding the current lower bound 40, so it can not yield the optimal solution. We place an ‘X’ next to it (it is fathomed). Optimal solution is, x1 = 5, x2 = 0, and Z = 40. t=1 t=2 Subpr. 1 Z = 165/4 x1= 15/4 x2 = 9/4 x1 ≥ 4 x1 ≤ 3 Subpr. 2 Z = 41 x1= 4 x2 = 9/5 Subpr. 3 Z = 39 x1 = 3 x2 = 3 LB = 40 t=7 x2 ≥ 2 x2 ≤ 1 Subpr. 4 Subpr. 5 t = 3 Infeasible t = 4 Z = 365/9 X x1 = 40/9 x2 = 1 x1 ≥ 5 t=6 X x1 ≤ 4 Subpr. 6 Z = 40 x1 = 5 x2 = 0 LB = 37 Cand. Soln t=5 Subpr.7 Z = 37 x1 = 4 x2 = 1 Cand. Soln X Optimal Solution Key Aspects of Branch-and- Bound Method for Solving pure IP’s Step 1 – If it is unnecessary to branch on a subproblem, then it is fathomed. The following three situations result in a subproblem being fathomed: (1) The optimal Z value for the subproblem does not exceed (in a max. problem) the current LB. (2) The subproblem is infeasible, and (3) The subproblem yields an optimal solution in which all variables have integer values. Step 2 – A subproblem may be eliminated from consideration in the following situations: (1) The subproblem is infeasible, (2) The LB is at least as large as the Z-value for the subproblem. Branch-and-Bound Method for Solving Mixed Integer Programming Problems These problems are solved with similar procedure to the IP method. For these problems, the procedure is modified by branching only on variables that are required to be integers. 12 Branch-and-Bound Method for Solving Binary Integer Programming Problems There are many problems which are binary IP problems. Often, they are of decision making variety with “Yes”, “No” decisions (1, 0). The method used to solve these problems is similar to the method described earlier. Example. Max. Z = 9x1 + 5x2 + 6x3 + 4x4 s.t. 6x1 + 3x2 + 5x3 + 2x4 ≤ 10 x3 + x4 ≤ 1 - x1 + x3 ≤0 -x2 + x4 ≤ 0 and xj is binary for j = 1, 2, 3, 4 We first solve the LP relaxation of the problem. Usually we remove the set of constraints that make the problem difficult to solve. For IP, it is the integer requirement. The LP relaxation is as shown before with the xj is binary for j = 1, 2, 3, 4 replaced by xj ≤ 1 and xj ≥ 0 for j = 1, 2, 3, 4 Solution yields (x1, x2, x3, x4) = (5/6, 1, 0, 1) with Z = 16 1/2 Therefore, Z ≤ 16 1/2 for all feasible solutions for the BIP problem. (Bound for the problem: Z ≤ 16 since variables are integers). Branching for BIP problems start by fixing one of the variables, say x 1, at x1 = 0 for one subproblem and x1 = 1 for another subproblem. Subproblem 1 : For x1 = 0 Max. Z = 5x2 + 6x3 + 4x4 s.t. 3x2 + 5x3 + 2x4 ≤ 10 x3 + x4 ≤ 1 x3 ≤0 -x2 + x4 ≤ 0 and xj is binary for j = 2, 3, 4 Subproblem 2: x2 = 1 Max. Z = 9 + 5x2 + 6x3 + 4x4 3x2 + 5x3 + 2x4 ≤ 4 x3 + x4 ≤ 1 x3 ≤1 -x2 + x4 ≤ 0 and xj is binary for j = 2, 3, 4 s.t. LP relaxation of subproblem 1: (x1, x2, x3, x4) = (0, 1, 0, 1) with Z = 9 (Solution obtained by removing integer requirement and adding constraint x j ≤ 1 and xj ≥ 0 for j = 1, 2, 3, 4. LP relaxation of subproblem 2: (x1, x2, x3, x4) = (1, 4/5, 0, 4/5) with Z = 16 1/5 13 Solution to subproblem 1 is integer, we therefore fathome it with Z = 9 which now becomes candidate solution or incumbent. The subproblem 1 has been fathomed by test 3, as indicated by F(3) in diagram below. x1 0 9 = Z* candidate solution or incumbent (0, 1, 0, 1) All Bound 16 1 16 (1, 4/5, 0, 4/5) To complete the solution, similar steps are taken. To summarize the steps to reach a solution: 1. Branching: Among the remaining (unfathomed) subproblems select the one that was created most recently (break ties according to which has the larger bound). Branch from the node for this subproblem to create two new subproblems by fixing the next variable at either 0 or 1. 2. Bounding: For each new subproblem, obtain its bound by applying the simplex method to its LP relaxation and rounding down the value of Z for the resulting optimal solution. 3. Fathoming: For each new subproblem, apply the three fathoming tests summarized earlier, and discard those subproblems that are fathomed by any of the tests. Optimality test: Stop when there are no remaining subproblems. Then, the candidate solution or the current incumbent is optimal solution. Otherwise, return to perform another iteration. (If there is no candidate solution, the conclusion is that the problem has no feasible solutions). To complete solution of problem, we branch on subproblem 2: Subproblem 3: x1 = 1, x2 = 0 Subproblem 4: x1 = 1, x2 = 1 LP relaxation solutions: Subproblem 3: (x1, x2, x3, x4) = (1, 0, 4/5, 0) Z = 13 4/5 Subproblem 4: (x1, x2, x3, x4) = (1, 2, 0, 1/2) Z = 16 Bound for subproblem 3: Z ≤ 13 Bound for subproblem 4: Z ≤ 16 Both of these subproblems fail fathoming tests. We next branch on subproblem 3 or 4; subproblem 4 has higher bound, we choose subproblem4. 14 Subproblem 5: x1 = 1, x2 = 1, x3 = 0 LP relaxation: (1, 1, 0, 1/2) Subproblem 6: x1 = 1, x2 = 1, x3 = 1 LP relaxation: No feasible solution. Bound for subproblem 5: Z = 16 Z ≤ 16 Subproblem 5 can not be fathomed (fails test); Subproblem 6 is fathomed F(2). Since, now, the resulting branching variable x4 is the last variable, fixing its value at either 0 or 1 actually creates a single solution rather than subproblems requiring full investigation. These single solutions are: x4 = 0: (x1, x2, x3, x4) = (1, 1, 0, 0) is feasible with Z = 14. x4 = 1: (x1, x2, x3, x4) = (1, 1, 0, 1) is infeasible. Fathoming tests: First solution passes test 3, second passes test 2. Furthermore, first solution is better than the candidate or incumbent solution (14 > 9), so it becomes the new candidate solution or incumbent with Z* = 14. The only remaining subproblem is now the node subproblem 3 (x1 = 1, x2 = 0). Its bound is 13 which is less than 14. Therefore, subproblem 3 is also fathomed by test 1. We now have the solution tree shown below. The candidate solution or the incumbent is, (x1, x2, x3, x4) = (1, 1, 0, 0) is optimal with Z = 14. x1 x2 x3 x4 Subpr 1 F(3) 9 = Z* Subpr 3 F(1) 0 0 All 0 Subpr 5 16 13 Subpr 4 16 14 = Z* (1, 1, 0, 0) = candidate soln. 0 1 Subpr 2 F(3) 16 1 1 F(2) 16 Subpr 6 1 F(2) 15 Cutting Plane Algorithm An alternative method to branch-and-bound method is the Cutting Plane Algorithm. Reconsidering the problem that was solved by branch-and-bound method: Max Z = 8x1 + 5x2 s.t. x1 + x2 ≤ 6 9x1 + 5x2 ≤ 45 x1, x2 ≥ 0; x1, x2 integer. Optimal tableau for the LP relaxation, i.e. without integer constraint, is: Z 1 0 0 x1 0 0 1 x2 0 1 0 s1 1.25 2.25 -1.25 s2 0.75 -0.25 0.25 RHS 41.25 2.25 3.75 To apply cutting plane method, we begin by choosing any constraint in the LP relaxation’s optimal tableau in which a basic variable is fractional. Arbitrarily, we choose 2nd constraint. x1 – 1.25s1 + 0.25s2 = 3.75 (*) We now define [x] to be the largest integer less than or equal to x, i.e. [3.75] = 3 and [1.25] = - 2. Any number can be written in the form Then, 3.75 = 3 + 0.75 or [x] + f where 0 ≤ f < 1. - 1.25 = - 2 + 0.75 Now, 2nd constraint becomes, x1 – 2s1 + 0.75s1 + 0s2 + 0.25s2 = 3 + 0.75 or x1 – 2s1 + 0s2 – 3 = 0.75 – 0.75s1 – 0.25s2 (**) Cutting plane algorithm now suggests adding the following constraint to the LP relaxation’s optimal tableau: 0.75 – 0.75s1 – 0.25s2 ≤ 0 This constraint is called c cut (Gomory cut). Note: The logic for the above cut is that, - 0.75s1 – 0.25s2 + 0.75 ≤ 0.75 since s1 and s2 are integers. Also, in equation (**) LHS is integer, therefore, RHS is also integer. Then, 0.75 – 0.75s1 – 0.25s2 ≤ 0 since integer less than 0.75 is zero. This cut “cuts off” the current optimal solution to the LP relaxation, but not any feasible solutions to the IP. If solution with this constraint added yields an integer solution, then we have found the optimal solution to the original IP. If the new optimal solution (to LP relaxation + cut) has some fractional-valued variables, then we generate another cut and continue the process. 16 We now add the “cut” constraint to the LP relaxation’s optimal tableau after adding slack variable s3: (i.e. - 0.75s1 – 0.25s2 + s3 = - 0.75) Z 1 0 0 0 x1 0 0 1 0 x2 0 1 0 0 s1 1.25 2.25 -1.25 -0.75 s2 0.75 -0.25 0.25 -0.25 s3 0 0 0 1 RHS 41.25 2.25 3.75 -0.75 Dual simplex algorithm is most appropriate for this solution. s1 should enter the basis in the third constraint (Ratios: 1.25/0.75 for s1, 0.75/0.25 for s2). The tableau becomes: Z 1 0 0 0 x1 0 0 1 0 x2 0 1 0 0 s1 0 0 0 1 s2 0.33 -1 0.67 0.33 s3 1.67 3 -1.67 -1.33 RHS 40 0 5 1 Solution yields the optimal solution with Z = 40, x1 = 5, x2 = 0. Note: The algorithm requires that all coefficients of variables in the constraints and all RHS’s of constraints be integers. This is to ensure that if the original decision variables are integers, then the slack and excess variables will also be integers. Thus, a constraint such as x1 + 0.5x2 ≤ 3.6 must be replaced by 10x1 + 5x2 ≤ 36. Example. s.t. Max Z = 7x1 + 10x2 - x1 + 3x2 ≤ 6 7x1 + x2 ≤ 35 x1, x2 ≥ 0 and integer. Given the slacks s1 and s2 for constraints 1 and 2, the optimum LP relaxation tableau is: BV Z x2 x1 Z 1 0 0 x1 0 0 1 x2 0 1 0 Optimal solutin - Z = 66 1/2 , s1 63/22 7/22 -1/22 s2 31/22 1/22 3/22 RHS 66 1/2 3 1/2 4 1/2 x1 = 4 1/2, x2 = 3 1/2, s1 = s2 = 0 The cut is developed under the assumption that all the variables are integers (including s1 and s2). We can generate cut from any row above, row 0 or row 1 or row 2, and any one can be used in the first iteration. Row 0: Z + 2s1 + s2 – 66 = -(19/22)s1 – (9/22)s2 + 1/2 Then, the cut is -(19/22)s1 – (9/22)s2 + 1/2 ≤ 0 Row 2 (for x1): Then, the cut is x1 + (- 1 + 21/22)s1 + (0 + 3/22)s2 = (4 + 1/2) - (21/22)s1 – (3/22)s2 + 1/2 ≤ 0 Row 1 (for x2): Then, the cut is x2 + (0 + 7/22)s1 + (0 + 1/22)s2 = (3 + 1/2) - (7/22)s1 – (1/22)s2 + 1/2 ≤ 0 17 Note: A constraint equation can be used as a source row for generating a cut provided its RHS is fractional. We also note that Z row , i.e. row 0, can be used as a source row because Z happens to be integer in this example. We select x2 row (row 1) and add, - (7/22)s1 – (1/22)s2 + s3 = - 1/2 BV Z x2 x1 s3 Z 1 0 0 0 x1 0 0 1 0 x2 0 1 0 0 s1 63/22 7/22 -1/22 -7/22 s2 31/22 1/22 3/22 -1/22 cut I s3 0 0 0 1 RHS 66 1/2 3 1/2 4 1/2 -1/2 Tableau is optimal but infeasible. We apply the dual simplex method. Solution becomes, BV Z x2 x1 s1 Z 1 0 0 0 x1 0 0 1 0 x2 0 1 0 0 s1 0 0 0 1 s2 1 0 1/7 1/7 s3 9 1 -1/7 -22/7 RHS 62 3 4 4/7 1 4/7 Still non integer x1 and s1. Arbitrarily select row 2 (x1 row) for the next cut. x1 + (0 + 1/7)s2 + (-1 + 6/7)s3 = 4 + 4/7 The cut is, - (1/7)s2 – (6/7)s3 + 4/7 ≤ 0 We add constraint, BV Z x2 x1 s1 s4 Z 1 0 0 0 0 cut II - (1/7)s2 – (6/7)s3 + s4 = - 4/7 s4 ≥ 0 x1 0 0 1 0 0 x2 0 1 0 0 0 s1 0 0 0 1 0 s2 1 0 1/7 1/7 -1/7 s3 9 1 -1/7 -22/7 -6/7 s4 0 0 0 0 1 RHS 62 3 4 4/7 1 4/7 - 4/7 s1 0 0 0 1 0 s2 0 0 0 0 1 s3 3 1 -1 -4 6 s4 7 0 1 1 -7 RHS 58 3 4 1 4 Applying dual simplex method, BV Z x2 x1 s1 s2 Z 1 0 0 0 0 x1 0 0 1 0 0 x2 0 1 0 0 0 We have optimum solution with x1 = 4, x2 = 3, and Z = 58. 18