SOLVING A PERMUTATION PROBLEM BY A FULLY POLYNOMIAL-TIME APPROXIMATION SCHEME
Stanis law Gawiejnowicz, Wies law Kurc and
Lidia Pankowska Adam Mickiewicz University
Faculty of Mathematics and Computer Science, Poland e-mails: {stgawiej, wkurc, lpankow}@amu.edu.pl
Abstract
For a problem of optimal discrete control with a discrete control set composed of vertices of an n-dimensional permutohedron, a fully polynomial-time approximation scheme is proposed.
Keywords: combinatorial optimization, discrete control theory, fully polynomial-time approximation scheme.
2000 Mathematics Subject Classification: 90C27, 49N05, 68M20.
1. Introduction
In this paper, we consider a problem of an optimal discrete control with a discrete control set composed of vertices of an n-dimensional permutohedron.
The problem can be formulated as follows. Let a ◦ = (a ◦ 1 , a ◦ 2 , . . . , a ◦ n ) be a sequence of non-negative coefficients a ◦ i > 1, where i = 1, 2, . . . , n. The control set Π(a ◦ ) is composed of all permutations of the sequence a ◦ . Given any control a = (a 1 , a 2 , . . . , a n ) ∈ Π(a ◦ ), the transition function is given by
Z i = a i Z i−1 + 1 for i = 1, 2, . . . , n with Z 0 = 1, and the aim is to minimize the goal function P n
i=0 Z i over all a ∈ Π(a ◦ ).
For simplicity of further presentation, we will refer to the above problem as
to the problem (P ). For this problem, we propose a fully polynomial-time approximation scheme (an FPTAS).
2. Preliminary results
Applying the matrix approach (Gawiejnowicz et al. [2, 3], Gawiejnowicz [1]), the problem (P ) can be formulated as follows:
(P )
( min W P (a) , ||Z(a)|| 1
s.t. A(a)Z(a) = b, a ∈ Π(a ◦ ),
where a = (a 1 , a 2 , . . . , a n ), b = (b 0 , b 1 , . . . , b n ) > , with b j = 1 for j = 0, 1, . . . , n, Z(a) = (Z 0 , Z 1 , . . . , Z n ) > and
A(a) =
1 0 . . . 0 0
−a 1 1 . . . 0 0 0 −a 2 . . . 0 0 .. . . . . .. . 0 0 . . . −a n 1
.
Since
A −1 (a) =
1 0 . . . 0 0
a 1 1 . . . 0 0
a 1 a 2 a 2 . . . 0 0
a 1 a 2 a 3 a 2 a 3 . . . 0 0 .. . .. . . . . .. . .. . a 1 a 2 . . . a n a 2 a 3 . . . a n . . . a n 1
exists, Z(a) = A −1 (a)b and hence W P (a) , ||Z(a)|| 1 = ||A −1 (a)b|| 1 = P n
j=0
P j
i=0 a i+1 · · · a j , where an empty product is assumed to be equal to 1. In other words, W P (a) is the sum of all elements of the matrix A −1 (a).
Hence, ||Z(a)|| 1 = ||Z(a)|| 1 , where a = (a n , a n−1 , . . . , a 1 ).
Let us distinguish the sum Z n of elements of the last row and the first column of A −1 (a), i.e., Z n = Z n (a) = P n
i=0 a i+1 · · · a n and Z n (a) = P n
j=0 a 1 · · · a j .
Given a ∈ Π(a ◦ ), let us define the function L(a) , W P (a) − (n + 1),
in which the diagonal of A −1 (a) in the sum W P (a) is omitted. Let us also
define M (a) , Z n (a)−1 and M (a) , Z n (a)−1. Notice that the goal function L(a) can be used interchangeably with W P (a).
For the problem (P ), the following V-shape property (Mosheiov [5]) is known: if a ? ∈ Π(a ◦ ) is an optimal solution to (P ), then a ? must be V - shaped, i.e., −a ? is unimodal with the maximum −a k attained for some 1 ≤ k ≤ n.
Since in subsequent sections we will consider (1 + )−approximation algorithms, we formulate now the following definition of the notion, assuming that only finite size instances of the problem (P ) will be considered.
Definition 1. An algorithm A P is called (1 + )-approximation algorithm for the problem (P ), if for each instance a ◦ of the problem (P ) it delivers a feasible solution with objective value A P (a ◦ ) such that
|A P (a ◦ ) − W P (a ? )| ≤ W P (a ? ),
where > 0 is an accuracy of solution, W P is the objective function of the problem (P ) and a ? is the optimal solution to the problem (P ).
From Definition 1 it follows that
A P (a ◦ ) ≤ (1 + )W P (a ? ).
The factor ρ = 1 + is called the worst-case ratio for the algorithm A P . The next definition concerns a family of (1 + )-approximation algorithms.
Definition 2. The family {A P } of (1 + )-approximation algorithms for the problem (P ) is called a fully polynomial-time approximation scheme (an FPTAS), if for any > 0 the time complexity of the algorithm A P is polynomial in the input size #a ◦ and in 1 .
Now, we introduce a number of formulae that will be applied in subsequent sections. The formulae concern concatenated sequences u = (u 1 , u 2 , . . . , u r ) and v = (v 1 , v 2 , . . . , v s ). Let u|v = (u 1 , u 2 , . . . , u r , v 1 , v 2 , . . . , v s ) denote the concatenation of sequences u and v in the given order. Then
M (u|v) = v 1 v 2 · · · v s (u 1 u 2 · · · u r + . . . + u r ) + (v 1 v 2 · · · v s + . . . + v s )
= M (v) + v 1 v 2 · · · v s M (u).
Moreover, for L(u|v) = ||Z(u|v)|| 1 − (r + s + 1), we have
L(u|v) = L(u) + L(v) + (u 1 · · · u r + . . . + u r )v 1 + . . . + + (u 1 · · · u r + . . . + u r )v 1 v 2 · · · v s
= L(u) + L(v) + M (u)(v 1 + . . . + v 1 v 2 · · · v s ).
Thus, if we denote π(v) = v 1 v 2 · · · v s , we obtain the following result.
Lemma 1. There hold the following equalities:
(a) M (u|v) = M (v) + π(v)M (u), (b) L(u|v) = L(u) + L(v) + M (u)M (v).
From Lemma 1 it follows the next result, concerning the case of concatena- tion of three sequences, u|a|v, where u = (u 1 , u 2 , . . . , u r ), a = (a 1 , a 2 , . . . , a n ) and v = (v 1 , v 2 , . . . , v s ).
Lemma 2. There hold the following equalities:
(a) M (u|a|v) = M (v) + π(v)M (a) + π(a)π(v)M (u),
(b) L(u|a|v) = L(u)+L(a)+L(v)+M (u)M (a)+M (a)M (v)+π(a)M (u)M (v).
As an aplication of the above formulae, let us consider two concatenations, u|a|v and u 0 |a|v 0 . In view of part (b) of Lemma 2, we obtain the following general formula
L(u 0 |a|v 0 ) − L(u|a|v) = L(u 0 ) − L(u) + L(v 0 ) − L(v)
+ M (a)(M (u 0 ) − M (u)) + M (a)(M (v 0 ) − M (v)) + π(a)(M (u 0 )M (v 0 ) − M (u)M (v)).
In particular, for u 0 = v and v 0 = u we obtain the following result.
Lemma 3. There holds the following equality:
L(v|a|u) − L(u|a|v) = M (a)(M (v) − M (u)) + M (a)(M (u) − M (v)) + π(a)(M (v)M (u) − M (u)M (v)).
If u = (p) and v = (q), by Lemma 3 we obtain the formula
(1) L(q|a|p) − L(p|a|q) = (q − p)(M (a) − M (a)) = (q − p)S − (a), where S − (a) , M(a) − M(a) denotes the so-called signature (we refer the reader to Gawiejnowicz et al. [2, 3] for details).
We complete the section by a result that is an application of formula (1).
Theorem 1 ([2, 3]). Let a ↑ = (a 1 , a 2 , . . . , a n ) be a non-decreasingly ordered sequence for the problem (P ) and let p = a 2k−1 , q = a 2k , where 1 ≤ k ≤ φ(n) for a suitable φ. Let (p|u|q) and (q|u|p) denote concatenations of a partial V-shaped sequence u, composed of the elements of a ↑ , with p and q in the given order, respectively. Then there hold implications:
(a) if S − (u) ≥ 0, then L(p|u|q) ≤ L(q|u|p) (b) if S − (u) ≤ 0, then L(p|u|q) ≥ L(q|u|p).
Theorem 1 leads to a greedy algorithm (cf. [2, 3]) based on consecutive concatenations of elements of the sequence a ↑ . The function φ(n) will be defined in the next section.
3. Dynamic programming algorithms
In this section, following Woeginger [6], we formulate two dynamic program- ming algorithms for the problem (P ). Both these algorithms go through φ(n) phases, where φ(n) is a function that can be computed in a polynomial time with respect to n. The general idea of these algorithms is as follows.
The k-th phase, 1 ≤ k ≤ φ(n), produces a set S k of states S. Any state in S k ∈ S is a vector S = [s 1 , s 2 , . . . , s β ] > ∈ Q β + , where Q + denote the set of positive rational numbers and β ≥ 1 is a fixed natural number. In the problem (P ), the vectors S are related to partial V-shaped sequences a S that concern the first k coefficients of a non-decreasing rearrangement a ↑ of a given sequence a ◦ .
The sets of states S 1 , S 2 , . . . , S k , 1 ≤ k ≤ φ(n), are constructed itera- tively. Given an initial set S 0 , {S 0 }, the k-th set S k is obtained from the set S k−1 by applying a fixed number of mappings F 1 , F 2 , . . . , F s which translate the states of the set S k−1 into the states of the set S k . More precisely,
S k = {F (X k , S) : S ∈ S k−1 , F ∈ F ≡ {F 1 , F 2 , . . . , F s }},
where 1 ≤ k ≤ φ(n).
Non-negative vectors X 1 , . . . , X φ(n) , where X k = [x k 1 , x k 2 , . . . , x k α ] > ∈ Q α + with a natural fixed α ≥ 1, are arranged in a prescribed way within the algorithm DP for a given input data a ◦ . For our purposes, we will assume that X k = [a (k−1)α+1 , . . . , a kα ] > , for k = 1, 2, . . . , φ(n), where φ(n) = b n α c+1 if n is not a multiple of α, and φ(n) = n α otherwise. In the first case, X φ(n) contains residual components of a ↑ .
Let G be a non-negative function defined for the states S = [s 1 , s 2 , . . . , s β ] > . Throughout the paper, we assume that G(S) = s 1 , where s 1 = L(a S ) and a S is a partial V-shaped sequence corresponding to S.
The above assumptions describe the untrimmed dynamic programming algorithm, called DP. The trimmed version of the algorithm DP, called T DP, uses an approximation procedure introduced by Ibarra and Kim [4].
The crucial point is the ”trimming-the-state-space” technique (cf. [6]), which ”clean up” and ”thin out” the state spaces S k in a proper way.
The untrimmed and trimmed versions of these DP algorithms can be formulated as follows.
Algorithm DP Algorithm TDP
S 0 := {S 0 }; T 0 := S 0 := {S 0 };
for k := 1 to φ(n) do for k := 1 to φ(n) do
S k := ∅; U k := ∅;
for every S ∈ S k−1 and F ∈ F do for every T ∈ T k−1 and F ∈ F do add F (X k , S) to S k ; add F (X k , T ) to U k ;
end end
compute a trimmed copy T k of U k ;
end end
return min{G(S) : S ∈ S φ(n) } return min{G(T ) : T ∈ T φ(n) } Let a given sequence a ◦ , with a non-decreasing rearrangement a ↑ , be fixed.
Let ba = max i=1,...,n {a i }. Let the parameters α, β and s also be fixed. The mappings F i : Q α + × Q β + −→ Q β + from the set F = {F 1 , F 2 , . . . , F s } are given by formulae S 0 = F i (X k , S), where S 0 = [s
01 , s02 , . . . , s0β ] > . (The particular form of F i (X k , S) will be specified below.) The following two conditions, (C1) and (C2), will be satisfied by the dynamic programming algorithms for the problem (P ) :
β ] > . (The particular form of F i (X k , S) will be specified below.) The following two conditions, (C1) and (C2), will be satisfied by the dynamic programming algorithms for the problem (P ) :
(C1) the formulae F i (X k , S) can be evaluated in a polynomial time as func-
tions of components of X k = [x k 1 , x k 2 , . . . , x k α ] > and S = [s 1 , s 2 , . . . , s β ] > ;
(C2) for any state S = [s 1 , s 2 , . . . , s β ] > and for each component s i , there holds the estimation 0 < s i ≤ e p (n,log ba) for a certain polynomial p(n, log ba) of variable n and natural logarithm log ba.
Given > 0, let ∆ = 1+ 2φ(n) . Let J be the smallest possible natural number such that e p (n,log ba) ≤ ∆ J . Without loss of generality, we can choose
J =
p(n, log ba) log(∆)
≤
1 + 2φ(n)
p(n, log ba)
,
since the latter inequality follows from the inequality log(x) ≥ 1−x x for x ≥ 1.
Let us divide the cube [0, ∆ J ] β into (J + 1) β boxes along lines that are perpendicular to respective axis at the points ∆ j , where j = 0, 1, 2, . . . , J.
These boxes will be called ∆-boxes.
Definition 3 ([6]). The states S = [s 1 , s 2 , . . . , s β ] > and S 0 = [s
01 , s02 , . . . , s0β ] >
β ] >
are said to be ∆-close, if s i ∆ −1 ≤ s 0 i ≤ s i ∆ for i = 1, 2, . . . , β.
Notice that if S and S 0 are in the same ∆−box, then for s i and s 0 i there holds ∆ j−1 ≤ s 0 i , s i ≤ ∆ j for some j. Hence ∆ −1 ≤ s 0 i /s i ≤ ∆.
The trimming is defined as follows.
Definition 4 ([6]). If the state sets U and T belong to [0, ∆ J ] β , then T is said to be a trimmed copy of U, if (i) T ⊂ U and (ii) for every ∆-box B with B ∩ U 6= ∅ the set T contains exactly one state S ∈ B ∩ U.
Clearly, each state S from condition (ii) of Definition 4 is ∆-close to each element of B ∩ U.
4. Fully polynomial-time approximation scheme
In this section, we prove that for any fixed > 0 the trimming procedure added to the untrimmed dynamic algorithm algorithm DP leads to such a solution which can be only (1 + )-times worst than the original one.
In order to do this, we need to know that the problem (P ) is DP -simple
(cf. [6]). This means that the optimal solution to the problem (P ), with
the criterion L(a), is equal to G(S ? ), where S ? ∈ S φ(n) is determined by
the algorithm DP. This, in turn, requires an additional knowledge concern-
ing the formulae F i (X k , S) in the algorithm DP. Hence, now we describe
precisely how to obtain the copy of U k in the case α = 1.
In the k-th phase, X k = [a k ] > and it consists of the k-th element from non-decreasing rearrangement a ↑ = (a 1 , a 2 , . . . , a n ) of the sequence a ◦ . In this case, φ(n) = n. Let a = a S be any (k − 1)−element V-shaped se- quence obtained at the (k − 1)-th phase, with the corresponding state vec- tor S = [L(a), M (a), M (a), Π(a)] > from T k−1 for T DP and from S k−1 for DP, respectively. Then, the new set of states is given by
U k = [
T ∈T
k−1{F 1 ([a k ] > , T ), F 2 ([a k ] > , T )}
for T DP and
S k = [
S∈S
k−1{F 1 ([a k ] > , S), F 2 ([a k ] > , S)}
for DP, respectively, where
F 1 ([a k ] > , S) = F 1 ([a k ] > , T ) = [L(a k |a), M (a k |a), M (a k |a), π(a k |a)] > , F 2 ([a k ] > , S) = F 2 ([a k ] > , T ) = [L(a|a k ), M (a|a k ), M (a|a k ), π(a|a k )] > . The concatenation formulae for L(p|a), L(a|p), M (p|a) and M (a|p), given in Lemmata 1–3, can be applied in order to obtain formulae for computing the components of new states in a polynomial time. In particular, denot- ing the above mentioned state S by [s 1 , s 2 , s 3 , s 4 ] > , we obtain new states S
0= [s
01 , s02 , s03 , s04 ] > in U k or S k , respectively, computed by means of map- pings from F = {F 1 , F 2 }, where
3 , s04 ] > in U k or S k , respectively, computed by means of map- pings from F = {F 1 , F 2 }, where
F 1 ([a k ] > , S) = [s 1 + a k (s 3 + 1), s 2 + a k s 4 , a k (s 3 + 1), a k s 4 ] > , F 2 ([a k ] > , S) = [s 1 + a k (s 2 + 1), a k (s 2 + 1), s 3 + a k s 4 , s 4 a k ] > .
To be more clear, if we have G(S) = s 1 , where s 1 = L(a S ) in the state S ∈ S k−1 , then for S
0∈ S k we get G(S
0) = s 1 + a k (s 3 + 1) in the case of L(a k |a) and G(S
0) = s 1 + a k (s 2 + 1) in the case of L(a|a k ). We proceed in this way for k = 1, 2, 3, . . . , n, starting with T 0 := S 0 , {[1, 1, 1, 1] > } and the empty sequence a S0 , ().
Lemma 4. Let ba = max i=1,...,n {a i } for a given sequence a ◦ for the prob-
lem (P ). Then the algorithm DP satisfies conditions (C1) and (C2), with
the polynomial p(n, log ba) = 1 2 n(n + 1) + n log ba − 1.
P roof. The condition (C1) follows from the formulae for F 1 ([a k ] > , S) and F 2 ([a k ] > , S) given above. To prove that the condition (C2) is satisfied, notice that L(a k |a), M (a k |a), M (a k |a), a k π(a), with a = a S for S ∈ S k−1 , are less or equal to L(a S ) with S ∈ S n . Let us write for simplicity that a S = (a 1 , . . . , a n ). Since L(a S ) is the sum of all elements of A −1 except the diagonal, then majorizing these a i by ba it is not difficult to show that
L(a S ) ≤ n · ba + (n − 1) · ba 2 + . . . + ba n ≤ n(n + 1)
2 · ba n ≤ e
n(n+1)
2