University of Birmingham A note on tropical linear and integer programs

We present a new, simple compact proof of the known strong duality theorem of tropical linear programming with one-sided constraints. This result together with properties of subeigenvectors enables us to directly solve a special tropical linear program with two-sided constraints. We also study the duality gap in tropical integer linear programming. A direct solution is available for the primal problem. An algorithm of quadratic complexity is presented for the dual problem. A direct solution is available provided that all coefﬁcients of the objective function are integer. This solution provides a good estimate of the optimal objective function value in the general case.


Introduction
Tropical linear algebra (also called max-algebra or path algebra) is an analogue of linear algebra, where addition is replaced by maximization and multiplication by conventional addition.
The interest in tropical linear algebra was originally motivated by the possibility of dealing with a class of nonlinear problems in pure and applied mathematics, operational research, science and engineering as if they were linear due to the fact that the underlying structure is a commutative and idempotent semifield. Besides the main advantage of using linear rather than nonlinear techniques, tropical linear algebra enables us to efficiently describe and deal with complex sets (see Butkovič [1]), reveal combinatorial aspects of problems (see Butkovič [2]) and view a class of problems in for all i, j. If α ∈ R, then α ⊗ A = α ⊗ a i j . For simplicity, we will use the convention of not writing the symbol ⊗. Thus, in what follows the symbol ⊗ will not be used (except when necessary for clarity), and unless explicitly stated otherwise, all multiplications indicated are in max-algebra. Consider the following motivational example (see Cuninghame-Green [5]). Products P 1 , . . . , P m are prepared using n machines (or processors), every machine contributing to the completion of each product by producing a partial product. It is assumed that each machine can work for all products simultaneously and that all these actions on a machine start as soon as the machine starts to work. Let a i j be the duration of the work of the jth machine needed to complete the partial product for P i (i = 1, . . . , m; j = 1, . . . , n). If this interaction is not required for some i and j, then a i j is set to −∞. The matrix A = a i j is called the production matrix. Let us denote by x j the starting time of the jth machine ( j = 1, . . . , n). Then, all partial products for P i (i = 1, . . . , m) will be ready at time Hence, if b 1 , . . . , b m are given completion times, then the starting times have to satisfy the system of equations: Using max-algebra, this system can be written in a compact form as a system of linear equations: A system of the form (1) is called a one-sided system of max-linear equations (or briefly a one-sided max-linear system or just a max-linear system). Such systems are easily solvable (see Cuninghame-Green [3], Butkovič [12] and Zimmermann [7]; see also the end of this section). In applications, it may be required that the starting times are as small as possible (to reflect the fact that the producer has free capacity and wishes to start production as soon as possible). This means to minimize the value of with respect to (1). In general, we may need to minimize (or possibly to maximize) a max-linear function, that is, where Thus, the max-linear programs are of the form Sometimes the vector b is given to require the earliest or latest rather than exact completion times. In such cases, the constraints of the optimization problem are Ax ≥ b or, Ax ≤ b. In some cases, two processes with the same starting times and production matrices, say, A and B, have to be coordinated so that the products of the second are completed not before those completed by the first and possibly also not before given time restrictions given by a vector d = (d 1 , . . . , d m ) T . Then, the constraints have the form In full generality, max-linear programs are of the form These have been first studied by Butkovič and Aminu (see [17]) with pseudopolynomial methods later presented by Akian et al. [23] and Gaubert et al. [18]. No polynomial solution method seems to exist in general, not even for feasibility checking, although it is known that this problem in N P ∩ co-N P; see Bezem et al. [24].
Throughout the paper, we denote −∞ by ε (the neutral element with respect to ⊕), and for convenience, we also denote by the same symbol any vector, whose all components are −∞, or a matrix whose all entries are −∞. A matrix or vector with all entries equal to 0 will also be denoted by 0. If a ∈ R, then the symbol a −1 stands for −a.
It is easily proved that if A, B, C and D are matrices of compatible sizes (including vectors considered as m × 1 matrices), then the usual laws of associativity and distributivity hold and also isotonicity are satisfied: A square matrix is called diagonal if all its diagonal entries are real numbers and off-diagonal entries are ε. More precisely, if The matrix diag (0) is called the unit matrix and denoted I . Obviously, AI = I A = A whenever A and I are of compatible sizes. A matrix obtained from a diagonal matrix [unit matrix] by permuting the rows and/or columns is called a generalized permutation matrix [permutation matrix]. It is known that in tropical linear algebra generalized permutation matrices are the only type of invertible matrices (see Cuninghame-Green [5] and Butkovič [12]). Clearly, If A is a square matrix, then the iterated product A A...A in which the symbol A appears k-times will be denoted by A k . By definition, A 0 = I . Given A ∈ R n×n , it is usual (see Cuninghame-Green [5], Baccelli et al. [8], Heidergott et al. [11] and Butkovič [12]) in max-algebra to define the infinite series The matrix A * is called the strong transitive closure of A, or the Kleene Star. It follows from the definitions that every entry of the matrix sequence is a non-decreasing sequence in R, and therefore, either it is convergent to a real number (when bounded), or its limit is +∞ (when unbounded). If λ(A) ≤ 0, then for every k ≥ n and can be found using the Floyd-Warshall algorithm in O n 3 time (see Butkovič [12]). The matrix λ −1 A for λ ∈ R will be denoted by A λ and (A λ ) * will be shortly written as A * λ .
Given A = (a i j ) ∈ R n×n , the symbol D A will denote the weighted digraph The symbol λ(A) will stand for the maximum cycle mean of A, that is: where the maximization is taken over all elementary cycles in D A and denotes the mean of a cycle σ . With the convention max ∅ = ε, the value λ (A) always exists since the number of elementary cycles is finite. An O n 3 algorithm for finding λ (A) has been first presented by Karp [25] (see also Butkovič [12]). Observe that The tropical eigenvalue-eigenvector problem (briefly eigenproblem) is the following: This problem has been studied since the work of Cuninghame-Green. An n × n matrix has up to n eigenvalues with λ (A) always being the largest eigenvalue (called principal). This finding was first presented by Cuninghame-Green [5] and Gondran and Minoux [6] (see also Vorobyov [4]). The full spectrum was first described by Gaubert [14] and Bapat et al. [15]. The spectrum and bases of all eigenspaces can be found in O(n 3 ) time (see Butkovič et al. [26] and Butkovič [12]).
The aim of this paper is to study integer solutions to tropical linear programs, and therefore, we summarize here only the results on finite solutions and for finite A and b. The following has been proved by Cuninghame-Green [5] and Gondran and Minoux [6].

Theorem 2.1 If A ∈ R n×n , then λ (A) is the unique eigenvalue of A and all eigenvectors of A are finite.
For details, see Butkovič [12].
If A ∈ R n×n and λ ∈ R, then a vector x ∈ R n , x = ε satisfying is called a subeigenvector of A with associated subeigenvalue λ. We denote V * (A, λ) = {x ∈ R n : Ax ≤ λx}. The following has been proved by Butkovič and Schneider [27]. Similarly as in Cuninghame-Green [5] and Butkovič [12], we define min-algebra over R by = min(a, b) and for all a and b. We extend the pair of operations ⊕ , ⊗ to matrices and vectors in the same way as in max-algebra.
We also define the conjugate A # = −A T . It is easily seen that and whenever A and B are compatible. Further, for any u ∈ R n we have and We will usually not write the operator ⊗ , and for matrices, the convention applies that if no operator appears, then the product is in min-algebra whenever it follows the symbol #, otherwise it is in max-algebra. In this way, a residuated pair of operations (a special case of the Galois connection) has been defined, namely for all x, y ∈ R n . Hence Ax ≤ y implies A(A # y) ≤ y. It follows immediately that a one-sided system Ax = b has a solution if and only if A A # b = b and that the system Ax ≤ b always has an infinite number of solutions with A # b being the greatest solution. . . . , c n ) T ∈ R n and consider the following primal-dual pair of tropical linear programs: Let us denote S P = {x ∈ R n : Ax ≤ b} and S D = π ∈ R m : π T A ≥ c T . The sets of optimal solutions will be denoted S opt P and S opt D , respectively. The optimal objective function values will be denoted f max and ϕ min .

Theorem 3.1 (Weak Duality Theorem) The inequality c T x ≤ π T b holds for any x ∈ S P and π ∈ S D .
Proof By isotonicity and associativity, we have The following was proved by Superville [22]. We aim to provide here a substantially simpler proof. We first prove a lemma: and the rest follows by isotonicity of ⊗.
Proof (Of strong duality.) Let us denote t = c T A # b and set π T = tb # . It remains to prove that π is dual feasible and π T b = t. Using associativity and isotonicity (5) and also (12) and (14), we have On the other hand (using (13)) which completes the proof.
It follows that there is no duality gap for the pair of programs (P) and (D). Their optimal solutions are x = A # b (no matter what c is) and π T = c T A # b b # , respectively. Their common objective function value is c T A # b . If A, b, c are integer, then there is also no duality gap for the corresponding pair of integer programs since then both x and π are integer. However, this is not the case when some of A, b, c are noninteger and the question of a duality gap arises. This question will be discussed in the next section.

Dual Integer Programs
Let A = a i j ∈ R m×n , b = (b 1 , . . . , b m ) T ∈ R m , c = (c 1 , . . . , c n ) T ∈ R n and consider the following pair of tropical integer programs: Let us denote S P I = {x ∈ Z n : Ax ≤ b} and S DI = π ∈ Z m : π T A ≥ c T . The sets of optimal solutions will be denoted S opt P I and S opt DI , respectively. The optimal objective function values will be denoted f max I and ϕ min I . It follows immediately from residuation that Solving (DI) is less straightforward but can be done directly when b ∈ Z m . This will be shown below, but first we answer a principle question for general (real) A, b and c. Proof Since S DI is a closed, non-empty set and ϕ is continuous and bounded below due to the weak duality theorem, we only need to prove that S DI can be restricted to a bounded set without affecting ϕ min I . Let U = ϕ (π 0 ) for an arbitrarily chosen π 0 ∈ S DI and L be any lower bound following from the weak and strong duality theorems. Then, disregarding π ∈ S DI with π i > U − b i for at least one i will have no affect on ϕ min I . Similarly, disregarding those π (if any) where π i < L − b i for at least one i. Hence for solving (DI), we may assume without loss of generality that The feasible set in (DI) is now restricted to a compact set and the statement follows.
We will transform (DI) to an equivalent "normalized" tropical integer program. Let us denote B = diag (b) , C = diag (c) and σ T = π T B. Hence π T = σ T B −1 , π T b = σ T 0 and the inequality in (DI) is equivalent to 16) or, component-wise: Proof If b ∈ Z m , then π is integer if and only if σ is integer; the rest follows from the previous discussion.
By Proposition 4.3, we may restrict our attention to constant vectors when searching for optimal solutions of (DI'). If σ T = (s, . . . , s), then (16) reads This can also be written as Since t is the minimal possible integer value of s, we have We have proved: We also conclude that π T = t0 T B −1 = tb # is an optimal solution of (DI) with ϕ min Therefore, the duality gap for the pair (PI)-(DI) when b ∈ Z m is the interval A solution method for dual integer programs without the assumption b ∈ Z m is presented in Chapter 6.

Using Duality for Solving a Two-Sided Linear Program
We will now use the results of Sect. 3 to directly solve a special tropical linear program with two-sided constraints.
Consider the two-sided tropical linear program min g (y) = c T y, s.t. Ay ⊕ d ≤ y, y ∈ R n (TSLP) where A ∈ R n×n and d ∈ R n . The inequality Ay ⊕d ≤ y is equivalent to the following system of inequalities: Ay ≤ y, d ≤ y.
The first of these inequalities Ay ≤ y describes the set of (finite) subeigenvectors of A (see Sect. 2) corresponding to λ = 0, that is V * (A, 0). By Theorem 2.2, this set is non-empty if and only if λ (A) ≤ 0. Therefore, we suppose now that this condition is satisfied. By homogeneity of Ay ≤ y, we may assume that a subeigenvector sufficiently large exists and in particular one that also satisfies y ≥ d. This implies that the feasible set of TSLP is non-empty. Let us denote By Theorem 2.2, we have where A * is the Kleene star defined by (6). Hence, g (y) = c T A * u and (TSLP) now reads (in the form of a dual problem): In order to use the results of Sect. 3, we substitute as follows: This yields the vector as an optimal solution of (TSLP) where The optimal objective function value is Computationally, the most demanding part here is the calculation of A * which is O n 3 . We conclude that (TSLP) can be solved directly in O n 3 time.
We finish this section by a remark on a tropical linear program obtained from TSLP by replacing the inequalities with equations: It is known (see Butkovič et al [13]) that if we denote then assuming λ (A) ≤ 0 again we have since for sufficiently small v (which can be assumed by homogeneity of Note that if λ (A) < 0, then S = {A * d} and so (TSLP2) has a non-trivial set of feasible solutions if and only if λ (A) = 0.

Remark 5.1
If B is an invertible matrix (that is, a generalized permutation matrix), then the system Ay ⊕ d ≤ By easily transforms to that in (TSLP), similarly for equations. Thus, (TSLP) and (TSLP2) actually cover a bit wider class of optimization problems.

An Algorithm for General Integer Dual Programs
The explicit solution of (DI) in Sect. 4 depends on the assumption b ∈ Z m . If b is non-integer, then Proposition 4.3 is not available and it is not clear whether a direct solution method can be produced. Therefore, we now present an algorithm for solving (DI) without any assumption on b other than b ∈ R m . Note that existence of a lower bound of the objective function follows from the weak duality theorem immediately.
First we repeat the transformation to a "normalized" tropical linear program (DI') as in Sect. 4. With the same notation, the new tropical program (but without integrality) is Now we cannot assume σ ∈ Z m since the inverse transformation π T = σ T B −1 would not produce an integer vector in general. It is also not sufficient to require σ ∈ R m in order to obtain π ∈ Z m . However, since σ i = π i + b i , π i ∈ Z, for every i we have that σ should satisfy ALGORITHM Output: An optimal solution to (DI). (diag (c)) and M i j as defined in (18)  This includes a possible pre-ordering of each of the sets M i j : j = 1, . . . , n + 1 , i = 1, . . . , m, which is O (mn log n) but can be done once before the start of the main loop.
Note that by taking b for b we get (DI) that can be solved directly (Sect. 4) and the difference between ϕ min I and ϕ min is up to 1 since π T b = π T b if π is integer. Hence, a good estimate of the optimal objective function value can be obtained by directly solving (DI) where b is replaced by b .

Conclusions
We have presented a simple proof of the known strong duality theorem of tropical linear programming with one-sided constraints. This result together with known results on subeigenvectors enables us to solve a special tropical linear program with two-sided constraints in a low-order polynomial time.
We have then studied the duality gap in tropical integer linear programming. A direct solution is available for the primal problem. An algorithm of quadratic complexity has been presented for the dual problem. A direct solution of the dual problem is available provided that all coefficients of the objective function are integer. This solution readily provides a good estimate of the optimal objective function value for general dual integer programs.