Formulation of multiple-choice situations in linear programming models using binary coding matrices

Formulation of multiple-choice situations in linear programming models using binary coding matrices

1 linear prograrraning matrices D i e t e : B. P R E S S M A R UniversitSt Hamburg, Imtitut fOr Unternehmensforschung, Von-Melte-Park 5, D-2000 Hambu...

1MB Sizes 0 Downloads 32 Views

1

linear prograrraning matrices D i e t e : B. P R E S S M A R UniversitSt Hamburg, Imtitut fOr Unternehmensforschung, Von-Melte-Park 5, D-2000 Hamburg 13, Germany, Fed Rep.

Abstract: In order to reduce the mLmber of binary vm'fables in a mixed integer LP model, the principle of binary coding is employed for the formulation of various multiple-choice situations. On the basis of a given oxling matrix it is possible to find powerful constraints which define the binary coding procedure within an LP model. This procedure may be employed if the LP code available has not the potential to handle special ordered sets of type ! algorithmicaUy. Keywords: Optimization, integer programming, combinatorial analysis

sets of variables by treating these kinds of constraints algorithmically. A sur;ey of tb~se properties in cx~mparison with the principle of binary coding is presented in Section 6 of this artMe. Multiple-choice situations may occur in several varieties. Using binary variables k'~ the traditional way [1,81 that means without employing an $1 option of the LP code one has mainly to consider the following cases of an MCS with smax alternatives expressed by binary, continuous or semicontinuous variables: L Binary variables

u, E {0,1},

all s ~ (1,2 . . . . . smax},

(la)

arid

(lb)

u~ ~< 1. $

L introduction In linear programming models a multiple-choice situation (MCS) may be described by a se~ of variables with the property that exactly one: of them must be non-zero whereas all the otlzers keep the value of zero [1]. This is also called--according to Beale and Tomlin [21-- a special ordered set of type 1 (SOS1) or $1 set resp. A weaker charac!erization of an MCS may be given by the property that within the set of variables at most one of them may be non-zero; also these variables may be called an $1 set 13]. It is well known that some software systems for mathematical programming such as M I P / 3 7 0 [4], SCICONIC [5], APEXItI [6] or MIPIII [7] have the capability of solving LP-models containing $1 Received December1983; rew~sedSeptember 1984 North-Holland European Journal of Operatio:aal Research21 (1985) i06-1i2

If expression (lb) is taken as an equality we have the strong case of an MCS whereas an inequality defines the weak formulation of an MCS. IL Continuous variables

Let {ul,u 2. . . . ,u~ .... ,Usmax ) be an S1 set according to (la, lb) and ( t l , t 2.... , t s. . . . . tsmax } a set of nonnegative continuous variables which describe the alternatives of the MCS in question: t s ~ esu~,

all s,

(2)

where e, denotes an individual upper bound of the variables t s. If at least one of the expressions (lb) or (2) are taken as inequalities one has the weak formulation of an MCS. A strong formulation is obtained in the expresfions (lb) and (2) are simultaneously interpreted as equations. In this case the continous variables turn out to be biva!ent variables with values of zero or es alternatively.

0377-2217/85/$3.30 © t985: Elsew~erS~ence PublishersB.V. (North-Holland)

JD

.B. Pressmv-./Mu~ttple-chotcesttuattonsm LPmodels ~ .

I I I . S e m i c o n t i n u o u s variab!es

.... Xs,...,

Let (x1,x2, Xsma×} be a set o f variables with t h e property that each vari@le may obtain a value of 0 or any value within a]range of defined by c~ ~ %u~,

all s ,

(3a)

x , <~e~u~,

all s.

(3b)

With respect to the properties of the set of u-variables (equality or inequality respectively) one has a strong or weak formulation of an MCS. The constraints (lb) through (3b) show that in the case of binary variables an MCS is expressed by one additional-row. In the case of the continuous and semicontinuous variables one has to add smax + 1, 2*smax + 1 or 3*smax + 1 rows respectively to an LP model. Subsequently a new approach to the formulation of an MCS within mixed integer LP models is given, where the number of binary variables and additional constraints are substantially reduced.

2. Principle of binary ceding The principle of binary coding provides a procedure for assigning a number of disjunct alternatives to a pattern of zero-one-signals. Such a p,ttern may be represented by a certain number of t~i~ary variables. Let this number be dmax, then :he number of alternatives s max which may be coded is equal to 2 am~. Based on a coding matrix B ::he coding procedure may be written in the following way. Let b~d be the coefficients of B:

{0a),

.

.

.

spondingly to each element of a set of alternatives within an MCS. In terms of the general coding theory the rows of matrix B may be interpreted as codewords of a binary linear code [9]. The codewords are of equal length dmax, i.e. the number of binary digits within a codeword is constant. Since a redundant coding is not necessary two codewords differ in at least one digit. With these assumptions a binary linear code contains 2 dm~ codewords. It is our goal to introduce the smallest matrix B possible according to the numbers of codewords necessary to mark the alternatives within an MCS. The number of rows is given by smax and the number of columns will be d max. For both parameters we obtain: dmax =

rld(smax)]

(6a)

and (6b)

2 dmax >I smax > 2 dmax-1

If smax ranges between two powers of 2 the larger has to be chosen for the determination of d max. Therefore, the number of columns of B is roughly speaking proportional to the logarithmus dualis of the number of rows. A rather suitable procedure to get, crate the elements of the matrix B for a giver,~ s max is enclosed in the definition of successive dual numbers from 0 to smax ,- 1. Zero di~ts are used io fill ap all the empty places.on the left side o f the codewords if the dual numbers have a le~Lgth of less than dmax digits. Suppose ( q , t 2 , ~ . . , t, . . . . , Lma,: } is a set of continuous variables representing an MCS, a set of additional binary indicator variables {'%,w2. . . . , w d . . . . , Wdm~, } is introduced to define the following constraints: w a ~ (0,1},

s~{1,2 .... ,smax},

107

.

all d,

(7)

d ~ { 1 , 2 , . . . , d m a x } , (4) with

with

( bn... B: =

b,a

bsma×,l..,

~t,b,d~

bl,dmax )

WdE,

all d,

(ga)

s

.

(5)

bsmax,dmax

In addition, B must have the property that each row s creates a unique pattern of zero- and one-coefficients, which may be attributed corre-

all d,

(gb)

s

where E is defined as E: = max { e, }. s

(9)

D.B; Preszmar / Multiple-choice situations in LP models

108

With this approach it takes d m a x b i n ~ variables and 2* dmax constraL~ts for the formulation of an MCS. The advantage of this approach in comparison with the formulation in (la), ( l b ) and(2) is obvious if one has an MCS with a large n u m b e r smax of alternatives. For example only ten binary variables are required to express a set of 1000 alternatives in an LP model.

4. Extensions

o f variables which m a y create an $1 set were discussed. N o w the treatment of these cases using binary coding is given.

3. Proof

L Binary variables It mz y be shown that for any binary coding matrix B the system of constim-nts as it is formulated in (8a) and (8b) represents an MCS with respect to the t-variables invoived. Suppose, B is a binary coding matrix as it is defined by (4) and (5). With respect to (8a) and (8b) one has

Wd=O

~

(t0a)

~

L=O (10b)

This defines the link between any binary variable wd and its corresponding column of coefficients ( bla, b2a . . . . . bsma~,d ) within the coding matrix. It shows that a t, may be positive only if the binary variable wa has the same value as the corresponding coefficient b,d. If this is not true, the variable t, is forced to be equal to zero. Ta:.dng into consideration the property stated by (10a) and (10b) it foLlows for a given vector ( w~ . . . . . Wamax): ~', > 0 and ( s = s * l ( b , . a . . . . . b,.dmax) = ( W 1 . . . . . Wdmax ) )

and

(s=s'13d':b~,a,-~wa,).

(lla) (lab)

As it was stated before e~ ch row vector of the coding matrix (b,1 . . . . . b~.am~,~,) represents a unique zero-one pattern within all the other rows of the matrix. Since each row s is hnked with a variable t~ it is clear that t,. >1 0

(13a)

all d,

(13b)

~ y s ( 1 - b,d)= 1 - wd,

all d.

(13c)

s

for any s with bsa = 0.

,~=0

aUs,

s

and

Wd= 1

0 ~ y s < 1,

Y:y, bsa= we,

L=O

for any s with b~d = 1

Let {Y:,Y2 . . . . . Y~. . . . . . Y,m~x} be a set of coutinuous variables which are confined to the intervall between 0 and 1. In order to define a strong formulation of the MCS one has

for one s* ~ (1,2 . . . . . smax}

(12)

It is obvious that exactly one of the y-variables has the value of 1; all the other y-variables are 0. Though continuous the y-variables may obtain only values of 0 or 1. If the equations (13b) and (13c) are treated as an inequality we have a weak formulation of an MCS. The approach of binary coding in this case leads to a reduction of binary variables, whereas the number of continuous variables is increased as well as the number of constraints.

II. Continuous variables This case is mostly discussed in Section 2, especially with respect to the weak formulation of an MCS. The bivalent variables defining a strong formulation of an MCS are obtained if (8a) and (8b) are interpreted as equalities. The coefficient E marks the upper b o u n d of these variables. It has to be noticed that individual bounds may not be introduced ia this case.

IIL Semicontinuous variables Let ( x l , x 2 , . . . , x s .... ,X~m~-~} be a set of continuoL:s variables where each variables x s may be

109

D, B. Pressmar / :Multiple - choiee situations in LP models

range of C zero or f that range. a n d E, The binary coding approach is given by: E X s b s d <~ EWd,

(14a)

all~d,

$

E x s ( 1 - - b,d) <~E ( i - Wd),

all d,

(14b)

$

Ex

>~C.

(14c)

.g

Individual bounds e~ or c~ resp. for the x-variables in this case may not be treated by the binary coding approach.

number of binary variables remains confined to

ld(smax). Another application of binary coding matrices shows the modelling of logical implications between S1 sets of variables which are not necessarily integer or zero-one-variables. Suppose, {tt, .... ts,..., tsmax} is an $1 set of continuous variables with one variable being non-zero at the most. A second set of variables { ol,..., v,,..., V,~ax } is linked with the t-variables in the following way: (:is*: t s~ >/0)

(Vses*'t,=v~=O).

and

(16)

IV. Linked special ordered sets

Traditionally, one would solve this problem with a set of constraints in the following way:

Based on binary coding we also have the opportunity of giving formulations for logical relations betweeri different Sl sets of variables. These sets need not necessarily be disjoint, since arbitrary variables may be assigned to the w-variables, which define the MCS exclusively. In order to give an example of a typical situation two sets of continuous variables { x l , . . . , x ~ . . . . ,X,max} and (Ya,---,Y~, . . . . Y,ma~} are considered. Both sets describe an MCS with the property that corresponding variables x, and y~ must be 0, whereas one pair of them has positive values. The y-variables are confined to an upper bound of 1; the x-variables are supposed to be semicontinuous with values of 0 and C, or any value frem C to an upper limit E. With the binary coding approach we obtain:

us <~est s

£(x,+y~)b,d<~(E+l)wa,

alia,

(15a)

s

E(x,+y~)(1--b,d)<~(E+l)(1--wa),

alld,

all s.

(17)

where ! is an appropriate coefficient for the upper bound of vs. Using the binary coding matrix B a rather efficient way of modelling these logical links is given by the following system of constraints:

~ V , b d< E~t,b,a, s

all d,

(18a)

s

~v,(1-b,d)<~E~t.(1-bsd), s

alld,

(18b)

s

where E is selected such that it serves as an upper bound for the v-variables in connection with the maximum of the t-wtriables. Even more than one set of variables may be linked together with the set of t-variables if on the left side of the inequalities (18a) and (18b) additional variables are included in tt~e summation. The number of constraints is also reduced substantially according to ld(smax).

$

(15b) ~x,>iC s

and ~ y ~ = l .

5. Samples

(15¢)

s

It is obvious that a lot of variations in the logical links between two or more sets of variables may be formulated in a similar way. Numerical experiences with mixed integer LP-models show that sometimes a disaggregation of sums as in (15a) or (15b) improves numerical stability and convergence [10] Of course, this kind of disaggregation may also be employed here. This would increase the number of constraints; a!though the

To show the practical approach of binary coding an example with a set of smax = 4 alternatives within an MCS is discussed. With respect to (6a) dmax has the value of 2; therefore, the dimension of the coding matrix B is 4 by 2. It is suggested to use this kind of a binary coding matrix:

B:=

1 0

0 1."

°° t I 1:

(19)

DiB: Pressmar/ Multiple.choi,oe sitilationsinLp,i~odels .

110

If two

.

.

.

.

.

.

sets

{ Yt, Y2, Ys, Y4 }

ar~

by: (3s* : ts. > 0 and and

(Vs ~ s* : t s = y . = U)

l,z u )

The formulation of the constraints will be: t2 + t4 +Y2 +Y4 <~ ( E "- 1)w t, t~ + t 3 + y i +Y3 <~ ( F -~- !)(1 + wl), t3+t4+y3+y4<<.(E÷

(21)

1)w2,

ta + t2 +Yl +Y2 ~< ( g + 1)(1

-

w2) ,

.;3 +Y4 +Y3 +Y4 = 1.

6. LP computer code and binary coding

In this example the set of y-variables represents me strong formulation, whereas the t-variables model a weak formulation of an MCS. Suppose, a set of t-variables (q,t2,t3,t4} has the property of an SOS1. Together with the implication, that within another set of v-variables {v~,Vz,V3,V4) any v~ may be non-zero only if the corresponding L a non-zero-variable, the constraints may be formulated in the following way: 02 + 04 <~E ( t 2

+/4),

03 + V4 ~ E ( t 3 + / 4 ) ,

(22)

01 4" V3 ~ E ( t 1 4" t 3 ) ,

v~ +v2 <~E(q

these cases where additional constraints for t h e purpose of general u p p e r or lower bounding are necessary a reduction of the number of constraints may be observed for an MCS with s m a x > 6.

+t2),

where E is an appropriate ulrper bound for the v-variables.

M o d e m software systems for linear programming have the option to handle S1 sets of variables algorithmicaUy. It seems that this approach is more efficient than the modelling based on binary coding. But in practice there are still LP codes which do not offer an $1 option [11]. Even those computer programms which admit special treatment of S1 sets of variables are sometimes confined to a very specialized formu!.ation of an MCS, such as bi:~ary variables which must add up to one. SpecJ,d ordered sets defined b y continuous or s.: nicontinuous variables, or logical links between di ferent $1 sets are not treated. Also in these c,~;es where an S1 option is not available or is not fle~ble enough the binary coding approach may b,: recommended.

Table 1 S1 Set Features

MIPIII

SCICONIC

APEXIII

MIP/370

Binary Coding

Binary variables, strong MCS Binary variables, weak MCS Continuous variables, stron~ MCS Continuous variables, weak MCS Semicontinuous variables, strong MCS SemJcontinuous variables, strong MCS Sets need not being disjoir~t Reference row no~ obligatory Linked S1 sets

yes

yes

yes

yes

yes

yes

yes

yes

no

yes

yes

yes

yes

no

yes

yes

yes

yes

no

yes

yes

yes

no

no

yes

yes

yes

no

no

yes

yes

no

no

no

yes

yes

no

yes

yes

yes

no

yes

no

no

yes

D.B. Pressmar / Multiple ,choice situations in Lt ~models

111

Table 2 Model name

Rows ,

Columns total

Binary integers

Density %

Number of MCS

Optimality status

Iterations total

Number of nodes

Time since MIXSTART

U7510302 W7510302

39 36

96 90

12 6

7.98 11.3

3 3

proved proved

314 275

30 27

0.056 0.046

U3010501 W3010501

97 87

185 165

40 20

2.61 3.72

t0 10

proved proved

40402 10943

3820 1113

10.139 2.644

U2210713 W2210713

37t 355

311 279

64 32

0.60 0.83

16 16

int. sol. ~ proved

29870 25435

2732 2011

14.903 10.132

U2210813 W2210813

435 415

388 348

80 40

0.52 0.73

20 20

int. sol. ~ improved int. sol."

10344 18956

809 1168

5.407 9.532

U5512739 W5512739

943 851

993 901

184 92

0.23 0.27

92 92

cont. sol a improved int. sol. b

1624 14108

23 692

1.012 28.981

a Irregular stop because of numerical instability; non-optimal solution. b Stop because of time limit (30.0 CPU-minutes). U: Traditional MCS-formulation; W: MCS-formulation by means of binary coding. The optimization system employed is M P S / X by Fujitsu Ltd., Tokyo, Japan; it runs on a computer system SIEMENS 7.882 at the Computing Centre of the University of Hamburg.

In order to show the advantage of binary coding a survey is given by Table t, where four well-known LP codes are compared with the method suggested in this paper. The comparison is based on several criteria describing the quality of different variants of $1 sets. This survey deals with the LP codes SCICONIC [5], MIPIII [7], APEXIII [6] and MIP/370 [4]; in addition, the report on computer codes by Land and Pewell [12] was taken into consideration. From the following Table 1 that the flexibility of binary coding is better in comparison with most of the LP codes. MIP/370 or APEXIII offer only a smaller number of variations for $1 sets to be treated algorithmicly. The full spectrum of criteria is covered by MIPIII and SCICONIC as well as by the binary coding approach. Still a minor restriction for the user is related with the SCICONIC code in that it only handles disjoint sets of variables.

7. Nurner~c~,t e×periences The benefits of binary coding for mixed integer LP models ~tre shown by Table 2. Certain problems in the fietd of production plannh~g are taken to formulate two different LP models for the so!ution of identical planning tasks. One of these

corresponding LP models in based op the traditional method to formulate an MCS whereas the other one uses the principle of binary coding. The empirical results presented in I able 2 give an impression of the acbdevement if the princ~pk: of binary coding is applied to mixed integer LP models. In general the models with binary coding have smaller dimensions compared to the traditional approach. The number of rows isreduced due to the smaller number of definition constraints for the MCS. Since each model consists of several MCS the number of binary variables is reduced to 50%. A reduction according to /d(smax) .... 1, only be reached if the whole model would be based exactly on one $1 set of binary variables. The columns presenting figures about the optimization effort after calling MIXSTART show that CPU-time, number of iterations and number of nodes during the branch and bound process are substantially reduced. In one case (U5512739) it was not possible to obtain an integer solution at all if the traditional LP model b; used. The binary coding principle however pro,tided a satisfying solution. References: [1 ] Williams, H.P., Model Building in Mathematica! Programruing, John Wiley, New Vork, 1979, 164-]94.

112

447-454. [3] Hummeltenberg, W., "Implement Research 17 (7984) 1-15. [4] International Busi~aess Machines, Reference M ~ uaI, White Plains, t 15] SCICON Compuler Services Ltd.. Guide, London, 1982. [6] Control Data Corp., APEXIII t n~.,ota, i980. [7] Ketron, Inc., M I P I I I - M P S I I I Mixed Integer Algorithm--User Manual, Arlington, 1984.

puter codes to solve integer linear programming problems". Research Report no. 8!-09, HEC, Paris, 1981.