You are on page 1of 5

LOGICAL CONSTRAINTS AND BINARY VARIABLES

ADI BEN-ISRAEL

Let A, B, C, · · · denote some actions, and let δA , δB , δC , · · · be the corresponding decisions, i.e., δX = 1, if action X is taken; 0, otherwise.

We express logical conditions on the actions by constraints on the corresponding decision variables. 1. And. The logical condition A and B is equivalent to the constraint δA + δB = 2 This equivalence is expressed as follows A and B ⇐⇒ δA + δB = 2 and can be checked by a truth table, δA δB A and B δA + δB 0 0 F 0 0 1 F 1 1 0 F 1 1 1 T 2 2. Or. A or B or both ⇐⇒ δA + δB ≥ 1 δA δB A or B δA + δB 0 0 F 0 0 1 T 1 1 0 T 1 1 1 T 2 3. Exclusive Or. A or B but not both ⇐⇒ δA + δB = 1 δA δB A or B but not both δA + δB 0 0 F 0 0 1 T 1 1 0 T 1 1 1 F 2
1

A only if B. If B then A. Synonyms: A and B are equivalent. If (A and B) then C. If A then B. B implies A. A if and only if B. B is sufficient for A. A implies B. Synonyms: B if A. Synonyms: A if B. A is necessary for B. A =⇒ B B if A ⇐⇒ δA ≤ δB δA δB B if A δA ≤ δB 0 0 T T 0 1 T T 1 0 F F 1 1 T T 5. A ⇐= B B only if A ⇐⇒ δA ≥ δB δA δB B only if A δA ≥ δB 0 0 T T 0 1 F F 1 0 T T 1 1 T T 6. A ⇐⇒ B A if and only if B ⇐⇒ δA = δB δA δB A if and only if B δA = δB 0 0 T T 0 1 F F 1 0 F F 1 1 T T 7.2 ADI BEN-ISRAEL 4. If (A and B) then C ⇐⇒ δA + δB ≤ 1 + δC δA δB δC If (A and B) then C δA + δB ≤ 1 + δC 0 0 0 T T 0 0 1 T T 0 1 0 T T 0 1 1 T T 1 0 0 T T 1 0 1 T T 1 1 0 F F 1 1 1 T T . A is sufficient for B. A is necessary and sufficient for B. B is necessary for A. B only if A.

This is the case where the cost per unit decreases as the order size increases. and assume that if X > 0 then X must satisfy L≤X≤U where the bounds L.01 For large n the fixed cost becomes negligible – an advantage of “big business”. U are given. . Fixed cost.LOGICAL CONSTRAINTS AND BINARY VARIABLES 3 8.020. Let K be a fixed cost.000 20. Quantity discounts–A. A “fixed cost” as in § 9 results in a quantity discount. Let X be a quantity to be produced (or purchased). The quantity bounds are enforced by the constraints L δX ≤ X ≤ U δX 11. Quantity bounds.00 10 120. If (A or B) then C ⇐⇒ δA + δB ≤ 2 δC δA δB δC If (A or B) then C δA + δB ≤ 2 δC 0 0 0 T T 0 0 1 T T 0 1 0 F F 0 1 1 T T 1 0 0 F F 1 0 1 T T 1 1 0 F F 1 1 1 T T 9.00 100 30. the decision to produce or purchase.000 21.000 20. so that “big buyers” pay less per unit. and let δX be the decision to produce or purchase. Consider for example a fixed cost K = $1000. so the cost function has two terms K δX + c X To make sure that X > 0 =⇒ δX = 1 we add the constraint 0 ≤ X ≤ U δX where U is some upper bound on X. and c a variable unit cost. and let n units be bought.00 1. 10.10 100. If (A or B) then C.00 10. Let X be a quantity to be produced (or purchased). Then the cost for unit is 1000 + 20 n n as illustrated in the following table Order size n Cost per unit 1 1. and a variable unit cost c = $20. To enforce this constraint we use the logical variable δX .

000 on the number of units we may buy. and three binary variables. c=  8. c=  8. We use the variables x1 = the number of pieces bought at the regular price. Quantity discounts–B. if 2001 ≤ x. δi = 0. 1. x2 = the number of pieces bought at the price of 9 $/unit. for any unit above 1000. x2 = the number of pieces bought at the price of 9 $/unit. otherwise. and assume an upper bound of 5. Another kind of quantity discount is illustrated by the following unit price   10. Quantity discounts–C. if xi > 0. for the first 1000 units. let the price per unit c be given as a function of the order size x as follows. 9. x3 = the number of pieces bought at the price of 8 $/unit. 13. and three binary variables. For example. otherwise.4 ADI BEN-ISRAEL 12. 1. if 1001 ≤ x ≤ 2000. and suppose we know an upper bound of U = 5. 9. if xi > 0. for any unit above 2000. The quantity we buy is x1 + x2 + x3 at the cost 10 x1 + 9 x2 + 8 x3 with constraints 0 ≤ x1 1001 δ2 ≤ x2 2001 δ3 ≤ x3 δ1 + δ2 + δ3 ≤ 1000 δ1 ≤ 2000 δ2 ≤ 5000 δ3 ≤1 (at most one of them is non-zero) Note: The last constraint allows not buying anything. Another type of quantity discount uses price steps. and up to 2000. if x ≤ 1000. If we had to buy something. 000 units. x3 = the number of pieces bought at the price of 8 $/unit. We use the variables x1 = the number of pieces bought at the regular price. this constraint would be = 1. δi = 0.   10. The quantity we buy is x1 + x2 + x3 at the cost 10 x1 + 9 x2 + 8 x3 (now all of them may be non-zero) .

(remember the upper bound of 5. etc. that we cannot use the discounted unit price of $9 before buying 1.000 units at the regular price.000 units) δ1 ≥ δ2 δ2 ≥ δ3 that guarantee.LOGICAL CONSTRAINTS AND BINARY VARIABLES 5 with the constraints 1000 δ2 ≤ x1 ≤ 1000 δ1 1000 δ3 ≤ x2 ≤ 1000 δ2 0 ≤ x3 ≤ 3000 δ3 . for example. .