Approximation algorithms for the General and the ... - CiteSeerX

0 downloads 0 Views 1MB Size Report
May 20, 1994 - adjacent edges with a single edge between their non-common ..... is a eulerian spanning cycle, but not hamiltonian in general (fig.13). For the ...
EINDHOVEN UNIVERSITY OF TECHNOLOGY Department of Mathematics and Computing Science

Memorandum COSOR 94-20

Approximation algorithms for the General and the Asymmetric Stacker-Crane Problems Giovanni Righini

Marco Trubian

Eindhoven, June 1994 The Netherla.nds

Approximation algorithms for the General and the Asymmetric Stacker-Crane Problems * Giovanni Righini Technische Universiteit Eindhoven, Faculteit Wiskunde en Informatica 5600 MB Eindhoven, Nederland

Marco Tru bian Politecnico di Milano, Dipartimento di Elettronica e Informazione piazza Leonardo da Vinci 32, 20133 Milano, Italia 20 May 1994

Abstract The Stacker-Crane Problem (SCP) consists of finding the minimum length hamiltonian cycle on a mixed gral>h with oriented arcs and unoriented edges: feasible solutions must traverse all the arcs. Approximation algorithms are known for the case in which the triangle inequality holds. We consider the case in which the triangle inequality is violated (General SCP) and the case in which the problem is formulated on a complete digraph (Asymmetric SCP). We show how data-dependent worst-case bounds for the GSCP and the ASCP can be obtained by known approximation algorithms for the SCP with triangle inequality and by a new one. We also discuss the relationship with the Asymmetric Traveling Salesman Problem (ATSP) and we derive sufficient (and meaningful) conditions for ATSP instances to be solvable within constant worst-ca.se bounds equal to 3, 15/7 and 9/5.

'The first author was supported by the Human Capital and Mobility Program of the European Community. The second author was partially supported by research contracts MURST 40% and 60% of the Italian Ministry of University and Scientific Research.

1

1

Introduction

The Stacker-Crane Problem (SCP) was defined by Frederickson, Hecht and Kim [4], who described two algorithms whose combination gives constant worst-case bound. We analyze two different generalizations, namely the General SCP and the Asymmetric SCP and we show that the same algorithms provide data-dependent worst-case bounds for both. The ATSP is one of the most widely studied NP-hard combinatorial optimization problems: in [3J and [8] approximation algorithms are given that provide data-dependent worst-case bounds; we use one of the algorithms described in [8J to obtain data-dependent worst-case bounds for the GSCP and the ASCP. Finally we study under which conditions an inst.ance of t.he ATSP can be solved within constant worst-case bound by the a.1gorit.hms of [4] and [8].

1.1

Problems

Stacker-Crane Problem Instance: a complete weighted mixed graph G(ll, E, A), where edges in E are unorien ted and arcs in A are oriented, satysfying the following tvvo conditions: a) all nodes in V a.re endpoint. of exactly one arc; {3) all the edges satisfy the triangle inequality. Question: find a minimum cost cycle on G, traversing all the arcs. Remark 1. Since the TI holds, there exist an optimal cycle that is hamiltonian. Proof. Any cycle traversing some arc i more than once can be made hamiltonian without worsening its value by the following substitution: indicate by hi and ti the two endpoints (head and tail) of arc i; consider one of the edges incident to hi and call u its endpoint different from hi; consider one of the edges incident to ti and not included in the oriented path from u to ti and call v it.s endpoint different from ti. Delete edges [hi, u] and [ti' vJ and add edge [tt, vl (fig.1). Any cycle including pairs of adjacent edges can be made hamiltonian without worsening its value by the substitution of the two adjacent edges with a single edge between their non-common endpoints. Every cycle traversing the arcs only once and without pairs of adjacent edges is hamiltonian. Remark 2. Since in every hamiltonian solution ea.ch a.rc is traversed exactly once, the sum of the costs of the arcs is a fixed cost. Therefore the value of every solution can be defined in two different ways, depending on taking into account total costs or only variable costs (defined as the difference between total costs and fixed costs). The choice does not affect the ranking of the solutions, but it affects the value of the worst-case bounds.

2

(a)

(b) Figure 1

Asymmetric Traveling Salesman Problem Instance: a complete weighted digraph G( \I, .4). Question: find a minimum cost hamiltonian cycle on G.

Notation. In this paragraph we establish the notation we use throughout the paper. N is the number of arcs of a SCP: we assume arcs to be arbitrarily numbered from 1 to N. Ii is the cost of the i-th arc and L = Ef:lli is the fixed cost. We call tail and head the endpoints of every arc, such that t he orientation is from the tail to the head. 'liVe indicate the tail and the head of the i-th arc with ti and hi. EC and HC stand for eulerian spanning cycle and hamiltonian cycle. Let S be any set of arcs: then S stands for "S tra.versed in the opposite direction" or "reversed"; S· is t.he optima.l value of S: St and S'I) indicate the total and the variable costs of arc set S. Since we define auxiliary graphs and we number them GIl G 2 , ... , we indicate with Sk a. set S of arcs on graph G k . We use the name of a set of arcs or edges to represent also its associated cost, since this introduces no ambiguity and enhances readability and int.uition. TI stands for the triangle inequality and ATI for the asymmetric triangle inequality. TI is defined as follows: for each pair of vert.ices i and j, the cost of edge [i, j] is not greater then the cost of any (oriented or unoriented) path from i to j or from j to i (fig.2). The ATI is defined on triplets of arcs forming non-coherent triangles; a non- coherent triangle is a triangle that is not a. cycle (fig.3). Indicating with d uv t.he cost of an a.rc (u, v) and with V the ground set. of a graph. the ATT is:

3

k

I

w ..

J

1

IJ

w .. lJ

(a)

(b)

Figure 2

Figure :3 Complexity. The SCP is NP-hard; t.his is proved by shO\ving t.hat every inst.ance of the TSP is equivalent to an instance of a SCP with arcs of zero cost (see [4]). The following polynomial time procedure performs the transformation. Procedure Transform-TSP-into-SCP (figA). Input: a TSP instance, defined by a graph G(l'G, EG ) with weights d on edges. Output: an SCP instance, defined by a mixed graph H( VB, E H , AH), such that the optimal solution and its value are preserved. Step 1: for each node i E VG, define an arc in AH, \vit.h zero cost.. Define FH to be the set of the 2N endpoints of the Narcs. Step 2: for each edge [i,j] E E G , define 4 edges [hi, tj], [hj, ti], [hi, hj] and [ti' tj] in E H , and give them a weight equal to dij . The ATSP is also NP-hard [5]. It is possible to show t.hat every inst.ance of the SCP with N arcs and 2N nodes is equivalent. t.o an instance of t.he ATSP with N nodes: the 4

C£;)

/

/...

\./.

\ ...\

t-I

r

d..

.'~A.A

d··IJ

1

'\ j

IJ

/

hi h.

J

... \

Q::> Figme 4 following polynomial time procedure performs t.he transformation.

Procedure Transform-SCP-into-ATSP (fig.5). Input: an SCP instance, defined by a complete mixed graph G( l"a, E G, AG) with weights Ii on each arc i and weights duv on each edge [ti, v]. Ou.tput: an ATSP instance, defined by a complet.e digraph H (\/ir, AH), such that the optimal solution and its value are preserved. Step 1: for each arc of A G, define a node in llir. Step 2: for each head-to-tail edge [hi. tjl E EG define an arc (i,j) E AH with weight equal to dhitj + ~(li + Ij)'

Figure

5

.t''>

Existing algorithms. Frederikson, Hecht and Kim [4] give 2 algorithms, SmaHArcs (SA) and LargeArcs (LA), whose cornbination gives a worst-case bound equal to 9/5 when total costs are considered. When only variable costs are considered the best constant worst-case bound is 3 and is given by algorithm LA alone. This observation was not made in [4]. Frieze, Galbiati and Maffioli (3] examinE' ma.ny a.lgorithms for the ATSP with ATI, producing worst-case bounds depending on the number of vertices or on other parameters of the instance. Righini and Trubian [8] present two algorithms wit.h dat.a-dependent. worst.-case bounds for the ATSP. One of them (RT2) improves the worst-case bound of one of t.he algorithms in [3]. The description of algorithms LA. SA and RT2 is recalled in the a.ppendix.

Purpose of the research and paper outline. The purpose of this paper is: 1) to obta.in data-dependent bounds for the SCP problem when the triangular inequality does not hold; we call this problem the General Stacker Crane Problem, GSCP (section 2); 2) to obtain data-dependent bounds for t.he SCP when G is a digraph: we call this problem t.he Asymmetric Stacker Crane Problem, ASCP (section 3); 3) to obtain sufficient conditions for an ATSP instance to be solvable within constant worst-case bound; the way to obtain such result is to formulate the ATSP instance as a SCP instance for which constant. worst.-case bounds equa.l to 3, 15/7 and 9/.5 are provided by algorithms LA, LA+RT2 and LA+SA (section 4). Since both algorithms SA and RT2 use the algorithm of Christofides as a subroutine, we first study how the 3/2 bound provided by it cha.nges \vhen the TI does not hold.

6

1.2

The algorithm of Christofides when TI is violated

Consider a complete symmetric weight.ed graph f/( VII, E II ) with edge weights Wij ([i,j] E EII)' Define!::l.1I = maXi,j,kEVH{Wij - (Wik + H'jk), O}. that. is the maximum viola.tion of the TI. Theorem 1.1 The algorithm of Christo./idEs produces an eule,.ian spanning cycle EC and a hamiltonian cycle H C, such that:

< ~HC* + ':6.11 2

EC

- 2

HC

< ~HC* + N2 !::l.1I

- 2

= I VII I,

0 :5 e :5 N - 2 is the number of eren (legree nodes of the minimum spanning tree of H and He" is tin minimum hamiltoniall cycle on H.

whe1'e N

Proof. The algorit.hm initia.lly builds t.he minimum spanning tree on graph H. Call it ST* and let 0 and E be the set of nodes of odd and even degree of ST- and 0 and e their cardinalities. Since ST- bas /\' - 1 edges and no cycles, its cost is a lower bound to HC·, that is ST* :5 HC*. In a second step the algorithm finds the minimulll cost matching Ala on the nodes of odd degree. Since every hamiltonia.n cycle is the union of t.wo edge-disjoint matchings, Me, :5 ~HCo, where HCo is the minimum hamiltonian cycle on the nodes of O.

\

\

\

\

\.

Figure 6

7

It is possible to obtain a particular hamilt.onian cycle H Co on the nodes of 0 from He" by the following procedure: for every uode u in E, delete from He" the two edges [u, r] and [u, s] connecting It to it.s adjacent nodes l' and s and replace them by edge [r, s] (fig.6). Perform the substitution sequentially for f times. Every time the substitution is performed two edges of a t.riangle are replaced \vith the third edge; therefore each substitution costs at most D..H and t.hen HCo ::; HC" + e.~H' Since by HCo , definition HC

o::;

EC = ST*

+ Mo" < HC" + ~HCo < He· + ~(HC* + eD..H) = ~He* + -2€ ~H 2 2 2

For obtaining a hamiltonian cycle He from Ee t.he algorithm replaces pairs of adjacent. edges by single edges, until every node is yisit.ed only once. Since ST" has N - 1 edges and 1\10 has ~ edges, the number of substitutions is (N - 1) + ~ - N, that is ~ - l. Each substitution costs at most ~H and therefore

He

o

3

t'

0

3"

N

< EC + 2-~H -2 < -He" + (-2 + 2-)~H = -He + 2 ~H 2

8

2

The General Stacker Crane Problem

The question in the GSCP is to find a hamiltonian c,Y'c!e on G when the TI does not hold; the interest in this problem comes from the observation that the constant bounds provided by algorithms LA and SA of [4] are valid for eulerian cycles only, if the TI is violated. In particular both LA anel SA can output a cycle tra\'ersing all arcs once but visiting some node more than once (fig.7a.) as well as a cycle traversing some arc more than once (fig.7b).

o

A' o

(a)

(b) Figure 7

General Stacker Crane Problem: GSCP Instance: a (complete) weighted mixed graph G(l/, E, .4), where edges in E are unoriented and arcs in A are oriented. Question: find a minimum cost hamiltonian cycle 11 C·, traversing all arcs. Conditions Q and {3 of the formulation of the SCP can be violated. In particular we show that it is possible to enforce condition 0', but not condition (3 in general. Therefore the preprocessing procedure used in [4] to enforce the triangle inequality cannot be executed since it makes loosing the hamiltonicity of solutions. First we reformulate the GSCP in an equivalent way and \ve give polynomial time preprocessing procedures to do the transformation. Then we apply algorithms LA, SA and RT2 in order to obtain data-dependent worst-case bounds for the GSCP. If condition a is violated, apply the following preprocessing procedures, equal to those presented in [4]. Procedure Preprocessing la. (fig.8) Input: an instance of the GSCP defined on a weighted mixed graph G(V, E, A). Output: an instance of the GSCP defined on a 'weighted mixed graph 11( Vll , Ell, All) such that all its nodes are endpoint.s of at least one of its arcs. For each node U E V that is endpoint of no arc of A.: split it into two nodes Ul and U2 9

in VH ; split each edge [u, v] E E incident to the original node {/, into two edges [U1 1 v] and [U2' v] in EH with the same weight of [H. v]; conl1f.'ct UI and U2 with an arc (Ull U2) of zero cost.

o\/?

6

//~

\ ~ -

o

I

o

W.. IJ

Figure 8 Remark. If some node is entered (or left.) by more tha.n one arc, no feasible solution can exist. Anyway in this case one could ask for a. cycle t.raversing all arcs once and visiting each node the smallest possible number of times. This problem is again equivalent to a GSCP on a graph G 1 obtained by the following preprocessing procedure. Procedure Preprocessing lb. (fig.9) Input: a GSCP instance defined on a weight.ed mixed graph H(l/i, E H , A H ), such that all its nodes are endpoints of at least one of its arcs. Output: a GSCP instance defined on a \veighted mixed graph G 1 ( \!J., E 1 , Ad, such that all its nodes are endpoints of one of its arcs. For each node tt E VH that is head of /..'1 arcs of AH a.nd tail of /..'2 arcs of AH 1 with /..~l + k2 > 1, split tt into a complete bipartite subgraph \'v'ith kl nodes on one side, such that each of them is the head of one of t.he arcs ent.ering It. and /.'2 nodes on the other side, such that each of them is the tail of one of the arcs leaving u; give zero cost to all the edges of the bipartite subgraph: replace each edge [v.. r] E EH by kl + k2 copies of it with the same weight of [tt, v].

Figure 9

10

The preprocessing procedures affect neither the hamiltonicit.y nor the cost of the fea~ sible solutions. Therefore the GSCP on G 1 i~ equivalent to that on G. Condition a is satisfied on graph G I . Since the orientation of arcs is known and a hamilt.onian cycle is required, the orien_ tat ion in which the edges must be t.raversed in every feasible solution can be derived. Moreover all tail-to-tail and head~to~head edges call never belong to any feasible so~ lution and then they can be discarded. Consider the follmving polynomial time pre~ - processing procedure, which transforms an instance of the GSCP on graph G 1 into an equivalent instance of the ATSP on graph G 2 • Preprocessing 2. (fig.lO) Input: a weighted mixed graph G 1 (Vi, Ell Ad, such that all its nodes are endpoints of one of its arcs. Output: a weighted digraph G 2 (lli, A2)' Replace head-to-tail edges [hi, tj] E E1 wit.h arcs (hi, tj) with the same weight; delete all other edges; shrink each arc i E Al merging its endpoints into a single node and associate to the node a weight equal to Ii.

t·I Q Ii

..,0.

IX~b

t J 0 I.

J

Ii 1.

hI

:> hJ

dhit)

0

cl hl J

I

Ij J Figure 10

After the execution of Preprocessing 2, the weights on the nodes of G 2 correspond to the fixed costs of the GSCP, whereas the weights on the arcs of G 2 correspond to the variable costs of the GSCP. All feasible solut.ions of the ATSP on G 2 correspond to feasible solutions of the GSCP on G 1 and vice versa. Therefore HC;.. = HC;. _ Let us indicate by dij the weight of arc (i,j) E A 2 • Define the maximum violation of the ATIon G 2 , .6 2 = maXi,j,kEV2{dij - (dik + dkj),O}i clefine also the maximum asymmetry of graph G 2 , 82 = maXi,jEV2 {dij - dji }.

11

2.1

Algorithm LA for the GSCP

Input: a complete digraph G 2 (l;;, A 2 ) with 1\' nodes and \vith weights dij for all (i,j) E A 2 ) and Ii for all nodes Vi E 112. Output: a hamiltonian cycle on (;2.

AI:

Step 1: find the minimum weighted matching on an a.uxiliary complete bipartite graph f((L, R, EK)' where L = \/2• R = \/2 and the following edge weights tlJij Vi E L, j E R: if i ::j. j then tvij = dij ; if i j then 'U'ij = AI, wherE' M is sufficiently large to forbid edges of weight M to belong to A1: . .M; can be computed in time polynomial in N by a linear assignment algorithm. The matching provides a lower bound on the cost of the minimum hamiltonian cycle HC; ... (i) AI; :; HC2~ The arcs of 1H: form a number s of subtoun; on (;2; if self-loops are not allowed (as in (fig. 11 ). our version of the algorithm) $ : ;

!f

Step 2: find the minimum cost arc set SD; connecting the subtours of AI{; (fig.12). Since in every feasible solution all subsets of nodes must be connected, (ii) SD; :; HC2~ Step 3: consider the reverse arc of each arc of SD; and define S" = J\1;+SD;+SD;. S" is a eulerian spanning cycle, but not hamiltonian in general (fig.13). For the definition of fi 2 , (iii) 51) :; A1: + SD; + (SD; + (05 - 1)82 ) Step 4: for every arc (i,j) of SD;, calli one of the successors of i in 5v and k one of the predecessors of j in S" (fig.14). Delete from 5" arc (i, I), arc ("~,j) and arc (j, i) and add arc (k, I). The resulting arc set is a hamiltonian cycle, HC 2". The substitution must be done s - 1 times and every substitution costs at. most 2.6 2 , since by the definition of .6 2 , dkl :; dkj + djl + .6 2 and djl :; d ji + dil + .6 2 • Therefore: (iv) HC 2" :; Sv + (8 - 1)2.6 2.

From inequalities (i), (ii), (iii) and (iv) a.nd from the relation .s :; ~, it follows

and when total costs are considered

12

~, "

./

II

d

\"

\

.'

~

~-''"'"

Figure 11

Figure 12

Figure 13 .........

.'

~

~r k,.O ~~.... I

1 ~

l

kJ Figure 14

/'"'

I

I

(

~/

..,J

~

("

~0

J

2.2

Algorithm SA for the GSCP

Input: a complete digraph G 2 (V2 , ;h) with IV nodes and with weights dij for all (i,j) E A 2 ) and Ii for all nodes Vi E V2 • Output: a hamiltonian cycle on G 2 • Step 1: define a complete unoriented graph G 3 (\!3. Ea), with \.'3 = 1/; and edge weights Wij = min{dij , d ji } V[i,j] E E 3 • For the construction of G3 , it follows

(i) HG; ::; HG;". Define ~3 on G3 •

= maXi,j,kEV3{Wij -

(Wik

~3 ::; ~2

+ 82 ,

Observation 2.1:

+ Wjk), O}, that

is the maximum violation of the TI

Proof. Consider any triple of nodes (i, j, k) and t he three arcs of 04 2 forming the minimum cost triangle with vertices i, j a.nd k. T\vo cases ca.n ha.ppen: either the three arcs form a coherent tria.ngle (case 1) or they form a non-coherent triangle (case

2). Case I (fig.I5): suppose wlog that t.he arc between i and j is direct.ed from i to j; the following inequalities hold: Wij

= dij

::; d ji

+ 62 ::;

(d jk

+ d ki + .6. 2 ) + 62 = LVjk + Wik +.6. 2 + 62 ,

Case 2 (fig. 16): suppose wlog that the arc between i and j is directed from i to j. If the non-coherent arc is (i,j) then apply the definition of 6 2 (fig.16a); otherwise suppose wlog that the non coherent arc is arc (i, k) (fig.16b); the following inequalities hold: Wij = dij ::; dik + dkj + 6 2 ::; dik + (ci jk + 82 ) +.6. 2 = lVik + 'Wjk + 62 + .6. 2 , Remark. In [4], the construction of the auxiliary undirected graph is followed by the substitution of the edges weights by t.he cost of the shortest path between their endpoints. This is no longer possible, under our hypotheses, because it would cause the algorithm to output eulerian instead of hamiltonian cycles. Therefore in this case we cannot enforce the TI on graph Ga. Step 2: apply the algorithm of Christofides to graph G a , obtaining a eulerian spanning cycle EGs . By theorem 1.1 and observation 2.1 it follows

(ii) EGa ::; ~HG; + ~e~3' where e is the number of nodes of even degree on the minimum spanning tree of G s .

Step 3: consider on G 2 the arc set S'I) ma.de of the pairs of arcs (i,j), (j, i)) correspondent to the edges of EGs (fig. 17). By definition of 62 and by the construction of G a it follows that S'I) ::; 2EGa + q82 , where q is the number of edges of EGa. S'I) can be traversed in two different and arc-disjoint ways; both of them are eulerian spanning cycles of G 2 • Choose the best of the two and call it. EG2... Then (iii) EG2" < ~S'I) ::; EGa + ~q62'

14

Step 4: in order to obtain a hamiltonian cycle flC 2" apply q - N times the substitution of two consecutive arcs of EC2" with one arc wit.h t.he same endpoint.s. Since each substitution costs at most ~2' (iv) HC2.. :'5 EC2.. + ~2(q - N).

Figure Vi

k

k ~~

...~"., \

/

/

oI

{

\

I

"

I

l~j

1

(a)

J

(b) Figure 16

9~a 1

~

~

~ \ \

\~

/'

"'\

\

Figure 17

15

From inequalities (i), (ii), (iii) and (iv) anel fr0111 the relations q = (IV - 1) 0= N - e it follows

and \vhen total costs are considered

16

+~

and

2.3

Algorithm RT2 for the GSCP

Input: a complete digraph G 2 (F2 , ,42) with N nodes and with weights dij for all (i,j) E A 2 ) and h for all nodes Vi E V2. Output: a hamiltonian cycle on G 2 • Step 1: define a complete unoriented graph G 3 ( "';, E 3 ), with \/; =

'-'i

and edge weights

Wij = dij + dji V[i,j] E E3 • For the construction of G3 , it follows t.hat HC; = (HC 2", + HC2~)* :::; HC;" + HCitl' By definition of 62 , HCi.. :::; HC;.. + N6 2. Therefore (i) HC;' :::; 2HC;" + N6 2 • Define .6. 3 = ma;T;i,i,leE V3 {Wij (Wile + Wjle). O}, t,hat is the maximum violation of the TI on G3 • Observation 2.2 .6. 3

:::;

2.6. 2 ,

Proof. Applying the ATI on the t\ro triangles of G 2 defined by the same three vertices i, j and k, dij :::; dile+dlej+.6.2 and dji :::; dki+djk+.6.2; summing lip the two inequalitites, Wij :::; Wik + Wjle + 26 2 and then .6. 3 :::; 2.6. 2 ,

Step 2: apply the algorithm of Christofides, which provides a hamiltonian cycle HC3 • For theorem 1.1 and observation 2.2, (ii) HCa :::; ~HC3 + ~N 6 a. Step 3: define Sf} to be the set of pairs of opposite arcs on G 2 , corresponding to the edges of HCa. Sf} can be traversed in two arc-disjoint ways (fig,18); call HC2 " the best of the two. (iii) HC2.. :::; ~S = !HC3 .

From inequalities (i), (ii) and (iii) anel observation 2.2 it fo11O\ . . s

and when total costs are considered

HC 2

3 * 1 3 1 < -HC - -L + -N62 + -N.6. 2 2. 2 4 2

•- 2

17

/~

LJ

~~

.....

('

J

., \

~ on G2 Figure 18

2.4

Comparison

The data-dependent worst-case bounds provided by algorithms LA, SA and RT2 are of the form:

Tables in figure 19 show the compa.rison between the three bounds. The worst-case bound of algorithm RT2 dominates the one of algorithm SA.

GSCP algorithm

LA SA RT2

'T)

=

He

!v

iT

HC2" kL k6.2

' 3 3/2 3/2

0 0 0

GSCP

'T)

1 1/2 1/2

kS2

1/2 3/2 3/4

= Z~!t '2

algorithm

k

kL

k6.2

kS2

LA SA

3 3/2 3/2

-2 -1/2 -1/2

1 1/2 1/2

1/2 3/2 3/4

RT2

Figure 19

18

3

The Asymmetric Stacker Crane Problem

Instance: a complete digraph G(V, E, A) where .4 is a subset of E. Question: find a minimum cost cycle EC·, traversing all arcs in .4..

In order to distinguish arcs in A, we call them jl:l'fd arcs and we call mriable arcs the others. A solution of the ASCP is neither required to be hamiltonian nor to traverse fixed arcs only once. If a hamiltonian cycle is required, the problem becomes equivalent to that of section 2. Consider the following conditions: a ' ) All nodes of the graph are endpoints of one of the fixed arcs. fJ') Variable arcs sa.tisfy the AT!. Both conditions a' and fJ' can be violated by a. general instance of the ASCP. So, first we reformulate the ASCP in an equivaJent wa.y and we give polynomiaJ time preprocessing procedures to do the transformation. Then we apply algorit.hms LA, SA and RT2 in order to obtian data-dependent "vorst-case bounds If condition a ' is violated, execute the following preprocessing procedures. Procedure Preprocessing la'. (fig.20) Input: an instance of the ASCP defined on a complete weighted digraph G(V, E, A). Output: an instance of the ASCP defined on a. complete weighted digra.ph H(VH , E H , A H ), such that all nodes are endpoints of at least one of the fixed arcs. For each node U E V that is endpoint of no fixed arc, split. It into two nodes III and U2; split ea.ch va.riable arc incident to the original node 'It into two va.riable arcs, incident to Ul and to U2, with the same weight; connect 'UI and '1l2 with a fixed arc of zero cost.

_ _.....f',

----'v)

Figure 20

19

Procedure Preprocessing Ib'. (fig.2l) Input: an instance of the ASCP defined on a oomplete weighted digraph H(VB~ EB, A B ), such that all nodes are endpoints of at least one of the fixed arcs. Output: an instance of the ASCP defined Oll a complete weighted digraph GI(Vt. EI~ Ad, such that aU nodes are endpoint.s of one of the fixed arcs. For each node ~l E VB that is endpoint of k > 1 fixed arcs or AH: split It into k nodes Ul! .•. , Uk, such that each of them is the endpoint of one of the fixed arcs incident to u; replace each variable arc incident. to 1l. by /': copies of it. incident to UI, U2," ., UI" with the same weight of the original variable arc; COllllect all nodes ttl, tt2,' •. ,Uk with variable arcs of zero cost.

Figure 21 Neither of the preprocessing procedures affect.s the variable 01' the total cost of the feasible solutions. Therefore the ASCP on G I is equivalent to that on G. A second preprocessing step enforces condition {3', transforming the ASCP instance on G I into an equivalent ASCP instance on G 2 • Procedure Preprocessing 2'. Input: an instance of the ASCP defined on a. complet.e weighted digraph G 1 (V1, E 1 , AI)' such that a' holds. Output: an instance of the ASCP defined on a. complete weighted digraph G 2 (V2 , E 2 , A 2 ), where A2 is the subset of fixed arcs and such that both conditions a' and f3' hold. For every pair of nodes~ compute the minimum cost oriented path in G I . This can be done in polynomial time with well known algorithms [2]. Define a graph G 2 with the same arc sets as G 1 but with weight. of each variable arc equal t.o the cost of the shortest oriented path between its endpoints. The original ASCP instance is equivalent. t.o the ASCP instance on G 2 : suit.able postprocessing procedures that undo t.he replacement.s done by preprocessing procedures la', lb~ and 2' can transform any feasib1e solution on G 2 int.o a fea.sible solution on C.

20

The value of all feasible solutions is the same on G 2 and on G. Moreover, an optimal solution on G 2 is hamiltonian, since any cycle visiting a node more than once can be made hamiltonian without worsening its \'a.lue, exploiting condition {3'. Therefore HC; = EC·. Let N be the number of fixed arcs and 2N t.he number ot' nodes of G 2 . Let us define the following parameters: bt = nWX(i,j)EA{dji - d ij }. bf = ma:ri,jl(i,j)~At\(j,i)~A {dij - d ji }. b2 = m.ax{ bt, bf}.

Remark. 82 cannot be computed by applying its definition to G directly, before the preprocessing. Anyway the time needed to comput.e 82 is not more than that needed to do the preprocessing.

21

3.1

Algorithm LA for the ASCP

Input: a complete weighted digraph G 2 ( l'a. £2,.4 2 ), where ,42 is the subset of fixed arcs and such that conditions cl and /3' hold. Output: a hamiltonian cycle traversing all fixed arcs.

Step 1: Consider the auxiliary bipartite graph f{(T, If, E K ) such that T is the set of nodes of G 2 that are tails of fixed arcs, H is the set of nodes of O 2 that are heads of fixed arcs and EK is the set of variable arcs of G2 • Find the optimal matching M: on graph I 3 LB -

4



Testing condition (AI) requires O(N4). whereas the application of the algorithm requires O(N 3 ). More restrictive condit.ions that. are faster to test call be obta.ined, but we could not prove they are meaningful. For insta.nce, it is possible t.o imply condition (AI) in the following way. dkl < dkj + dij + dil == dkj + dji + dil + (d ij - djd. This is implied by the two conditions dkl < dkj + djl + 1/2(dij - djd and djl :5 d ji + dil + 1/2(dij - did, which are implied by dkl :5 dki + dil - 1/2bjt and £Iii :5 elji + (liZ - 1/28!n. A sufficient condition is then tl.iik 2:: Hb~n + brut) Vi,j, k E l,(;, \. . hich can be tested in O(N 3 ). On the other side such condition is stronger than the ATI, since bin a.nd 0kut are non-nega.tive and we could not prove it is meaningful.

~+-_1~_~ \ 2 ~) /1\ I ' I \ ,

2

')

®

i

\/

.

1 1

\

I?!')

4

figure :ri

Remark. Even if the sufficient condition (AI) does not hold, algorithm LA provides a data-dependent bound for the ATSP. like' those of [:3J and [8]. In particular, algorithm LA (plus postprocessing) produces a solut.ion He of the ATSP such that HC -< 3HC*

1 + N~ + -NfJ 2

4.2

Algorithms LA

+

RT2: worst-case bound

= 15/7

A constant worst-case bound equal to 15/7 call be obtained by applying TransformATSP-into-SCP-2 followed by the combination or aJgorithms LA and RT2. In order to obta.in the consta.nt bound the following conditions are necessary and sufficient. (Bl) Ii ~ 0 Vi = 1, ... , N. (B2) Wij ~ 0 Vi,j = 1, ... ,N.

(B3) (B4) (B5)

Wij Wi; Wkl

+ Wji

~ Wile

~ ~

+ Wi;

Ii

+ Wlei + Wjk + lOkj

Vi,j~ k = 1, ... , N. Vi,j = L ... , N. + Wil 'Vi,j, ~d = L .... N.

+ Wji + Ij

Wlej

Conditions (Bl) and (B2) are required for obt.aining a mixed graph wit.h non-negative costs on the arcs and edges after the t.ransforma.tion. Condition (B:3) is required by algorithm RT2, that builds a.n auxiliary undirected graph on which the TI must hold. Condition (B4) is necessary in step 1 of algorithm RT2 (see appendix). Condition (B.5) is required in the postprocessillg of t.he output or algorithm LA (as outlined in the previous subsection). We substitute condition (B3) with condition (13:>'), that implies it. (B3 ' ) Wij ~ Wik + lOkj Vi,j, h~ = 1, ... , N. \Ve choose Ui = ~Dr't and Ei = ~bfn for all i = 1. ... , N. By this choice conditions (Bl) and (B4) are always satisfied. The following set. of condit.ions is now sufficient. ( B) 2

(B 3')

!:,out Vi

V", ) + Vj£in < _ 4 di j / .

dij ~ dik

+ dk;

-

= L ... , 1\''

-out·) 4"l(dn Vk +?lk

Condition (B5') is obtained from condit.ion (B5), by t.he use of the inequality dji-di; ~ hi"" + bit) coming from the definit.ion of parameters bin and bout. Figure 38 shows an example of a graph sat.isfying all the three sufficient conditions, in which ~; = >

!(

1; 1:.

Conditions (B3') a.nd (B5') are bot.h implied by the following condit.ion (B6). (B6) dij ~ dik + dkj - Hh~n + hzut) Vi,j, h: = 1, ... , N. By definition of 6ijk a set of sufficient. conditions is then: (B2) 8it + 8jn ~ 4dij Vi,j = 1, ... , N (B6) 6 ijk ~ ~(h~n + Dzut) Vi,j, k = 1, ... , N :36

This set of sufficient conditions is checkable in O( N3); anywa.y we could not prove that it is meaningfuL It can be remarked that it is stronger than the ATL

3/ /')"'"

/

'. / !\

i \

.:>( ,I

~\

\

3/2

2:

\ 'x

~ / ~

'

I

/

\

\

2)"/

)/4/~\ ~I~ ~W

®~ "J I? w/ .....

Figure :18

:37

\9

4.3

Algorithms LA

+

SA: worst-case bound

= 9/5

A constant worst-case bound equal t.o ~)j.5 call be obt.ained by applying TransformATSP-into-SCP-2 followed by the combinat.ion of algorithms LA and SA (both followed by postprocessing). In order to obtain the constant bound the following conditions are necessary and sufficient.

(C1) (C2)

Ii ~

0 Vi = 1, ... ,N. Wij ~ 0 Vi,j = 1, ... ,N. Zij :::; Zile + Zjle Vi,j, k = 1, ... , lV, where Wij :::; Ii + Wji + I j Vi, j = 1, ... , lV. Wile :::; Wij + Wkj + lie

(C3) (C4) (C.S) (C6)

Wile :::; Wjle

(C7)

Wkl :::; Wil

Zij

= min{wij, Wji}.

+ HJji + Ii

+ Wij + Wlej

Vi,j.!.·.l = 1. .... N.

Conditions (Cl) and (C2) are required for obt.ailling a mixed graph with non-negative costs after the transformation. Condition ((':3) is required by algorithm SA, that builds an auxiliary undirected graph on which t.he TI must hold. Conditions (C4) (fig.39), (C5) (fig.40) and (C6) (fig.'ll) are necessary in the postprocessing for replacing triples of asjacent head-to-tail edges by single edges. Condition (C7) is required by the postprocessing of the output of algorit.hm LA as in the previous subsections .

• 0 r

". ..... ...... .

·~O

b

\

\

1"'\

Figure

38

:3~)

.

'. \ J

\

\

o

/~\

o ,'!II! / / /

/

J

Figure 40

j ~\

i

) \./' o

k

Figure 41

By substitution from the definition of weights I and w. we obtain the equivalent set of conditions. (Cl)Ui+Ei~O

Vi 1, ... ,N. (C2) Ui + E j :5 dij Vi,) = 1, ... , N. (C3) Zij :5 Zile + Zjle Vi,}, k = 1, ... , iV. (C4) dij - dji :5 2Ui + 2Ej Vi,} = 1, ... , N.

(C5) dij :5 dile + djle + 2Ej - 2EIe (C6) dij :5 dlej + dlei + 2Ui - 2UIe (C7) dlez :5 diZ + dij + dlej - 2U;. - 2Ej

Vi.}. J.., 1= 1, ... , N.

39

We choose again Ui = ~brut and Ei = ~bfn for all nodes i = 1, ... , N. Therefore conditions (C1) and (C4) are satisfied. We obtain the following sufficient conditions:

(C3)

Zij

(C6)

d;J' •

$

Zile

+ Zjle

'Vi,j, /.. = 1, ... ,N

< I "J' + dIe,' + -21 ( b·-out

-

(i

to

l

'out) - Die

v·t, j.,, ,,: = L. , . , iV 1

(C7)

Figure 42 shows an example of a graph sat.isfying sufficient conditions above. The 4 bound is meaningful since ~= = 16 > ~.

Figure 42 Due to condition (C7) the time required for the testing is O(N4). Faster but more restrictive conditions can be obtained, but again we could not prove they are meaningful. For instance, the following system of hvo conditions (C2) brut + b;n $ 4dij 'Vi,j = 1, ... , N (C8) D.iile ~ ~(b~n + br't) + 1(btn + brt + bjn + bjt) Vi,j, k = 1, ... , N is sufficient and is checkable in O(f.P) but it seems to be largely too restrictive.

40

ACKNOWLEDGMENTS Prof. Anton Volgenant pointed out the relat.ionship between the reduction outlined in section 4 and those illustrated in [6] for the TSP. The first author acknowledges the support of the Human Capit.aland Mobility Program of the European Community.

41

References [1] M.R.Garey, D.S.Johnson Computers and Intractability: a Guided TOllr to thE Theory of NP- completeness Freeman, San Francisco. 1979

[2] R.W.Floyd Algorithm 97: Sh01·tesl Path Comm. ACM 5, 1962 [34.5] [3] A.M.Frieze, G.Ga.lbiati, F.l\IafTioli On the worst-case pe'rformJI,ncc of some algorithms for lhe Asymmetric Traveling Salesman Problem

Networks 12, 1982 [23-39] [4] G.N.Frederickson, M.S.Hecht, C.E.Kim Approximation algorithms foJ' some /'Outing problems

SIAM J. Comput. 7,2, H)78 [178-19:3] [.5] M.R.Garey, D.S.Johnson Computers and Intractability: a Gllidf' to the Theory of l\lP- completeness

Freeman, San Francisco, 1979 [6] R.Jonker, R.Kaas, T.Volgenaflt Data-dependent bounds for heuristic ... to .find a min/mum 'weight hamiltonian circuit Operations Research 28, 1980 [62:3-627]

[7] E.L.Lawler, J.K.Lenstra, A.H.C.Rinnooy

I~an.

D.B.Shmoys (eds.)

The tmveling salesman problem

John Wiley, Chichester, 198.5 [171-177] [8] G.Righini, M.Trubian Worst-case analysis of two appro;rimate algorithms f01' the Asymmetric Traveling Salesman Problem

to appear in European Journal of Operational Research [9] S.Sahni, T.Gonzales P-complete problems and appro~timate solutions IEEE 15th Ann. Symp. on Switching and Automata Theory, 1974 [28-32]

42

5

Appendix

Stacker Crane Problem: Instance: a weighted mixed graph G( F, E, .4). where edges in E are unoriented and arcs in A are oriented, satysfying the follO\ving two conclitiolls: Q) all nodes in V are endpoint of exactly one arc; (3) all the edges satisfy the triangle inequalit.y. Question: find a minimum cost cycle on G. that traverses all arcs. Algorithms LA and SA output eulerian spanning cycles. Such solutions can be made hamiltonian without worsening t.heir value. by postprocessing procedures that repeatedly replace pairs of adjacent edges by a single edge, exploiting the Tl. For a more detailed description of the algorithms the reader is referred to [4] for LA and SA and to [8] for RT2.

5.1

Algorithm LA for the SCP

Input: a weighted mixed graph G(V, E . .4), satysfying condit.ions Output: a hamiltonian cycle traversing all arcs.

Q

and ,8.

Step 1: find the minimum weighted matching M; on an auxiliary bipartite graph K(T, H, E K ), where T is the set of nodes that are tails of arcs in A, H is the set of nodes that are heads of arcs in A and EK is made of all edges [i, j] of E such that i E T and j E H. A.f; can be computed in time polynomial in N by a linear assignment algorithm. The matching provides a lower bound on t.he variable cost of the minimum cycle HC:: (i) jl1~v -< HC·v The edges of M; and the arcs of A form a lIumber .s of subtours on G (fig.43). Step 2: find the minimum cost edge set ST; connecting the sllbt.ollrs (fig.44). Since in every feasible solution all subsets of nodes must be connected, (ii) ST: ::; HC; Step 3: duplicate the edges of ST;. Call Sv = AI; + '2ST; the resulting edge set. The edges of Sv and the arcs of A form a spanning eulerian cycle (fig.4.5). (iii) ECv = Sv = M; + 2ST:

From inequalities (i), (ii) and (iii) it follows:

ECv ::; 3HC; and if total costs are considered 43

ECt

:::;

3HC; - 2L

h ,

I

I

..

~

Figure

4~~

Figure 44

fl.····

~ ............. ..

I

'Y

---~

"

Figure 45

Remark. In this paper we consider algorithm LA in a slightly improved version: selfloops on arcs are not allowed when the minimum matching is looked for. Neither the worst-case bound nor the computationa.l complexit.y of the algorithm are altered by this assumption. 44

5.2

Algorithm SA for the SCP

Input: a weighted mixed graph Ci( V, E, A), satysfyillg condit.ions a and Output: a hamiltonian cycle traversi ng rt II arcs.

/3.

Let us indicate by d,.w the cost of the generic edge [u, v] E E. Step 1: define a complete unoriented graph Ol(\i, Ed, wit.h \:1 =.4 and edge weights Wij = min{dh;ti,dhjt;,dhokj,dt;ti}Vi,j E "i. Substit.ute the edge weights by the length of the shortest path between their endpoint.s, so that the TI holds on 0 1 , For the construction of 0 1 , it follows (i) HC; :S HC:. Step 2: apply the algorithm of Christofides to graph 0 1 , obtaining an eulerian cycle EC1 · (ii) EC l :S ~HC;. Step 3: consider the set 5 ma.de of the edges of 0 correspondent to the edges of EC l plus all arcs of A plus a.ll edges [hi.l. i ] (figAG). Duplicate all the arcs and edges in S, obtaining the set 25 (figA7). 25 :S 2( EC\ + 2£). The set 25 can be traversed in two different and disjoint ways, both of which a.re eulerian spanning cycles of 0 (figA8). Choose the best of the two and call it EC. Then

(iii) ECt :S H2S) :S ECl

+ 2L

From inequalities (i), (ii) and (iii) it follows

and when total costs are considered

45

I ,

" /

Figure 46

Figure 47

Figure 48

4(j

5.3

Algorithm RT2 for the SCP

Input: a weighted mixed graph G( V, E, A), satysfying conditions (\' and {3. Output: a hamiltonian cycle traversing all arcs.

Let us indicate by duv the cost of the generic head-to-tail edge [11,11., tv] E E. Step 1: define a complete unorientecl graph G\ ( \:1. Ed, wi til \:i = A and edge weights Wij = dij+dji+li+lj Vi,j E Vi, On G I t.he TI holds, since the relations dij ::; dile+11e+dlej

and dji ::; djle + lie + dlti are implied by condi tion ,8 (fig,49). For the construction of GI , it follows HC; = (HCv + HC'vt 2L ::; HC: + HC'; + 2L. Since for condition f3, dij ::; Ii + dji + tj , it follows that HC~ ::; HC: + 2L (fig ..50). Therefore (i) HCi ::; 2HC~ + 4L.

+

Step 2: apply the algorithm of Christofic\es, which provides an hamiltonian cycle HCl (ii) HCI ::; ~HCi.

.

Step 8: define S t.o be the set of pairs of edges of G' corresponding to the edges of HC ll plus t"wo copies of each arc of A (fig.51). For the definition of weightsw, it follows that S = (HCI - 2L) + 2L = HC l . 5' can be trayersed in two disjoint ways; call HC the best of the two. HCt ::; ~S ~HCl and then (iii) HCv ::; ~HCl - L.

From inequalities (i), (ii) and (iii) it follo\\'s

and if total costs a.re considered

47

elk>,J

Figure 4H

Figure .50

Figure .51

48

5.4

Comparison and combination of algorithms

The worst-case bounds provided by a.lgorit.hms LA, SA and RT2 a.re of the form:

1]

HC L = - - < k+kL - HC· HC*

In [4] it is shown that running algorit.hms SA and LA and taking the best of the two solutions found, gives a worst-case bound equal t.o 9/.5, when total costs are considered. We add the further observation that the \vorst.-case bound is 3 when only variable costs are considered and that such bound is given by algorithm LA alone. This can be seen from the graphical representation of t.he bounds in figures 5:3 and 54. An analogous combination of algorit.hms LA and RT2 gives a. const.ant. \vorst.-case bound equal to 15/7, when total costs are considered. Infact LA gives ECtLA :$ 3HC; - 2L and RT2 gives HCtRT2 :$ ~HC; + ~L. The bounds on the costs of the two solutions are equal when 3HC; - 2L = ~HC; + ~L, that. is when ~HC; = ~L, that is L = ~HC; and in such case the bound is gi ven by :UI C; - 2( ~ If C;) = H C;.

1;

Tables in figure 52 show the comparison bet\\'een the three bounds. The worst-case bound of algorithm SA dominates the one of algorit.hm RT2.

SCP

1]

= ~

algorithm

k 3 3/2 3/2

LA SA RT2

SCP

1]

kL 0 1 2

=~

algorithm

k

kL

LA SA

3 3/2 3/2

-2 1/2 3/2

RT2

Figure .1)2

49

EC v HC~

t

RT2

I

I

./

,I

/

SA

//

lirIT'-;:/~,/ - - - -

3

,I/J /' :

f.'

! / '

3V,/'

.

.

Q

.... 1

o

1 3

2

Figure 53

EC l

.

HC'l !

RT2

/ SA

//

y/

0 ' - - '-:----- ........ Figure 54 .

50

LA

Suggest Documents