3.5.1
Modeling fixed costs
The first case we look at is where we want to model fixed costs, that is, where we incur a fixed cost K if a particular real variable x is strictly greater than 0. This fixed cost K might represent the cost of setting up a piece of machinery — we do not incur the fixed cost if we do not set up the piece of machinery but if the output level x of the machine is anything different from zero then we have to incur the fixed cost. The graph of the cost against the output level x might be represented in the figure below.
K
Cost
XMAX x
C
Figure 3.6: Combining fixed and variable cost
Here x represents the throughput of the piece of equipment and the cost consists of two parts. If the throughput is zero then the cost is zero, whereas if the throughput takes a value which is different from 0 then the cost is Cost = K + C · x, where C is the per unit cost of output x.
We introduce a binary variable b which is equal to zero if x is equal to zero and equal to 1 if x is strictly greater than zero. Then the cost equals b · K + C · x, but we have to ensure that if b is zero then x is zero. We can do this by introducing the constraint
x ≤ Xmax· b
where Xmax is the largest value that x can take.
We shall see why this is correct. If b = 0 then x is constrained to be less than or equal to zero and so x is zero, whereas if b = 1 we just have the constraint that x ≤ Xmax, i.e. that x is not more than its maximum value (which might be for instance the maximum output of that particular piece of equipment).
3.5.2
Counting
A frequent use of binary variables in modeling is where we wish to be able to count whether a real variable x is different from 0. Often we want to have a constraint that only a certain number of real variables are strictly greater than 0.
An example might be where we have a whole variety of different ingredients that could go into a blend and we have a constraint that perhaps at most 10 of these ingredients can actually go into the blend. If the quantity of item i going into the blend is xiand we require no more than 10 of these to be non zero, for each item i we introduce a binary variable bi and have constraints of the form
xi≤ VOL · bi
where VOL is the volume of the blend to be made. These constraints ensure that if a particular xi is greater than zero then the corresponding bi must be equal to 1. Then the constraint that says that no more than 10 of the ingredients must be non zero could be expressed as
10
X
i=1
bi≤10
3.5.3
Partial integers again
Earlier we postponed the discussion of how partial integer variables can be expressed in terms of binary variables. Recall that a partial integer is a variable which has to be integral in any acceptable solution if the value is less than some bound, and otherwise can be real. The natural way to express a partial integer
p is
p = v + x
where variable v is an integer that must be less than or equal to U (i.e. 0 ≤ v ≤ U) and x is a real variable. We have already seen that the integer variable v can be expressed in terms of several binary variables using the binary expansion. Now we have to express the fact that if v is strictly less than U then x must be zero. Suppose that we know some value Xmaxwhich x is guaranteed not to exceed, i.e. an upper bound for x. Then we can introduce a new binary variable b and the following constraints
x ≤ Xmax· b
b ≤ v / U (or, equivalently, v ≥ U · b )
To show that this formulation is valid, consider the two possible values of b. First, if b = 0 then x ≤ 0, i.e.
x is equal to 0 and v ≥ 0. If b = 1 then x ≤ Xmax and v ≥ U, which combined with the fact that v ≤ U means v = U. So if b = 1, v is at its maximum, and we can then start having non-zero amounts of x. As was the case with general integer variables, it seems profligate to express partial integers in terms of binary variables. Firstly, we have to express the integer part in terms of binary variables and then we have to introduce a new binary variable b to model the partial integrality of variable p. Furthermore, as with semi-continuous variables, introducing the extra binary variable will never make the branch and bound tree search quicker and may often make the tree search worse.
Consider the following example. Suppose that U = 10 and that the LP solution gives the optimum value of v to be 3 and x to be 0, but the binary variable b is at 0.3. We can see that this satisfies all the inequalities we have given but that the binary variable b is fractional and we will have to branch on b to satisfy integrality. But v is feasible as far as partial integrality is concerned, so we have a case where partial integer variables enable us to say that we are integer feasible but the introduction of the binary variable results in it not being integer feasible and we have to branch further. In models with many partial integer variables this can lead to a great expansion of the branch and bound tree and a lengthening of the search.
3.5.4
Price breaks and economies of scale
Consider Figure3.7which represents the situation where we are buying a certain number of items and we get discounts on all items that we buy if the quantity we buy lies in certain price bands.
Cost B1 B2 B3 COST COST COST 1 2 3 x
Figure 3.7:All items discount
In the figure we see that if we buy a number of items between 0 and B1then for each item we pay an amount COST1, whereas if the quantity we buy lies between B1and B2we pay an amount COST2for each item. Finally if we buy an amount between B2and B3then we pay an amount COST3for each item. For the sake of concreteness we assume that if we order exactly B1items then we get the unit price COST2, whereas if we order just a little less than B1then we would get the unit price COST1, and similarly for all the other price breaks. This sort of pricing is called all item discount pricing.
To model these item price breaks we should use binary variables b1, b2and b3, where biis 1 if we have bought any items at a unit cost of COSTi.
Now introduce the real decision variables x1, x2and x3which represent the number of items bought at price COST1, COST2and COST3respectively. Note that we cannot buy any items at price COST2until we have bought the maximum number of items at the higher price COST1, otherwise the solution would be easy as we buy all items at the least expensive unit price!
The total amount x that we buy is given by
x = x1+ x2+ x3
We claim that the following set of constraints models the all-item discounts.
B1· b2≤ x1≤ B1· b1 (3.5.1)
(B2− B1) · b3≤ x2≤(B2− B1) · b2 (3.5.2)
x3≤(B3− B2) · b3 (3.5.3)
b1≥ b2≥ b3 (3.5.4)
Equations (3.5.1) say that if we have bought any in the second price range (b1= b2= 1) then x1is fixed to
B1. Equations (3.5.2) ensure that if b2= 0, then x2= 0, whereas if b2= 1 then x2is only constrained by the maximum amount that can be bought at the price COST2. Equation (3.5.3) ensures that x3 = 0 if b3 = 0, and that if b3= 1 then we cannot buy more than the maximum number at price COST3. Equations (3.5.4) ensure that we can only buy at a lower price if we have bought at all the higher prices.
Cost B1 B2 x COST1 COST2 COST3 B3 Figure 3.8:Incremental price breaks
Now consider Figure3.8which represents the situation where we are buying a certain number of items and we get discounts incrementally. The unit cost for items between 0 and B1 is C1, whereas items between B1and B2cost C2each, and items between B2and B3cost C3each.
We can model this using Special Ordered Sets of type 2 (SOS2). At the points 0, B1, B2and B3we introduce real valued decision variables wi(i = 0, 1, 2, 3). We also define cost break points CBPi that correspond to the total cost of buying quantities 0, B1, B2and B3. So
CBP0= 0 CBP1= C1· B1 CBP2= CBP1+ C2·(B2− B1) CBP3= CBP2+ C3·(B3− B2) We then have w0+ w1+ w2+ w3= 1 TotalCost = 0 · w0+ CBP1· w1+ CBP2· w2+ CBP3· w3 x = 0 · w0+ B1· w1+ B2· w2+ B3· w3
and the wiform a SOS2 with reference row coefficients given by the coefficients in the definition of x. For a solution to be valid, at most two of the wi can be non-zero, and if there are two non-zero they must be contiguous, thus defining one of the line segments.
3.5.5
The product of a binary and a real variable
With two real variables, x and y, and a binary variable b, we want to model
y = b · x
Suppose we have some upper bound U on the value of x. Then consider the following constraints
y ≤ x (3.5.5)
y ≥ x − U · (1 − b) (3.5.6)
y ≤ U · b (3.5.7)
If b = 0, then (3.5.7) means that y = 0. If b = 1, then (3.5.7) is harmless, and we have y ≤ x from (3.5.5) and y ≥ x from (3.5.6), i.e. y = x, which is what is desired.
3.6
References and further material
Most of the books cited in the ‘References’ section of Chapter 1 also contain a part on Integer Pro- gramming, for instance the one by Schrijver [Sch86]. An excellent text on Integer Programming is the monograph by Wolsey [Wol98]. The book on combinatorial optimization by Papadimitriou and Steiglitz [PS98] also deals with this topic. Syslo et al. [SDK83] provide Pascal code for some algorithms.
The idea of Branch and Bound stems from Land and Doig [LD60]. For certain huge problems this algorithm may be combined with column generation, leading to Branch and Price algorithms, a description of this technique and its main application areas is given in [BJN+98].
The notion of Special Ordered Sets was introduced by Beale et al. ([BT70] and [BF76]). For semi-continuous variables see Ashford and Daniel [AD93].
Similarly to presolving for linear problems, commercial MIP software usually performs some work to ob- tain an improved problem formulation before starting the branch and bound search, and sometimes also at the nodes of the search tree. The techniques that are used may be summarized as integer preprocess- ing and cut generation. Integer preprocessing tries to reduce the size of a problem and tighten bounds based on integrality considerations; an overview on standard techniques is given in [Sav94]. Cut gener- ation techniques generate additional constraints (valid inequalities, cutting planes, or in general cuts) that tighten the problem formulation: these cuts do not change the solution of the MIP but draw the LP relaxation closer to the MIP. Research related to cuts is a very active field (e.g. [GP01] and [MW01]). Cuts are generated based on the identification of certain mathematical structures, but the user may also ‘help’ by specifying so-called model cuts (see the example in Section10.4).
As mentioned in Section3.2, to solve large applications efficiently it may be worthwhile experimenting with the different search strategy options provided by a solver. A computational study of search strategies is described in [LS98]. Integer Programming algorithms have made rapid progress in recent years [JNS00]: problems with several thousand discrete variables may now be solved to optimality. However, certain classes of problems still remain extremely difficult, like the example given by [CD99] for which instances with more than forty variables cannot be solved with commercial solvers.
An entirely different method for representing and solving problems with discrete variables is Constraint Programming (CP) [VH98]. An introduction to CP is given in the textbook by Marriott and Stuckey [MS98]. Many concepts in (M)IP have their correspondence in CP and vice versa; Heipcke [Hei99b] compares and explains the most common terms of both fields. With CP it is often relatively easy to find feasible solu- tion(s) to a problem but proving optimality is a much more difficult task (there is no real correspondence to the bounding information provided by the LP relaxation in MIP). A very active field of research is the integration of both approaches to exploit their complementarity and also to be able to work with con- tinuous variables in the context of Constraint Programming (see for instance [BDB95], [RWH99], [BK98], [Hei99a]).
Chapter 4
Quadratic Programming
Quadratic Programming (QP) is the name given to the problem of finding the minimum (or maximum) of a quadratic function of the decision variables subject to linear equality or inequality constraints. Note that QP problems do not allow quadratic terms in the constraints, only in the objective function. QP problems occur much less frequently than LP or MIP problems, so we shall not discuss them in much depth.
Mixed Integer Quadratic Programs (MIQP) are QPs where some or all of the decision variables have to take on discrete values; in other words, they are MIPs with a quadratic objective function. The discrete constraints can be any of the global objects that we have seen above (binaries, integers, etc.)
Since QPs are just LPs with quadratic objective functions, the only thing special to note is modeling the objective function. We now give two typical examples.
4.1
Revenue optimization
If a company wishes to plan the amount q of a product to be sold, and at the same time determine the unit price p at which it is to be sold, then the objective function will contain a quadratic term p · q, which is the revenue (price · quantity) from selling the product.