A unified approach for finding real and integer solutions to systems of linear inequalities

A unified approach for finding real and integer solutions to systems of linear inequalities

A Unified Approach for Finding Real and Integer Solutions to Systems of Linear Inequalities* Zavdi L. Lkhtman Department of Mathematics Tel Aviv Unive...

501KB Sizes 2 Downloads 48 Views

A Unified Approach for Finding Real and Integer Solutions to Systems of Linear Inequalities* Zavdi L. Lkhtman Department of Mathematics Tel Aviv University Tel Aviv, Israel

Transmittedby G. Dantzig

ABSTRACT The variable&mination method for solving linear inequalities is used for finding integer solutions. Properties of this method enable one to give a simple proof, for a large class of systems of linear inequalities, that if a system in this class has any (real-valued) solution, then it also has an integer solution. This class includes all systems of the form Ax > b where A is any real matrix and b does not contain any negative element. The variable-elimination method has an exponential bound on the storage requirement, and hence on the execution time. There exists a simple strategy aimed at reducing the amount of storage and execution time needed. An experimental implementation was used to explore the effectiveness of this strategy.

1.

INTRODUCTION

The method of variable-elimination was first suggested by Fourier [6] (Gauss too was aware of it), and formalized by Dines [4] for solving systems of linear inequalities of the form Ax > 0 where A is any real matrix. Dines also showed that any inhomogeneous system can be transformed to a related homogeneous system, from which solutions of the inhomogeneous system can be found. A generalization of Dines’s method (see for example Kuhn [7J treats inhomogeneous systems directly. *Part of this work was performed at SyracuseUniversity,Systemsand InformationScience Dept., and was supportedin part by RADC under Contract F30602-72-C-0281. APPLIED MATHEMATICS AND COMPUTAZTON4, 177-186 (1978)

0 Ekevier North-Holland, Inc., 1978

177

0096-3CK3/78/004-0177/$01.75

ZAVDI L. LICHTMAN

178

Section 2 describes the generalized variable-elimination method, followed in Sec. 3 by the introduction of the class of non-negative systems of linear inequalities (systems Ax > b where every element in b is non-negative) and its real-valued properties. Section 4 contains an adaptation of the variableelimination method for finding integer solutions, as well as the main result, namely: if a non-negative system of linear inequalities has any real-valued solution, then it also has an integer solution. Computational aspects of the variable-elimination method are discussed in Sec. 5, and some experimental results concerning the effectiveness of a strategy aimed at reducing the storage requirement and execution time are given. 2.

THE VARIABLE-ELIMINATION

METHOD

DEFINITION. A column of a matrix is said to be inequality-definite or I-definite if elements of that column are either all positive (greater than zero) or all negative. A matrix is I-definite if it contains an I-definite column.

Consider a system of the form allXl+ . . . + qnx,, > b,, . . *. . . . . . . . . . . . L&,x, + * * * +a,,x,,>b,,,.

(1)

If the coefficient matrix A is I-definite, then the system certainly has solutions. To see this, suppose, without loss of generality, that the first column is I-definite. The coefficients of x1 are then all positive or all negative. In the former case the system is equivalent to

bl

a12 ---Lx,*** a11 a11 . . . * . . . . . . . . . . . x1 >-

r,>a

bm

-

am2

-7X2-.

ml

aI, ----a&, a11 . . . .

a . . - f=xn,

ml

(2)

ml

and in the later case, to

bl

q<---x~--... a11

%2 %I

al, --X”, %l

................... bn %? X’
-

n ““Xn. %l

(3)

Solutia

to Systemsof Linear Inequalities

179

In either case a+,. . . , x, can be assigned arbitrary values. The variable x1 is required in (2) to exceed the m lower bounds and in (3) to be smaller than the m upper bounds. Next suppose the coefficient matrix of (1) is not I-definite. We will eliminate a variable, say xi, obtaining a reduced system in x,, . . . ,x,,. The correspondence between (1) and the reduced system will be the following: If xi,. . . ,x, satisfy (l), then x,, . . . , x,, will also satisfy the reduced system. If xs,. . .,x,, satisfy the reduced system, there exist values of xi such that xi,. . . , x, satisfy (l), and all such values of xi can be readily determined. The elimination can be applied to any variable xi, and repeatedly reapplied choosing any sequence of variables for stepwise elimination. We demonstrate the procedure on xi, since in this case the resulting formulas have fewer explicit terms. The elements of the first column can be divided into three classes: those which are positive: ail, i = i,, . . . , ip, those which are negative: ail, j = jl,. . . , jN, those which are zero: akiT k=ki,...,kz, the numbers of elements in the respective classes being P, N and Z. The system (1) is equivalent to the following system (4)-&e conjunction of (4P), (4N) and (42). bi

ai2

q>,--xz-“’ I1

ail

bi

32

x1<---x2-.** aj1

ak2x2+.

% --Lx,

for

i=i

for

i=il,...,iN,

l,...,~,,

*

kw

ai1

ap ----cc,

ai1

. . +ahX,,>bk

(4N)

aj1

for

k=kl,...,kz.

(42 )

The variable xi is restricted to he between the P lower bounds and the N upper bounds. For any values of the variables x2,. . . , xn the system (1) will have solutions if and only if the right side of each inequality of (4P) is exceeded by the right side of every inequality of (4N), that is, if and only if

for

i=i,

,...,

ip,

j=jl,...,

Jo.

(5)

180

ZAVDI L. LICHTMAN

Collecting the variable-free terms on the right side, we have

(y$+...

+(y&>$--$ for

Since gives

aiioii >O for i= il,. . .,i,,

i=ilr...,iP,

i=i i,...,jv.

(6)

i= jl,. . .,jN, multiplying (6) by - ui,uj,

( UilUiZ- Ui,UiZ)X2+ * * * + ( UilUi, - UilUi,)X” > u& for

i=i, ,..., ip,

- u& j=jl ,..., fN.

(7)

This condition can conveniently be expressed using determinants, thus:

for

i=il,...,ip,

j=jp...,jw

(8)

The system composed of (8) together with (42) is the reduced system corresponding to (1). The new reduced system has n - 1 variables and PN + Z inequalities. It is clear that the reduced system has the properties claimed. In particular, given any solution of the reduced system, we can determine all the corresponding solutions of (1) from (4P) and (4N). Dines [4] developed this method for homogeneous systems. Note that the general method for non-homogeneous systems, described above, preserves homogeneity. Dines called the coefficient matrix of a reduced system the inequality-minor or X-minor. Adapting this notion, we shall call the augmented matrix of a reduced system the augmented I-minor or AZ-mirwr. Adapting the definition of a (coefficient) matrix being I-definite, we shall say that an augmented matrix is I-definite when its coefficient matrix is Idefinite. When forming successive AI-minors (with decreasing number of variables), none of them being I-definite, eventually we get an AI-minor of one variable. Clearly, it is a trivial task to determine whether or not a system of linear inequalities in one variable has a solution. It should be noted that if one sequence of eliminations leads to an I-definite minor, then every sequence leads to an I-definite minor (this is

solucionr

to systems of LinQur I?wp5litit3

181

immediate when a homogeneous system of linear inequalities is considered). The number of eliminations required to obtain an I-definite minor, however, may depend on the choice of variables to be eliminated. It is also possible to perform an elimination on a system (or AI-minor) with one variable. The resulting system has no variables and only indicates whether the original system has a solution.

THEOREM 1. A system of linear inequalities (as (1)) bus a solution if and only if one of its successive AI-minors is I-definite, (regardless of what sequence is chosen) or else the system in one variable defined by the last AI-minor has a solution.

PROOF. The sufficiency of the condition has been already demonstrated. For necessity, assume the system has a solution. Then this determines a solution of the system defined by an immediate AI-minor, and this property is carried through the successive AI-minors. So if none of the successive AI-minors is I-definite, then the system in one variable defined by the last AI-minor has a solution. 3.

NON-NEGATIVE SYSTEMS OF LINEAR INEQUALITIES

Systems such as (l), in which none of the constant terms bi is negative, will be called non-negative systems of linear inequalities. In the previous section it was noted that the successive formation of AI-minors preserves homogeneity. This happens to be a special case of a more general property, namely:

LEMMA 1. An AI-minor of a non-negative system okjkes a non-negative system in one less variable.

This follows immediately from the expressions for the constant terms in the inequalities (42) and (8) (noting that a,, >0 and ai1 < 0).

LEMMA 2. A non-negative system in one variable has a solution if and only if the system is I-definite.

This is trivial. We can now improve Theorem 1 for non-negative systems.

ZAVDI L. LICIITMAN

182

THEOREM2. A non-negative system of linear inequalities has a solution if and only if it has an AI-minor which i.s I-definite.

PROOF. Immediately lemmas. 4.

FINDING

follows from Theorem

INTEGER

1 and the previous two

SOLUTIONS

The basic idea behind the process of variable elimination is expressed by (5). The conjunction of these inequalities insures that a non-empty range has been reserved for the variable eliminated. A reasonable line of investigation which we shall now follow is to see what happens when we reserve a unit range for each variable eliminated. This will insure that every variable eliminated has an integer value (and possibly two integer values) reserved for it. Doing that, the inequalities (5) through (8) become (5’) through (8’) for i = i,, . . . , t;, j = jl, . . . , jN:

(5’)

(z-$+...

+(+xn>$-$+l,

(ailajz- ai,ai2)x2 -t-. . . -t (ui,ai, - uilui,)x~ > a,,$ - ai,bi - ailail,

(B’) (7’) (8’)

But - uilql >0; thus the only effect of reserving a unit range for each variable eliminated is to increase the values of the constant terms in the inequalities represented by (8’). We shall call such an AI-minor an integer AZ-minor. In particular, Lemma 1 applies also to integer AI-minors, i.e., the operation of deriving an integer AI-minor preserves non-negativity. The system (42) together with (8’) no longer corresponds to (1) as described in Sec. 2. But if we can solve in integers one of the (successive) integer AI-minors, then we are assured that the original system has integer

183

!3olutbns tosystem.s of Liflearzne9uulitia

solutions. Note that even when this procedure enables us to establish the existence of integer solutions, it will, in general, only produce some of the solutions. The above observations about integer AI-minors lead immediately to the following theorem.

THEOREM 3. If (the coefficient matrix of) a system of linear inequulitks has an I-minor which is I-definite, then the system has an integer solution. And this condition is necessary as well as sufficient for non-negative systems:

THEOREM 4. A mm-negative system of linear inequulities solution if and only if it has an I-minoT which is I-definite.

bus an integer

PROOF. That the condition is sufficient follows from Theorem 3. Its necessity follows from Theorem 2, viz., if the condition does not hold, there are no solutions at all.

COROLLARY. If a non-negative system of linear inequalities (real-valued) solution, then it also has an integer solution.

has any

PROOF. Follows immediately from Theorems 2 and 4. Systems of linear inequalities which do not have an I-minor which is I-definite may, of course, have integer solutions. Such a solution is readily available if when deriving integer AI-minors, none of them being I-definite, the last one which defines a system in one variable has an integer solution. When the adapted variable-elimination method (reserving unit ranges) does not provide an integer solution for a system that has real solutions, the following is possible: one might be able to locate integer solutions (if there are any) using appropriate backtrack search techniques, starting from the range determined for the variable corresponding to the final (not integer) AI-minor developed in the elimination procedure. The same approach could be used when the adapted method provides integer solutions, but one wishes to study integer solutions not covered by the derived sequence of integer M-minors.

ZAVDI L. LICHTMAN

164

5.

COMPUTATIONAL

ASPECTS

As was seen in Sec. 2, a minor has one less column than its predecessor, but PN+ Z rows. Eliminating one column from a matrix with m rows, can produce in the worst case a new matrix with (m/2)’ rows. In general, the number of rows in the kth minor can be at most

Clearly, if actual storage requirements approach these bounds, then the whole method is impractical. The most obvious strategy [l] to employ is to eliminate at each step the column which will cause the minimal expansion; this is called the minimal elimination strategy. Unfortunately, it is not at all obvious that this strategy will enable us to carry out the procedure within a reasonable amount of time and storage. One is also led to inquire whether this strategy minimizes the storage requirement. In order to gain some insight into these questions, we have conducted a very limited experimental study. The minimal elimination strategy was applied to fifty (coefficient) matrices, five each of the sizes 8 X 3,8 X4,. . . ,8 X 12. The matrices were randomly generated, so that they had very few zeros and about an equal number of positive and negative elements. Of them, 43 were found to have I-definite I-minors and 7 did not. Table 1 gives the average number of rows and the actual worst case after each elimination step. TABLE 1 THE

VARIABLE-ELIMINATION

METHOD

APPLIED

TO 50

8-ROW

No. of eliminations

No. of cases

Average No. of rows

MaXinlUIII No. of rows

1 2 3 4

50 29 17 2

9.5 16.7 67 237

36 241 440

15

MATRICES

Bound on No. of rows P=lS 2s=64 2’0 = 1024 21s=262,144

These results suggest that the strategy makes the method feasible for small systems of linear inequalties. The growth is not nearly as bad as one might suppose from (9). It is also possible to curb expansion by using rules for removing redundant inequalities [5,8].

sozution.s to systems of Linear

I?wquaziEies

185

We defined the total storage required for a sequence of eliminations as the sum of the numbers of entries in all the I-minors generated, including the original matrix. Using a backtrack procedure, we determined for each matrix the sequence of eliminations which minimized the total storage requirement. Not surprisingly, the strategy sometimes fails to be optimal. The strategy is, however, reasonably efficient in this respect. Only in 15 cases (which is about half, if we ignore the 21 matrices that became I-definite after the first elimination) was the storage requirement of the strategy not optimal. However, of these, in 10 cases the improvement of the best sequence over the sequence generated by the strategy was less than 2 : 1, in four cases it was less than 3 : 1, and in one case it was about 7 : 1. Throughout the formation of successive I-minors the coefficients tend to grow in magnitude quite rapidly, so that some resealing may be necessary. The running time for the procedure is essentially proportional to the storage requirements, and the time per element generated is very small.

6.

CONCLUSION

We have used the variable-elimination method to show that a non-negative system of linear inequalities has a solution if and only if it has an I-definite I-minor. Therefore, if it has any (real) solution, it also has an integer solution. In many cases an adaptation of the variable-elimination method can provide some integer solutions directly. But if we want all of them or the adapted method fails, it is suggested to perform a backtrack search on the (parametric) intervals determined for the real solutions. Limited experience with an experimental implementation indicates that when using the minimal elimination strategy the method is practical for small systems of linear inequalities. The author is grateful to E. E. Sibert fm many helpful dimmions. REFERENCES 1 2

3 4

J. Abadie, The dual to Fourier’s method for solving linear inequalities, Int. Symp. on Mathematical Programming, London, 1964. S. N. Chemikov, The solution of linear programming problems by elimination of unknowns, DokZ. Akad. Nauk SSSR 139 (E-%1), 1314-1317; transl. So&t Math. LIokZ.2, 1099-1103. G. B. Dantzig and B. C. Eaves, Fourier-Motzkin, elimination and its dual, Dept. of Operations Research Report, Stanford Univ., Jan. 1973. L. L. Dines, Systems of linear inequalities, Ann. of Math. 20 (1919), 191-199.

186 5 6 7 8 9

ZAVDI L. LIcHTMAN R. J. Duffin, On Fourier’s analysis of linear inequality systems, VIII Int. Symp. on mathematical programming, Stanford Univ., Aug. 1973. J. B. J. Fourier, Solution d’une question particuliere du calcul des inegalities, in Oeowes, Vol. II, Paris, 1899, p. 1926. H. W. Kuhn, Solvability and consistency for linear equations and inequalities, Amer. Math. Monthly 63 (1956), 217-232. D. A. Kohler, Projections of convex polyhedral sets, Operations Research Center Report 67-29, Univ. of California, Berkeley, 1967. D. A. Kohler, Translation of a report by Fourier on his work on linear inequalities, Opsearch 10 (1973), 38-42.