+ All Categories
Home > Documents > Duality for Min-Max Orderings and Dichotomy for Min Cost Homomorphisms

Duality for Min-Max Orderings and Dichotomy for Min Cost Homomorphisms

Date post: 18-Nov-2023
Category:
Upload: independent
View: 0 times
Download: 0 times
Share this document with a friend
25
Duality for Min-Max Orderings and Dichotomy for Min Cost Homomorphisms Pavol Hell and Arash Rafiey School of Computing Science Simon Fraser University Burnaby, B.C., Canada, V5A 1S6 * Abstract Min-Max orderings correspond to conservative lattice polymorphisms. Digraphs with Min-Max orderings have polynomial time solvable minimum cost homomorphism problems. They can also be viewed as digraph analogues of proper interval graphs and bigraphs. We give a forbidden structure characterization of digraphs with a Min-Max order- ing which implies a polynomial time recognition algorithm. We also similarly charac- terize digraphs with an extended Min-Max ordering, and we apply this characterization to prove a conjectured form of dichotomy for minimum cost homomorphism problems. 1 Introduction Let H be any digraph. A linear ordering < of V (H ) is a Min-Max ordering if i < j, s < r and ir, js A(H ) imply that is A(H ) and jr A(H ). Min-Max orderings correspond to a particular type of lattice polymorphisms [8]. For digraphs G and H , a mapping f : V (G) V (H ) is a homomorphism of G to H if f (u)f (v) is an arc of H whenever uv is an arc of G [24]. The product G × H of digraphs G and H has the vertex set V (G) × V (H ) and there is an arc in G × H from (u, v) to (u 0 ,v 0 ) if G has an arc from u to u 0 and H has an arc from v to v 0 . The power H k is recursively defined as H 1 = H and H k+1 = H × H k . A polymorphism of H is a homomorphism f : H k H , for some positive integer k. Polymorphisms are of interest in the solution of constraint satisfaction problems [9, 26]. We say that polymorphisms f,g : H 2 H are lattice polymorphisms of H , if each f and g is an associative, commutative, and idempotent, * [email protected] , [email protected] 1
Transcript

Duality for Min-Max Orderings

and

Dichotomy for Min Cost Homomorphisms

Pavol Hell and Arash RafieySchool of Computing Science

Simon Fraser UniversityBurnaby, B.C., Canada, V5A 1S6 ∗

Abstract

Min-Max orderings correspond to conservative lattice polymorphisms. Digraphswith Min-Max orderings have polynomial time solvable minimum cost homomorphismproblems. They can also be viewed as digraph analogues of proper interval graphsand bigraphs.

We give a forbidden structure characterization of digraphs with a Min-Max order-ing which implies a polynomial time recognition algorithm. We also similarly charac-terize digraphs with an extended Min-Max ordering, and we apply this characterizationto prove a conjectured form of dichotomy for minimum cost homomorphism problems.

1 Introduction

Let H be any digraph. A linear ordering < of V (H) is a Min-Max ordering if i < j, s < rand ir, js ∈ A(H) imply that is ∈ A(H) and jr ∈ A(H).

Min-Max orderings correspond to a particular type of lattice polymorphisms [8]. Fordigraphs G and H, a mapping f : V (G) → V (H) is a homomorphism of G to H iff(u)f(v) is an arc of H whenever uv is an arc of G [24]. The product G×H of digraphs Gand H has the vertex set V (G)×V (H) and there is an arc in G×H from (u, v) to (u′, v′)if G has an arc from u to u′ and H has an arc from v to v′. The power Hk is recursivelydefined as H1 = H and Hk+1 = H × Hk. A polymorphism of H is a homomorphismf : Hk → H, for some positive integer k. Polymorphisms are of interest in the solutionof constraint satisfaction problems [9, 26]. We say that polymorphisms f, g : H2 → H arelattice polymorphisms ofH, if each f and g is an associative, commutative, and idempotent,

[email protected] , [email protected]

1

and if moreover f and g satisfy the absorption identities f(u, g(u, v)) = g(u, f(u, v)) = u.It is easy to see that the usual operations of minimum f(u, v) = min(u, v) and maximumg(u, v) = max(u, v), with respect to a fixed linear ordering <, are polymorphisms if andonly if < is a Min-Max ordering. It is also clear that they satisfy the lattice axioms. Thusa digraph which has a Min-Max ordering does admit lattice polymorphisms. In fact, adigraph admits a Min-Max ordering if and only if it admits lattice polymorphisms f, gthat are conservative, i.e., satisfy f(u, v) ∈ {u, v}, g(u, v) ∈ {u, v}. Thus we are describinga forbidden structure characterization (and a polynomial time recognition algorithm) ofdigraphs with conservative lattice polymorphisms.

An undirected graph (viewed as a symmetric digraph) admits a Min-Max ordering ifand only if each component is either a reflexive proper interval graph or an irreflexiveproper interval bigraph [16]. Thus digraphs with Min-Max orderings can be viewed asdigraph analogues of proper interval graphs. Proper interval graphs (and bigraphs) arecharacterized by simple forbidden structures, and recognized in polynomial time [29]. Inthis paper, we give a polynomial characterization of digraphs with a Min-Max ordering,suggesting that these digraph analogues also have interesting structure. Our characteri-zation is in terms of a novel forbidden structure, which we call a symmetrically invertiblepair. We call our characterization ‘duality’ in the broad sense of having the presence ofsome structure (Min-Max ordering) certified by the absence of some other (forbidden)structure.

We give a similar characterization of digraphs with certain extended Min-Max order-ings, of interest in minimum cost homomorphism problems. The minimum cost homo-morphism problem for H, denoted MinHOM(H), asks whether or not an input digraph G,with integer costs ci(u), u ∈ V (G), i ∈ V (H), and an integer k, admits a homomorphismto H of total cost

∑u∈V (G) cf(u)(u) not exceeding k. The problem MinHOM(H) was first

formulated in [20]; it unifies and generalizes several other problems [22, 25, 27, 28, 30],including two other well studied homomorphism problems, the problem HOM(H) askingfor just the existence of homomorphisms [23], and the problem ListHOM(H) asking forthe existence of homomorphisms in which vertices of G map to vertices of H on allowedlists [12]. For undirected graphs H, the complexity of both problems has been classified[23, 12], and so has the complexity of the problem MinHOM(H) [16]. In each case, theclassification is a dichotomy, in the sense that each problem HOM(H) is polynomial timesolvable or NP-complete. For digraphs, the dichotomy of HOM(H) is an important un-proved conjecture, equivalent to the so-called CSP Dichotomy Conjecture [14, 7]. Recentprogress specifically on classifying the complexity of HOM(H) for classes of digraphs Hwas reported in [4, 5]. A simple dichotomy classification of ListHOM(H) for reflexive di-graphs is described in [13]; for general digraphs dichotomy follows from more the generalresults in [6]. A simple dichotomy classification of MinHOM(H) for reflexive digraphs canbe found in [15]. It follows from [16, 15] that both for symmetric digraphs (undirectedgraphs) and for reflexive digraphs, MinHOM(H) is polynomial time solvable if H admitsa Min-Max ordering, and is NP-complete otherwise. This is not the case for general di-

2

graphs, as certain extended Min-Max orderings (defined in a later section) also imply apolynomial time algorithm [18]. However, it was conjectured in [18] that MinHOM(H)is NP-complete unless H admits an extended Min-Max ordering. Several special cases ofthe conjecture have been verified [15, 16, 17, 18, 19]. We apply our characterization ofdigraphs with extended Min-Max ordering to prove this conjecture, obtaining a simpledichotomy classification of the minimum cost homomorphism problems in digraphs.

As can be expected, one can define minimum cost homomorphism problems for homo-morphisms of more general relational structures H (instead of just one binary relation,H may have a finite number of finitary relations). In [11], the authors define, for eachrelational structure H, such a minimum cost constraint satisfaction problem MinCSP(H).Even more generally, in [10], the authors define ‘soft’ constraint satisfaction problems,where each hard constraint (of preserving a k-ary relation) is replaced by a cost functionassigning a cost to mapping any k-tuple to any other k-tuple. Thus MinCSP(H) problemscan be thought of as having soft unary constraints, with the other constraints being ‘hard’.Our results can be directly extended to relational structures H containing any number ofbinary relations. On the other hand, it follows from work of A. Bulatov (personal commu-nication) that if dichotomy of MinHOM holds for structures with binary relations, then itholds for all structures. Another proof of dichotomy of MinCSP problems (but not of oursimple classification) has recently been announced in [1].

2 Min-Max Orderings

If uv ∈ E(H), we say that uv is an arc of H, or that uv is a forward arc of H; we alsosay that vu is a backward arc of H. In any event, we say that u, v are adjacent in H ifuv is a forward or a backward arc of H (and we often use arc in this more general sense).The net length of a walk is the number of forward arcs minus the number of backwardarcs. (Note that a walk has a designated first and last vertex. For a closed walk we mayalways choose a direction in which the net length is non-negative.) An oriented walk is awalk in which each consecutive arc is either a forward arc or a backward arc. A digraphis balanced if it does not contain an oriented cycle of non-zero net length. It is easy to seethat a digraph is balanced if and only if it admits a labeling of vertices by non-negativeintegers so that each arc goes from some level i to the level i+ 1. The height of H is themaximum net length of a walk in H. Note that an unbalanced digraph has infinite height,and the height of a balanced digraph is the greatest label in a non-negative labeling inwhich some vertex has label zero.

For any walk P = x0, x1, . . . , xn in H, we consider the minimum height of P to be thesmallest net length of an initial subwalk x0, x1, . . . , xi, and the maximum height of P tobe the greatest net length of an initial subwalk x0, x1, . . . , xi. Note that when i = 0, weobtain the trivial subwalk x0 of net length zero, and when i = n, we obtain the entirewalk P . We shall say that P is constricted from below if the minimum height of P is zero

3

(no initial subwalk x0, x1, . . . , xi has negative net length), and constricted if moreover themaximum height is the net length of P (no initial subwalk x0, x1, . . . , xi has greater netlength than x0, x1, . . . , xn). We also say that P is nearly constricted from below if the netlength of P is minus one, but all proper initial subwalks x0, x1, . . . , xi with i < n havenon-negative net length. It is easy to see that a walk which is nearly constricted frombelow can be partitioned into two constricted pieces, by dividing it at any vertex achievingthe maximum height.

A vertex x of H is called extremal if every walk starting in x is constricted from below,i.e., there is no walk starting in x with negative net length. It is clear that a balanceddigraph H contains extremal vertices (we can take any x from which starts a walk withnet length equal to the height of H), and an unbalanced digraph does not have extremalvertices (from any x we can find a walk of negative net length by going to an unbalancedcycle and then following it long enough in the negative direction). Moreover, in a weaklyconnected digraph H, any extremal vertex x is the beginning of a constricted walk of netlength equal to the height of H.

For walks P from a to b, and Q from b to c, we denote by PQ the walk from a to cwhich is the concatenation of P and Q, and by P−1 the walk P traversed in the oppositedirection, from b to a. We call P−1 the reverse of P . For a closed walk C, we denote byCa the concatenation of C with itself a times.

Our main result is the following forbidden structure characterization.

Theorem 2.1 A digraph H admits a Min-Max ordering if and only if it does not containan induced unbalanced oriented cycle of net length greater than one, and does not containa symmetrically invertible pair.

An oriented cycle of H is induced if H contains no other arcs on the vertices of thecycle. In particular, an induced oriented cycle of length greater than one does not containa loop. Symmetrically invertible pairs are defined below.

We define two walks P = x0, x1, . . . , xn and Q = y0, y1, . . . , yn in H to be congruent,if they follow the same pattern of forward and backward arcs, i.e., xixi+1 is a forward(backward) arc if and only if yiyi+1 is a forward (backward) arc (respectively). Supposethe walks P,Q as above are congruent. We say an arc xiyi+1 is a faithful arc from P to Q,if it is a forward (backward) arc when xixi+1 is a forward (backward) arc (respectively),and we say an arc yixi+1 is a faithful arc from Q to P , if it is a forward (backward) arcwhen xixi+1 is a forward (backward) arc (respectively). We say that P,Q avoid each otherif there is no pair of faithful arcs xiyi+1 from P to Q, and yixi+1 from Q to P , for somei = 0, 1, . . . , n. A symmetrically invertible pair, or sym-invertible pair, in H is a pair ofdistinct vertices u, v, such that there exist congruent walks P from u to v and Q from vto u, which avoid each other.

4

A somewhat different notion of invertible pairs occurs in the study of list homomor-phisms [13], and so we add the adjective ‘symmetrically’ or the prefix ‘sym-’ to distinguishthe two concepts.

We define an auxiliary digraph H∗ as follows. The vertices of H∗ are all ordered pairs(x, y) of distinct vertices of H, and there is an arc in H∗ from (x, y) to (x′, y′) just ifxx′, yy′ are both forward arcs of H but xy′, yx′ are not both forward arcs of H. (Eitherjust one is an arc, or neither is an arc). Note that in H∗ we have an arc from (x, y) to(x′, y′) if and only if there is an arc from (y, x) to (y′, x′). It follows from these definitionsthat a sym-invertible pair of vertices u, v in H corresponds in H∗ to an oriented pathbetween vertices (u, v) and (v, u), i.e., H admits a sym-invertible pair if and only if thereexist u, v so that (u, v) and (v, u) belong to the same weak component of H∗.

Theorem 2.2 If H contains a sym-invertible pair, then it does not admit a Min-Maxordering.

Proof: Indeed, suppose that < is a Min-Max ordering and (x, y) and (x′, y′) areadjacent in H∗. Observe that if x precedes (respectively follows) x′ in <, then y must alsoprecede (respectively follow) y′ in <. Hence if u, v is a sym-invertible pair in H∗, then if uis ordered before (respectively after) v, by following the avoiding congruent walks P andQ from the definition of a sym-invertible pair, we conclude that also v must be orderedbefore (respectively after) u. So, a sym-invertible pair implies a violation of antisymmetry,and hence it is an obstruction to the existence of a Min-Max ordering. �

Theorem 2.3 If H contains an induced unbalanced oriented cycle of net length greaterthan one, then it does not admit a Min-Max ordering.

Proof: Indeed, suppose C is an induced unbalanced oriented cycle of net length k > 1,and let x0 be a vertex of C in which we can start a walk P around C which is constrictedfrom below. It is easy to see that such a vertex must exist; in fact, we may assume thateven P \ x0 is constricted from below. Then following P let xi (1 ≤ i ≤ k− 1) be the lastvertex on P such that the walk from x0 to xi has net length i. It is easy to see that xi, i =0, 1, . . . , k−1 are all found in the first pass around C. Then (x0, x1), (x1, x2), . . . , (xk−1, x0)belong to the same weak component of H∗, in violation of transitivity of <. Indeed, itis easy to prove, using Lemma 2.5 and the fact that C is an induced cycle, that any twopairs (xi−1, xi) and (xi, xi+1) belong to the same weak component of H∗. �

Thus we shall assume that the digraph H has no induced unbalanced cycle of netlength greater than one, and no sym-invertible pair.

Lemma 2.4 Let a, b, c be three vertices of H, such that the component of H∗ which con-tains (a, b) contains neither of (a, c), (c, b).

5

Let A,B,C be congruent walks starting at a, b, c respectively.

If A and B avoid each other, then B and C also avoid each other, and A and C alsoavoid each other.

Proof: By symmetry, it suffices to prove the claim about B and C.

Suppose A = a1, a2, . . . , an, B = b1, b2, . . . , bn, and C = c1, c2, . . . , cn (here a1 = a,b1 = b, and c1 = c). For a contradiction, suppose that B and C do not avoid each other,and let i be the least subscript such that both bici+1 and cibi+1 are faithful arcs in H.(Note that i could be equal to n− 1.)

Since (a, b) and (a, c) are not in the same component of H∗, the congruent walks

R = a1, . . . , ai, ai+1, ai, . . . , a1 and S = b1, . . . , bi, bi+1, ci, . . . , c1

do not avoid each other. Since A and B do avoid each other, any faithful arcs betweenR and S must be between bi+1, ci, . . . , c1 and ai+1, ai, . . . , a1. Suppose first there existsa subscript j < i such that ajcj+1 and cjaj+1 are faithful arcs, and let j to be chosenas small as possible subject to this. Note that there is a second possibility, that aibi+1

and ciai+1 are the only faithful arcs. We think of this case as having j = i, with theunderstanding that cj+1 is replaced by bj+1, and we will deal with it at the end of thisproof.

Since (a, b) and (c, b) are not in the same component of H∗, the congruent walks

R′ = a1, . . . , aj , aj+1, cj , . . . , c1 and S′ = b1, . . . , bj , bj+1, bj , . . . , b1

do not avoid each other. Since A and B do avoid each other and since j < i while i waschosen to be minimal, the faithful arcs must be bjaj+1, cjbj+1. Similarly, the congruentwalks

R′′ = a1, . . . , aj , cj+1, cj , . . . , c1 and S′′ = b1, . . . , bj , bj+1, bj , . . . , b1

yield the faithful arcs ajbj+1 and bjcj+1 - contradicting the fact that A,B avoid each other.

Returning now to the special case when j = i, we observe that we can use the samepair of walks R′, S′ as above and then modify the walks

R′′ = a1, . . . , ai, ai+1, ci, . . . , c1 and S′′ = b1, . . . , bi, ci+1, bi, . . . , b1,

to conclude that biai+1 is again an arc, yielding the same contradiction. �

Lemma 2.5 [21, 31] Let P1 and P2 be two constricted walks of net length r. Then thereis a constricted path P of net length r that admits a homomorphism f1 to P1 and ahomomorphism f2 to P2, such that each fi takes the starting vertex of P to the startingvertex of Pi and the ending vertex of P to the ending vertex of Pi.

6

We shall call Q a common pre-image of P1 and P2.

We now formulate a corollary of the last two lemmas.

Corollary 2.6 Let a, b, c be three vertices of H, such that the component of H∗ whichcontains (a, b) contains neither of (a, c), (c, b).

Let A,B,C be three constricted walks of the same net length, starting at a, b, c respec-tively. Suppose that A and B are congruent and avoid each other.

Then there exists congruent common pre-images A′, B′, C ′ of A,B,C starting at a, b, crespectively, such that B′ and C ′ avoid each other, and A′ and C ′ also avoid each other.

Since H has no sym-invertible pairs, we conclude that if a pair (u, v) is in a weakcomponent C of H∗, then the corresponding reversed pair (v, u) is in a different componentC ′ 6= C of H∗. Moreover, if any (x, y) also lies in C, then the corresponding reversed (y, x)must also lie in C ′, since reversing all pairs on an oriented walk between (u, v) and (x, y)results in an oriented walk between (v, u) and (y, x). Thus the components of H∗ come inpairs C,C ′ so that the ordered pairs in C ′ are the reverses of the ordered pairs in C. Wesay the components C,C ′ are dual to each other.

3 The Algorithm

We assume that H has no induced unbalanced cycle of net length greater than one, and nosym-invertible pairs. We shall give an algorithm to construct a desired Min-Max ordering<. At each stage of the algorithm, some components of H∗ have already been chosen.The chosen components define a binary relation < as follows: we set a < b if the pair (a, b)belongs to one of the chosen components. Whenever a component C of H∗ is chosen, itsdual component C ′ is discarded. The objective is to avoid a circular chain

(a0, a1), (a1, a2), . . . , (an, a0)

of pairs belonging to the chosen components. Our algorithm always chooses a componentX of maximum height from among the as yet un-chosen and un-discarded components.If X creates a circular chain, then the algorithm chooses the dual component X ′. Weshall show that at least one of X and X ′ will not create circular chain. (Note that thisimplies that the component X does not contain a circular chain.) Thus at the end of thealgorithm we have no circular chain and hence < is a total order. It is easy to see that< is a Min-Max ordering. Indeed, if i < j, s < r and ir, js ∈ A(H) but is 6∈ A(H) orjr 6∈ A(H), then (i, j) and (r, s) are adjacent in H∗ - whence we have either i < j, r < sor j < i, s < r, contrary to what was supposed.

Theorem 3.1 The algorithm avoids creating a circular chain.

7

Thus suppose that at a certain time T there was no circular chain amongst the cho-sen components, that X had the maximum height from all unchosen (and undiscarded)components, and that the addition of X to the chosen components created the circularchain (a0, a1), (a1, a2), . . . , (an, a0), and the addition of the dual component X ′ createdthe circular chain (b0, b1), (b1, b2), . . . , (bm, b0). We may suppose that T was minimum forwhich this occurs, then n was minimum value for this T , and then m was minimum valuefor this T and n. We may also assume that X contains the pairs (an, a0), (b0, bm), andpossibly other (ai, ai+1) or (bj , bj+1).

Let Ai be the weak component of H∗ containing the pair (ai, ai+1), and Bj be the weakcomponent containing the pair (bj , bj+1); subscripts are modulo n and m respectively.(Thus X = An = B′m.) Note that the minimality of n implies that no Ai contains a pair(ak, a`) for subscripts (reduced modulo n + 1) ` 6= k + 1 (and similarly for Bj). (This ishelpful when checking the hypothesis of Lemma 2.4 and Corollary 2.6, as in Case 2 below.)

Lemma 3.2 Suppose that none of the pairs (ai, ai+1) is extremal in its component Ai.

Then there exists another circular chain (a′0, a′1), (a′1, a

′2), . . . , (a′n, a

′0) where each (a′i, a

′i+1)

can be reached from the corresponding (ai, ai+1) by a walk in Ai nearly constricted frombelow.

Proof: Since (ai, ai+1) is not extremal, there exists a walk Wi in Ai from (ai, ai+1) tosome (pi, qi), which is nearly constricted from below. Corresponding to this walk in Ai,there are two walks Pi and Qi in H, from ai to pi and from ai+1 to qi respectively, whichavoid each other. Let Li be the maximum height of Wi (which is the same as in Pi, andQi).

We now explain how to choose n of the 2n vertices pi, qi which also form a circularchain. For any i, instead of ai, we choose a′i = qi−1 if Li−1 < Li, and we choose a′i = pi

otherwise. We now show that (a′0, a′1), (a′1, a

′2), . . . , (a′n, a

′0) is a circular chain; it suffices

to show that each (a′i, a′i+1) is in Ai.

Case 1. Suppose Li ≤ Li−1 and Li ≤ Li+1.

In this case, we have a′i = pi, a′i+1 = qi, and (pi, qi) is in Ai by definition.

Case 2. Suppose Li ≥ Li−1 and Li ≥ Li+1.

In this case, we have a′i = qi−1, a′i+1 = pi+1. We may assume that Li+1 ≤ Li−1

(otherwise the argument is symmetric). Consider the congruent walks A = Pi−1 fromai−1 to pi−1 and B = Qi−1 from ai to qi−1. They are nearly constricted from below, andhave maximum height Li−1. Consider the following walk C from ai+1 to pi+1: the walk Cstarts with a portion of Qi, up to the maximum height Li−1 and then back down to ai+1,followed by Pi+1. Note that C is also nearly constricted from below and has the samemaximum height Li−1. It follows that A,B,C can each be partitioned into two constrictedpieces of corresponding net lengths. Since (ai−1, ai+1), (ai+1, ai) 6∈ Ai−1 by the minimality

8

of n, Corollary 2.6 (applied to each of the constricted pieces) implies that B and C avoideach other. Since a′i = qi−1, a

′i+1 = pi+1, we have a walk in H∗ from (ai, ai+1) to (a′i, a

′i+1),

whence (a′i, a′i+1) ∈ Ai.

Case 3. Suppose Li−1 < Li < Li+1 (or Li−1 > Li > Li+1).

In this case, we have a′i = qi−1, a′i+1 = qi. Since the subscripts are computed modulo

n + 1, there must exist a subscript s such that Ls ≥ Li ≥ Ls+1. Now we again applyCorollary 2.6 to the walks A = Pi, B = Qi, and C from as+1 to ps+1 using Ps+1 and aportion of Qs, to conclude that C avoids B. Finally, we once more apply Lemma 2.4 to thethree walks B,C, and D from ai to a′i = qi−1 using Qi−1 and a portion of Pi, to concludethat D avoids B. Hence there is a walk in H∗ from (ai, ai+1) to (a′i, a

′i+1), implying that

(a′i, a′i+1) ∈ Ai. �

This will allow us, after some additional lemmas, to complete the proof of Theorem3.1. The details will be in the full version of the paper.

Corollary 3.3 The following three statements are equivalent for a digraph H

1. H admits a Min-Max ordering

2. H has no invertible pair and no induced oriented cycle of net length greater than one

3. no weak component of H∗ contains a circular chain

Proof: The equivalence of (1) and (2) is Theorem 2.1. It is obvious that (1) implies(3). Finally, (3) implies (2) as an invertible pair in H is a circular chain of length two ina weak component of H∗, and the proof of Theorem 2.3 shows that an induced orientedcycle of net length greater than one yields a circular chain in a weak component of H∗. �

It follows that the existence of a Min-Max ordering can be tested in polynomial time:to test (2), construct H∗, find its weak components, and test each for circular chains.Testing a weak component for circular chains amounts to looking at a set of ordered pairs,i.e., a digraph, and looking for a directed cycle. Acyclicity can be tested in linear time bytopological sort.

4 Extended Min-Max Orderings

We now discuss extended Min-Max orderings, for digraphs H with a fixed homomorphism` : H → ~Ck. For the remainder of this discussion, the digraph H and the homomorphism` is fixed. (The standard Min-Max orderings may be viewed as the special case k = 1.)Assume the vertices of ~Ck are 0, 1, . . . , k − 1, and let Vi = `−1(i). A k-Min-Max orderingof H is a linear ordering < of each Vi, so that the Min-Max condition (i < j, s < r and

9

ir, js ∈ A(H) imply is ∈ A(H) and jr ∈ A(H)) is satisfied for i, j and s, r in any twocircularly consecutive sets Vi and Vi+1 respectively (subscript addition modulo k). Notethat a Min-Max ordering is also a k-Min-Max ordering for any k and `; however, there aredigraphs with a k-Min-Max ordering that do not have a Min-Max ordering - for instance~Ck.

We shall consider a subgraph of H∗ defined as follows. The digraph H(k) is the sub-graph of H∗ induced by all ordered pairs (x, y) of with `(x) = `(y). We say that (u, v) is asymmetric k-invertible pair (or a sym-k-invertible pair) in H if there is in H(k) an orientedwalk joining (u, v) and (v, u). Note that each sym-k-invertible pair is just a sym-invertiblepair in H in which u and v have `(u) = `(v). Note that H may contain sym-invertiblepairs, but none with `(u) = `(v). Consider, for instance the directed hexagon ~C6 on0, 1, 2, 3, 4, 5. The pair 0, 3 is sym-invertible, but not sym-6-invertible. Note also thatthere is a homomorphism ` of ~C6 to ~C3 in which `(0) = `(3), in which the pair 0, 3 is3-invertible.

The extended version of our main theorem is the following.

Theorem 4.1 A digraph H with a homomorphism ` to ~Ck admits a k-Min-Max orderingif and only if it does not contain an induced unbalanced oriented cycle of net length otherthan k, and does not contain a sym-k-invertible pair.

Proof: The proof is similar to the case k = 1, Theorem 2.3. The only additional twistoccurs in the case when X is unbalanced, where we need to observe that each part Vi mustcontain a vertex from which there is some walk of infinite height which is constricted frombelow. �

Theorem 4.1 can be used to prove the following result conjectured in [18].

Theorem 4.2 If H has a homomorphism to some ~Ck which admits a k-Min-Max orderingthen MinHOM(H) is polynomial time solvable. Otherwise, MinHOM(H) is NP-complete.

The positive direction (the existence of a k-Min-Max ordering implies a polynomialtime algorithm) is proved in [18]. We prove Theorem 4.2 using our characterization in The-orem 4.1, by showing that MinHOM(H) is NP-complete if H contains a sym-k-invertiblepair or an induced unbalanced oriented cycle of net length other than k; this is done inthe appendix.

References

[1] R.S. Takhanov, Dichotomy theorem for general minimum cost homomorphism prob-lem, arXiv:0708.326v5.

10

[2] V.E. Alekseev and V.V. Lozin, Independent sets of maximum weight in (p, q)-colorablegraphs, Discrete Mathematics 265 (2003) 351–356.

[3] J. Bang-Jensen, P. Hell, and G. MacGillivray, Hereditarily hard H-colouring problems,Discrete Math. 138 (1995) 75–?92.

[4] L. Barto, M. Kozik, and T. Niven, The CSP dichotomy holds for digraphs with nosources and sinks (a positive answer to a conjecture of Bang-Jensen and Hell), SIAMJ. Computing, in print.

[5] L. Barto, M. Kozik, M. Maroti, and T. Niven, CSP dichotomy for special triads, Proc.AMS, in print.

[6] A. A. Bulatov, Tractable conservative constraint satisfaction problems, 18th IEEESOLCS (2003) pp. 321–330.

[7] A. A. Bulatov, P. G. Jeavons, and A. A. Krokhin, Constraint satisfaction problemsand finite algebras, 27th ICALP (2000) pp. 272–282.

[8] C Carvalho, V. Dalmau, A. Krokhin, Caterpillar duality for constraint satisfactionproblems, 23rd Annual IEEE Symposium LICS, 307-316.

[9] D. Cohen, M. C. Cooper, P. Jeavons, Constraints, consistency and closure, ArtificialIntelligence 101 (1998), 251265.

[10] D. Cohen, M. Cooper, P. Jeavons, and A. Krokhin, A maximal tractable class of softconstraints. J. Artif. Intell. Res. 22 (2004), 1–22.

[11] T. Farnqvist and P. Jonsson, Bounded treewidth and CSP-related problems,ISAAC2007.

[12] T. Feder, P. Hell, and J. Huang, Bi-arc graphs and the complexity of list homomor-phisms, J. Graph Theory 42 (2003) 61 - 80.

[13] T. Feder, P. Hell, J. Huang, and A. Rafiey, Adjusted interval digraphs, ElectronicNotes in Discrete Mathematics 32 (2009) 83–91.

[14] T. Feder, M. Vardi, The computational structure of monotone monadic SNP andconstraint satisfaction: a study through datalog and group theory, SIAM Journal onComputing 28 (1998) 57–104.

[15] A. Gupta, P. Hell, M. Karimi, and A. Rafiey, Minimum cost homomorphisms toreflexive digraphs, LATIN 2008.

[16] G. Gutin, P. Hell, A. Rafiey and A. Yeo, A dichotomy for minimum cost graphhomomorphisms, European J. Combin. 29 (2008) 900–911.

11

[17] G. Gutin, A. Rafiey and A. Yeo, Minimum cost and list homomorphisms to semicom-plete digraphs, Discrete Appl. Math. 154 (2006), 890–897.

[18] G. Gutin, A. Rafiey and A. Yeo, Minimum Cost Homomorphisms to SemicompleteBipartite Digraphs, SIAM Journal of Discrete Math. 22 (2008) 1624–1639.

[19] G.Gutin, A. Rafiey, A.Yeo, Minimum Cost Homomorphism to Oriented Cycles. Sub-mitted.

[20] G. Gutin, A. Rafiey, A. Yeo and M. Tso, Level of repair analysis and minimum costhomomorphisms of graphs. Discrete Appl. Math. 154 (2006), 881–889.

[21] R. H aggkvist, P. Hell, D. J. Miller, and V. Neumann Lara, On multiplicative graphsand the product conjecture, Combinatorica 8 (1988) 7181.

[22] M. M. Halldorsson, G. Kortsarz, and H. Shachnai, Minimizing average completion ofdedicated tasks and interval graphs. Approximation, Randomization, and Combina-torial Optimization (Berkeley, Calif, 2001), Lecture Notes in Computer Science, vol.2129, Springer, Berlin, 2001, pp. 114–126.

[23] P. Hell and J. Nesetril, On the complexity of H-colouring, J. Combin. Theory B 48(1990), 92–110.

[24] P. Hell and J. Nesetril, Graphs and Homomorphisms. Oxford University Press, Ox-ford, 2004.

[25] K. Jansen, Approximation results for the optimum cost chromatic partition problem.J. Algorithms 34 (2000) 54–89.

[26] P. G. Jeavons, On the algebraic structure of combinatorial problems, Theoret. Com-put. Sci. 200 (1998) 185–204.

[27] T. Jiang and D. B. West, Coloring of trees with minimum sum of colors. J. GraphTheory 32 (1999), 354–358.

[28] L.G. Kroon, A. Sen, H. Deng, and A. Roy, The optimal cost chromatic partitionproblem for trees and interval graphs, Graph-Theoretic Concepts in Computer Science(Cadenabbia, 1996), Lecture Notes in Computer Science, vol. 1197, Springer, Berlin,1997, pp. 279–292.

[29] J. Spinrad, Efficient Graph Representations, Fields Institute Monographs, AMS2003.

[30] K. Supowit, Finding a maximum planar subset of a set of nets in a channel. IEEETrans. Computer-Aided Design 6 (1987), 93–94.

[31] X. Zhu, A simple proof of the multipilicatively of directed cycles of prime powerlength. Discrete Appl. Math. , 36 (1992) 333-345.

12

5 Appendix

5.1 Proof of Theorem 3.1

We distinguish two principal cases, depending on whether or not the component X isbalanced.

We first assume that the component X is balanced.

Suppose the height of X is h.

Lemma 5.1 Suppose some (ak, ak+1) is extremal in Ak.

Let (ai, ai+1), (aj , aj+1) be distinct non-extremal pairs in Ai, Aj respectively, and letWi,Wj be walks in Ai, Aj starting from (ai, ai+1), (aj , aj+1) respectively, that are nearlyconstricted from below. Let Li, Lj be the maximum heights of Wi,Wj respectively.

Then Li > h or Lj > h.

Proof: Suppose Li ≤ h, Lj ≤ h, and assume, without loss of generality, that Li ≤ Lj .Since some (ak, ak+1) is extremal, we may assume that neither (ai−1, ai), nor (aj+1, aj+2)initiate walks of negative net length with maximum height at most h. Thus each of(ai−1, ai), (aj+1, aj+2) is either extremal, and thus initiate a constricted walk of net lengthh, or initiates a walk of negative net length, with maximum height greater than h, andhence again initiates a constricted walk of net length h. Thus we have

• a constricted walk Ui of net length h from ai

• a walk Vi, nearly constricted from below, from ai to some p

• a constricted walk Uj+1 of net length h from aj+1

• a constricted walk Uj+2 of net length h from aj+2, which avoids Uj+1 and is congruentto it

• a walk Vj , nearly constricted from below, from aj , and

• a walk Vj+1, nearly constricted from below, from aj+1) to some q, which avoids Vj

and is congruent to it.

Consider the three walks A,B,C, where A is the reverse of Vj+1 (starting in q), Bis the reverse of Vj , and C is the reverse of Vi followed by a suitable piece of Ui (andits reverse) as needed to have the same maximum height Lj as Vj . Each of these walksconsists of two constricted pieces and hence we can apply Corollary 2.6 twice to concludethat there exist congruent pre-images A′ and C ′ of A and C respectively, which avoid

13

each other. We can also apply Corollary 2.6 to the constricted walks Uj+1, Uj+2, Ui toconclude that there are congruent pre-images A′′, C ′′ of Uj+1, Uj respectively, which avoideach other. Concatenating A′ with A′′ and C ′ with C ′′, we conclude that (p, q) belongs toa component of H∗ which has height greater than h; this means that before X we shouldhave chosen the component of H∗ containing (ai, aj), which is a contradiction. �

Lemma 5.2 If any (ai, ai+1) is extremal in Ai, then (an, a0) is extremal in X = An.

Proof: Suppose (an, a0) is not extremal. By Lemma 5.1, it remains to consider thecase when both (a0, a1) and (an−1, an) are extremal. Since (a0, a1) is extremal, thereexists a constricted walk in H∗ starting from (a0, a1) of net length equal to the height ofA0, which is at least h, according to our algorithm. Similarly, there exists a constrictedwalk from (an−1, an) of net length equal to the height of An−1, which is also at least h.From the walk in An−1, we extract a constricted walk A starting in an−1, and a congruentconstricted walk B starting in an such that A,B have net length h and avoid each other.From the walk in A0 we moreover extract a walk C starting in a0 which is also constrictedand has net length h. Now Corollary 2.6 ensures that B and C have congruent pre-imagesB′ and C ′ which avoid each other. Let B′′, C ′′ be two congruent walks of negative netlength from an, a0 respectively, which avoid each other; such walks exist since (an, a0) isnot extremal. Now taking the concatenations of (B′′)−1 with B′ and (C ′′)−1 with C ′ yieldsa walk in X of net length greater than h, which is a contradiction. �

Thus Lemma 3.2 ensures that we may assume that (an, a0) is extremal in X (andsimilarly for (b0, bm)). The proof now distinguishes whether or not X contains anotherpair (ai, ai+1) (or similarly for (bj , bj+1)).

Suppose first that some (ai, ai+1) ∈ X, and let W be a walk from (an, a0) to (ai, ai+1)in X. We observe that the net length of W must be zero. Indeed, since (an, a0) is extremalin X, the net length of W must be non-negative. If the net length were positive, thenW−1 would be a walk from (ai, ai+1) of negative net length and with maximum heightless than h. Thus Lemma 5.1 implies that both (ai−1, ai), (ai+1, ai+2) initiate walks ofnet length h, yielding walks Ui−1, Ui, Ui+1, Ui+2 of net length h, from Ui−1, Ui, Ui+1, Ui+2,respectively. Here Ui−1, Ui are congruent constricted walks that avoid each other, andhence Corollary 2.6 implies that there are pre-images of Ui, Ui+1 of net length h that arecongruent and avoid each other. This yields a walk in X from (ai, ai+1) of net length h- and concatenated with W we obtain a walk in X from (an, a0) of net length strictlygreater than h, which is impossible.

Thus the net length of W is zero, and hence it can be partitioned into two constrictedpieces, U from (an, a0) to some vertex (z1, z2) of maximum height, and V from (z1, z2)to (ai, ai+1). Let U1 (respectively U2) denote the corresponding walk from an to z1 (re-spectively from a0 to z2), and similarly for V1, V2. Then Lemma 2.4 applied to U1, U2, V2

implies that (z1, z2) and (an, ai+1) are in the same component of H∗; however, (z1, z2) ∈ X,so (an, ai+1) ∈ X, contrary to the minimality of n.

14

Thus we conclude that X does not contain another (ai, ai+1) or (bj , bj+1). In otherwords, before time T we have the chosen all the pairs

(a0, a1), . . . , (an−1, an), (b0, b1), . . . , (bm−1, bm),

and then at time T we chose the component X containing (an, a0) as well as (b0, bm).Consider a fixed walk W in X from (an, a0) to (b0, bm). Since (an, a0), and by symmetryalso (b0, bm), is extremal, W must have net length zero. Moreover, we may assume thatW reaches some vertex (z1, z2) of maximum height h. Thus W consists of two constrictedwalks U, V . Let again U1 (respectively U2) be the corresponding walk in H from an

(respectively from a0) to a vertex of maximum height, and similarly let V1 (respectivelyV2) be the corresponding walks from the vertices of maximum height to b0 (respectivelybm).

We shall prove first that there is a constricted walk of net length h from a1. Indeed,the component A0, containing the vertex (a0, a1) must have height at least h, accordingto the rules of our algorithm. If (a0, a1) does not initiate a walk of net length h, it mustnot be extremal, i.e., it must initiate a walk of negative net length. The same argumentyields a walk of negative net length from (a1, a2). Since such walks contain walks thatare nearly constricted from below, we obtain a contradiction with Lemma 5.1. A similarargument applies to b1.

Thus there are constricted walks of net length h from both a1 and b1, say R and Srespectively. We can now use Corollary 2.6 on the walks A = U1, B = U2, C = R, andagain on the walks A = V1, B = V2, C = R−1 to deduce that U2 concatenated with V2 andR concatenated with R−1 avoid each other, whence (a0, a1) and (bm, a1) are in the samecomponent of H∗. By a similar argument we also deduce that (b0, b1) and (an, b1) are alsoin the same component of H∗. This is impossible, as it would mean that at time T−1 therealready was a circular chain, namely (bm, a1), (a1, a2), . . . , (an, b1), (b1, b2), . . . , (bm−1, bm).

This completes the proof of Theorem 3.1 in case X is balanced.

We now assume the component X is unbalanced.

In this case, the rules of the algorithm imply that each component Ai and Bj is alsounbalanced. Thus each of the components contains an oriented cycle of net length one,and hence there is a closed walk of net length one, or minus one, starting in any vertex inany of these components. In particular, as we observed before, an unbalanced digraph doesnot contain any extremal vertices. We shall define a vertex u in an unbalanced digraph tobe weakly extremal if there is a walk starting from u which is constrained from below andhas infinite maximum height. Each oriented cycle of positive net length, and hence eachunbalanced digraph, contains a weakly extremal vertex.

Recall our assumptions that X contains (an, a0), (b0, bm) and maybe other pairs, cre-ating the circular chain (a0, a1), (a1, a2), . . . , (an, a0) in X and the circular chain (b0, b1),(b1, b2), . . . , (bm, b0) in X ′.

15

We first claim that we may assume that each (ai, ai+1) (and similarly each (bj , bj+1))is weakly extremal. Indeed, suppose there is a walk in Ai from (ai, ai+1) to some weaklyextremal vertex (ei, ei+1), of negative net length `i. Let ` be the minimum of all `i, i =0, . . . , n. Since (ai, ai+1) initiates a closed walk in Ai of net length minus one, there isa walk from each (ai, ai+1) to the weakly extremal vertex (ei, ei+1) of net length `. Nowwe apply Lemma 3.2 ` times to obtain a circular chain (a′0, a

′1), (a′1, a

′2), . . . , (a′n, a

′0). It

follows from the proof of Lemma 3.2 that each (a′i, a′i+1) has a walk of net length zero to

(ei, ei+1); this means that each (a′i, a′i+1) is weakly extremal.

As in the balanced case, we first assume that some (ai, ai+1) ∈ X. Then there is awalk W from (an, a0) to (ai, ai+1) in X of net length zero. Indeed, the argument aboveshows that both (an, a0) and (ai, ai+1) have a walk of net length ` to (ei, ei+1), since inthis case Ai = An = X. As before, X can be partitioned into two constricted pieces, Uand V , and Lemma 2.4 implies that (an, ai+1) ∈ X, contrary to the minimality of n.

If X does not contain another (ai, ai+1) or (bj , bj+1), we again proceed as in the bal-anced case. There exists a walk W in X of net length zero from (an, a0) to (b0, bm). (Both(an, a0) and (b0, bm) can reach (en, e0) with walks of the same net length.) Let L be themaximum height of W . Thus W consists of two constricted walks U, V . Let again U1 (re-spectively U2) be the corresponding walk in H from an (respectively from a0) to a vertexof maximum height, and similarly let V1 (respectively V2) be the corresponding walks fromthe vertices of maximum height to b0 (respectively bm). Since (a0, a1) is weakly extremal,there is a constricted walk of net length L from a1, and for a similar reason, there is sucha walk also from b1.

We can now use Corollary 2.6 as in the balanced case, to deduce that (a0, a1) and(bm, a1) are in the same component of H∗, and that (b0, b1) and (an, b1) are in the samecomponent of H∗, yielding the same contradiction.

This completes the proof of Theorem 3.1.

5.2 The NP-completeness Claims

Our basic NP-completeness tool is summarized in the next lemma.

Lemma 5.3 Let H be a digraph and x, y two vertices of H; let S be a digraph and s, ttwo vertices of S. Suppose we have costs cj(i) of mapping vertices i of S to vertices j ofH where cx(s) = cx(t) = 1, cy(s) = cy(t) = 0, and such that there exists

• a homomorphism f : S → H mapping s to x and t to y of total cost 1 (i.e., in whichall other vertices of S, different from s, t, map to vertices of H with costs zero)

• a homomorphism g : S → H mapping s to x and t to x of total cost 2 (other verticesmap with costs zero)

16

• a homomorphism h : S → H mapping s to y and t to x, of total cost 1 (other verticesmap with costs zero)

• but no homomorphism S → H mapping s to y and t to y of cost at most |V (S)|.

Then MinHOM(H) is NP-complete.

Proof: Let G be an arbitrary graph, an instance of the maximum independent setproblem. We construct a corresponding instance D of MinHOM(H) by replacing everyedge of G by a copy of S. Note that D contains all old vertices of G, as well as the newvertices each lying in a separate copy of S. The costs ci(j), i ∈ V (H), j ∈ V (D), aredefined as follows.

• if v is an old vertex of G, then cx(v) = 1, cy(v) = 0, and cz(v) = |V (G)| for all otherz ∈ V (H),

• if v is a new vertex of D lying in a copy of S, its costs are determined by thecorresponding costs cj(v) in S.

Note that since we have cx(s) = cx(t) = 1, cy(s) = cy(t) = 0, the two parts of thedefinition don’t conflict. We now claim that G has an independent set of size k if and onlyif there exists a homomorphism of D to H of cost |V (G)|−k. Indeed, if I is an independentset in G, we define a homomorphism φ : D → H by setting φ(j) = y if j ∈ I, φ(j) = xif j ∈ V (G) \ I, and extending this mapping to a homomorphism of D to H, using themappings f, g, h. It is clear that the cost of φ is exactly |V (G)| − |I|. Conversely, let f beany homomorphism of D to H of total cost less than |V (G)|. Thus the old vertices of Gmust map to either x or y. If two adjacent vertices are mapped to y we incur a cost of atleast |V (S)| ≥ 2. Thus we may assume that those vertices that map to y are independent.Since the old vertices of G that map to x contribute a cost of one each, we conclude thatif there is a homomorphism of cost |V (G)| − k then there is an independent set of size kin G. �

One example in which we can easily use this lemma deals with a special case of sym-invertible pairs.

Corollary 5.4 Suppose u, v is a sym-invertible pair in H with corresponding walks P,Q,such that there are some faithful arcs from P to Q but there are no faithful arcs from Qto P .

Then the problem MinHOM(H) is NP-complete.

Proof: We assume P = u = a1 . . . an = v,Q = v = b1 . . . bn = u, and let S = s1 . . . sn

be a path (all vertices are distinct) congruent to P (and Q). Define the cost of mapping

17

vertices of S to H as follows. If cu(s1) = cu(sn) = 1, and cv(s1) = cv(sn) = 0, andcai(si) = cbi

(si) = 0 for 1 < i < n. In any other case the cost is n.

Clearly there are obvious homomorphisms φ : S → P and ψ : S → Q. Define alsoζ : S → H to be the homomorphism defined by ζ(si) = ai for 1 ≤ i ≤ k and ζ(si) = bi fork + 1 ≤ i ≤ n. Let atbt+1 be a faithful arc from P to Q. Suppose there is homomorphismg : V (S) → V (P ) ∪ V (Q) such that g(s1) = g(sn) = v. Then the cost of g is at least nunless g(ri) is ai or bi. Since g(s1) = g(sn) = v, there has to be a faithful arc from Q to Pin H, which is a contradiction. Now by apply Lemma 5.3 for P,Q and S MinHOM(H). �

We next consider the case where some sym-invertible pair has faithful arcs both fromP to Q and from Q to P .

It was noted in [16] (using [2]) that the following problem Π3 is NP-complete. Givena three-coloured graph G and an integer k, decide if there exists an independent set of kvertices. It is easy to see that this fact can be generalized to the following problem

Π2m+1:

Given a graph G with a homomorphism f : G → C2m+1, decide if there exists anindependent set of k vertices.

Lemma 5.5 Each problem Π2m+1 is NP-complete.

Proof: Modify every instance G of Π2m−1 to an instance G′ of Π2m+1 by replacingeach edge of G between classes f−1(1) and f−1(2) by a path of length three. �

We apply this result as follows.

Lemma 5.6 Suppose u, v is a sym-invertible pair in H with corresponding walks P,Q,such that there are faithful arcs from P to Q as well as faithful arcs from Q to P .

Then MinHOM(H) is NP-complete.

Proof: The walks P = x0, x1, . . . , xn and Q = y0, y1, . . . , yn can be organized intosegments P1, . . . Pk, Q1, . . . , Qk, where for each i all faithful arcs between P and Q go fromP to Q or from Q to P . Assume Pi = xri−1 , xri−1+1, . . . , xri and Qi = yri−1 , yri−1+1, . . . , yri

with r0 = 0, rk = n, and assume, without loss of generality, that there are faithful arcsfrom P1 to Q1 but no faithful arcs from Q1 to P1, there are faithful arcs from Q2 to P2

but no faithful arcs from P2 to Q2, etc. Note that if k is odd, the faithful arcs of thelast segment go from Q to P , and if k is even, they go from P to Q. Let Ri be a pathcongruent to Pi (and Qi), and for simplicity assume that Ri = ri−1, . . . , ri.

Case 1. Assume k is odd.

We reduce Πk to MinHOM(H) as follows. Consider an instance of Πk, namely, a graphG with a homomorphism f to Ck. Suppose the vertices of Ck are 1, 2, . . . , k (consecutively,

18

and viewed modulo k). Replace each edge uv of G with u ∈ f−1(i) and v ∈ f−1(i + 1)(modulo k) by a copy Ri(u, v) of Ri, identifying ri−1 with u and ri with v, obtaining adigraph D. The costs of mapping an old vertex (from G) u in f−1(i) with i odd will becxri

(u) = 1, cyri(u) = 0, while the costs of mapping an old vertex u in f−1(i) with i even

will be cxri(u) = 0, cyri

(u) = 1. For vertices inside the substituted copies of R, we proceedas above, defining their costs to be zero only for the corresponding vertices in R(u, v). Allother costs are |V (G)|.

Suppose i is odd. Each homomorphism of Ri to D taking ri−1 to xri−1 and ri to yri

has a very high cost, but all other possibilities (ri−1 to xri−1 and ri to xri ; ri−1 to yri−1

and ri to yri ; and ri−1 to yri−1 and ri to xri) have cost 1. A similar analysis applies toi even. A special consideration is needed for the last segment Rk, where we use the factthat xrk

= xn = y0 and yrk= yn = x0.

As in the proof of Corollary 5.4, these facts imply that G has an independent set ofsize ` if and only if D has a homomorphism to H of cost |V (G)| − `.

Case 2. Assume k is even.

In this case instead of the sym-invertible pair u, v with walks P,Q we consider the sym-invertible pair yr1 , xr1 with walks P ′, Q′ where P ′ = yr1 , . . . , yr2 , . . . , yrk−1

, . . . yrk= yn =

x0, . . . , xr1 , and Q′ = xr1 , . . . , xr2 , . . . xrk−1, . . . xrk

= xn = y0, . . . , yr1 . Note that there areno faithful arcs from xrk−1

, . . . xrk= xn = y0, . . . , yr1 to yrk−1

, . . . yrk= yn = x0, . . . , xr1 .

Thus we obtain an odd number of segments and we can proceed as above, unless k = 2 inwhich case we only have one segment and Corollary 5.4 applies. �

We can now handle the case when H is balanced. Recall that this means that thevertices of H have levels 0, 1, . . . , h so that each arc goes from some level i to level i+ 1.It is easy to see that in a balanced digraph a sym-invertible pair u, v must have u andv on the same level. Thus all sym-k-invertible pairs have k = 1, i.e., we only have sym-invertible pairs. Therefore, the NP-completeness part of Theorem 4.2 in this case reducesto the following.

Theorem 5.7 If a balanced digraph H contains a sym-invertible pair, then MinHOM(H)is NP-complete.

Proof: By Corollary 5.4 and Lemma 5.6, we may assume that we have a sym-invertiblepair u, v and corresponding walks P,Q with no faithful arcs between P and Q. Considerthe walk W in H∗ from (u, v) to (v, u) corresponding to P and Q. If some (a, b) lies onW , then there is a walk in H∗ from (a, b) to (b, a) (because H∗ has an arc from (x, y) to(x′, y′) if and only it has an arc from (y, x) to (y′, x′)). Thus we may assume that u, v areon the lowest level of P and Q. Let z be vertex on the highest level of P and let w be thecorresponding vertex on Q. Let R be the walk obtained by following Q from v to w andthen following Q−1 back from w to v. Let the path S be the common pre-image of P,Q,

19

and R, obtained by applying Lemma 2.5 twice, since P,Q,R consist of two constrictedpieces. Let f be the corresponding homomorphism of S to P , let g be the correspondinghomomorphism of S to Q, and let h be the corresponding homomorphism of S to R.We define the cost of mapping an internal vertex j of S to a vertex i of H to be zero ifi ∈ {f(j), g(j), h(j)}; the cost of mapping the first and the last vertex of S to v is 1 and tou is zero. In all other cases the cost is |V (S)|. Note that there is no homomorphism fromS to H which maps both beginning and end of S to u of total cost smaller than |V (S)|,as otherwise there would be a faithful arc from P to Q. Now by applying Lemma 5.3 toS and f, g, h we conclude that MinHOM(H) is NP-complete. �

Corollary 5.8 Theorem 4.2 holds for balanced digraphs H.

Specifically, for a balanced digraph H the problem MinHOM(H) is polynomial timesolvable if H has a Min-Max ordering, and is NP-complete otherwise.

We observe that the same proof applies even in unbalanced digraphs H as long asP (and hence Q) has net length zero. Specifically, if any digraph H has an invertiblepair u, v with corresponding walks P,Q which have net length zero, then MinHOM(H) isNP-complete.

Thus we may now focus on unbalanced digraphs H.

Theorem 5.9 Suppose H is weakly connected and contains two induced oriented cyclesC1, C2, with net lengths k, n > 0, k 6= n.

Then MinHOM(H) is NP-complete.

We will use the following analogue of Lemma 2.5 for infinite walks which are constrictedin the infinite sense, i.e., are constricted from below and have infinite height.

Corollary 5.10 Let P1 and P2 be two walks of infinite height, constricted from below.Assume that Pi starts in pi, i = 1, 2, and let qi be a vertex on Pi, such that the infiniteportion of Pi starting from qi is also constricted from below, and the portions of Pi frompi to qi have the same net length, for i = 1, 2.

Then there is an oriented path P that admits homomorphisms fi to Pi taking thestarting vertex of P to pi and the ending vertex of P to qi, for i = 1, 2.

Proof of the Corollary: Let P ′i be the portion of Pi from pi to qi, and suppose,without loss of generality, that the height h of P ′1 is greater than or equal to the heightof P ′2. Let ri be the first vertex after qi. (or equal to qi) on Pi, such that the net lengthfrom pi to ri is h. Let Ri be the subwalk of Pi from pi to ri. Now Lemma 2.5 impliesthat there is a path R with homomorphisms fi to Ri taking the beginning of R to pi and

20

the end of R to ri. Suppose x is the last vertex on P ′1 with f1(x) = q1: if f2(x) = q2, weare done, so suppose f2(x) = y 6= q2. Now consider the subwalk Y of P ′2 joining y and q2:it has net length zero and is constricted from below, because the portion of R between xand the end of R has net length zero and is constricted from below. Let h′ be the heightof Y , and let X be the walk on P ′1 from q1 to the first vertex making a net length h′ andthen back to q1. Since X and Y have the same height and have net length zero, we cansplit them into two constricted pieces, and so Lemma 2.5 implies that there is a path R′

which is a common pre-image of X and Y . Concatenating R with R′ yields a path P andwe can extend the homomorphisms fi to P so that also the ending vertex of P is taken toqi, for i = 1, 2. �

Proof of the Theorem: Suppose k > n, so k does not divide n. We may assumethat H is minimal, in the sense that no weakly connected subgraph H ′ of H with fewervertices contains two induced cycles with different non-zero net lengths. Indeed, if H ′ weresuch a subgraph, then MinHOM(H ′) would be polynomially reduced to MinHOM(H) bythe cost of mapping to vertices of H not in H ′ very high.

Each cycle Ci, i = 1, 2, contains a vertex ui such that the walk starting in ui andfollowing Ci (in the positive direction) is constricted from below. Let U be a walk in Hfrom u1 to u2, and let u be a vertex on U of minimum height. By minimality, we mayassume V (H) = V (C1)∪V (C2)∪U . Let Pi, i = 1, 2, be the walk from u to ui following U(or U−1), then once around Ci (in the positive direction), and then back from u followingU−1 (or U). It follows that each Pi is constricted from below. The net length of P1

is k and the net length of P2 is n. Let Qi, i = 1, 2, be the infinite walk starting at uobtained by repeatedly concatenating Pi, and let Q′i be the two-way infinite walk obtainedby expanding Qi in the opposite direction by repeatedly concatenating P−1

i .

Let d be greatest common divisor of n and k, and let a = k/d−2. Thus (a+ 2)n is thesmallest positive common multiple of n and k. We now define the following three walksW1,W2,W3 in H of net length (a+ 1)n.

1. The walk W1 starts at u and follows Q1 going around P1 until the last vertex v suchthat the net length of the resulting walk is (a+ 1)n

2. W2 also starts at u and follows Q2 going around P2 fully (a+ 1) times, ending at u

3. W3 starts at v and follows P1 until the first occurrence of u, and then continues atimes around P2, ending again at u.

Now we define, in analogy with Q1, Q2, also the infinite walk Q3, obtained from W3 bycontinuing to go around P2. Because we chose v to be the last on Q1 with the right netlength, the walk W3 is constricted from below; of course W1,W2 are also constricted frombelow. HenceQ1, Q2, Q3 are also constricted from below; they have infinite heights becauseC1, C2 have positive net length. Thus we can apply Corollary 5.10 to Q1, Q2, Q3, obtaining

21

a common pre-image which is a path S, say s = s0, s1, . . . , sq = t, with homomorphismsf, g, h of S to Q1, Q2, Q3 respectively, such that

1. f(s) = u, f(t) = v

2. g(s) = g(t) = u

3. h(s) = v, h(t) = u

Note that the walk W ′1 equal to u = f(s0), f(s1), . . . , f(sq) = v, the walk W ′2 equal tov = g(s0), g(s1), . . . , g(sq) = u, and the walk W ′3 equal to v = h(s0), h(s1), . . . , h(sq) = uare congruent.

Assume first that W ′1,W′3 do not avoid each other, i.e., for some i we have both the

faithful arcs (forward or backward) f(si)h(si+1), h(si)f(si+1). Note that W ′1 ∪W ′2 ∪W ′3contains all the vertices of H, so the minimality of H easily implies that all four verticesf(si), h(si), f(si+1), h(si+1) must belong to C1 ∪ C2. Since the cycles are induced. wemust have two vertices in each cycle. Up to symmetry, we may assume we have forwardarcs ab ∈ C1 and cd ∈ C2, as well as forward arcs ad, cb in H. Then, say, a = f(si),b = f(si+1), c = h(si), d = h(si+1).

We first claim that C1, C2 do not have common vertices, or arcs joining them otherthan ad, cb. Otherwise, let x on C1 be the first vertex following b in the direction oppositeto a, equal to or adjacent with some y on C2, and assume that y is the first vertex ofC2 following d, in the direction opposite to c, adjacent to x. Consider the cycle D1 witharcs ab, ad, xy, the portion of C1 between b and x not containing a, and the portion ofC2 between d and y not containing c, and the cycle D2 with arcs cb, cd, xy, and the sameportions of C1, C2. The cycles D1, D2 have the same net length m. If m is not zero andnot k, we could delete c and obtain a smaller weakly connected H ′ with two differentnon-zero net lengths. If m is not zero and not n we could likewise delete a. Thus m = 0.If x has no neighbours on C2 other than y, then consider instead of D2 the cycle D′2obtained from D2 by replacing the portion of C2 between c and y containing d by theportion of C2 between c and y not containing d. Since m = 0, the net length of D′2 is n,so we can delete d and obtain a smaller weakly connected H ′ with two different non-zeronet lengths. Otherwise, let y1, y2, . . . , yp be all the neighbours of x on C2 after y = y0,numbered consecutively in the direction from y to c, away from d. Consider the orientedcycles Yi containing x, yi, yi+1 and the segment of C2 between yi and yi+1 not containingd. Each Yi is an induced cycle in H, and the sum of their net lengths in n. Hence atleast one Yi has a non-zero net length and we similarly obtain a contradiction with theminimality of H.

Thus H consists of C1, C2, and the two extra arcs (forward or backward) ad, cb; inparticular u ∈ C1 ∪C2, and the path U uses ad or bc. Without loss of generality, we mayassume that it uses bc, since we can replace ad by ab, bc, cd. Suppose first that u ∈ C1,

22

whence we also have v ∈ C1. Consider the initial portion of W ′1 from v to b = f(si+1):it has net length equal to a multiple of k (corresponding to going full rounds around thecycle C1) plus the net length of the portion X1 of C1 (in the positive direction) from u tob. Consider next the initial portion of W ′3 from v to c followed by the arc joining c andb: it has net length equal to n (corresponding to going from v to u, which must precedec ∈ C2) plus a multiple of n (corresponding to going full rounds around the closed walk P2

from u to u) plus the net length of the portion X2 of P2 (in the positive direction) fromu to c concatenated with the arc joining c and b. However, from u to c we must use thearc joining b and c. Thus X2 uses the arc joining b and c first in one direction and then inthe opposite direction, whence the net lengths of X1, X2 are the same. This means that amultiple of n, smaller than (a+ 2)n is also a multiple of k, which is impossible.

It remains to consider the case when W ′1,W′3 do avoid each other. We now assume that

of all homomorphisms f, g, h of S to Q1, Q2, Q3 satisfying properties (1, 2, 3) and suchthat the resulting walks W ′1,W

′3 avoid each other, we have chosen ones that maximize the

number of vertices with f(si) = g(si) or g(si) = h(si).

If W ′1,W′3 have at least some faithful arcs, then Corollary 5.4 and Lemma 5.6 imply

MinHOM(H) is NP-complete. Thus we may assume that there are no faithful arcs betweenW ′1 and W ′3.

We now define the costs of mapping vertices x of S to vertices j of H as follows:cj(x) = |S| except for cu(s) = cu(t) = 1, cv(s) = cv(t) = 0 and cj(si) = 0 when j ∈{f(si), g(si), h(si)}, j 6= u.

By properties (1, 2, 3), we see that to apply the Lemma 5.3 it remains to show thatthere is no homomorphism of S to H of cost |S| − 1 or less, taking both s and t to v.Suppose, for a contradiction, that there is such a homomorphism φ. Then we must haveφ(s0) = h(s0), φ(sq) = f(sq), and each φ(si) ∈ {f(si), g(si), h(si)}. Since there are nofaithful arcs between W ′1 and W ′3, we can’t have h(si) and f(si+1) adjacent. Thus, becauseof the costs, we must have some h(si) and g(si+1) as well as g(sj) and f(sj+1) are adjacent,with i < j. We now claim that this contradicts the maximality of f, g, h. Indeed, we couldredefine f to equal g up to sj (and then continuing as before, taking advantage of the arcjoining g(sj) and f(sj+1)), obtaining a new W ′1 with at least one more vertex (namelysi+1) having equality of f and g. (We need to observe that the new W ′1 still avoids W ′3,which also follows by maximality of f, g, h: there cannot be an arc between g(sp) 6= h(sp)and h(sp+1).)

From the theorem we also derive the following corollary that will complete the proofof Theorem 4.2.

Theorem 5.11 Suppose H is a digraph containing an induced oriented cycle of net lengthk > 0. If there is homomorphism ` : H → ~Ck with a sym-k-invertible pair, thenMinHOM(H) is NP-complete.

23

Proof: Recall that P is a walk from u to v and Q a congruent walk with P , from vto u. Recall also that there is a homomorphism ` : H → ~Ck, and `(u) = `(v). It followsthat the net length of P (and of Q) is divisible by k. If there are faithful arcs from Pto Q or from Q to P then by Corollary 5.4 or 5.6, MinHOM(H) is NP-complete. So wemay assume that there are such faithful arcs. We may assume that the net length of P isgreater than zero as otherwise remark following Lemma 5.8 implies that MinHOM(H) isNP-complete. We now proceed to find congruent walks from u to v and from v to u whichavoid each other, and another congruent walk from u to u, so that we can apply Lemma5.3 in a fashion similar to what was done in the proof of Theorem 5.9.

We may assume that P is constricted from below, as otherwise we replace u, v byvertices u′ ∈ P , v′ ∈ Q, where u′ is a vertex of P with the minimum height, and v′ is thecorresponding vertex of v′ in Q. We have observed that u′, v′ is also a sym-k-invertiblepair, thus there are walks P ′ from u′ to v′ and Q′ from v′ to Q′ that avoid each other.It is easy to see that the minimality of u′ implies that this new P ′ is constricted frombelow. Let C be a walk in H from u to an oriented cycle of net length k, followed bygoing around the oriented cycle once in the positive direction and then returning back onthe same walk to u. Note that the net length of this walk is k. We may again assumethat C is constricted from below, as otherwise instead of P,Q we could use P1, Q1, whereP1 is obtained by concatenating P with (QP )a and Q1 is obtained by concatenating Qwith (PQ)a for some positive a, such that the walk from u (at the beginning of P1) to the(a− 1)-th appearance of u in P1, followed by C is a walk constricted from below.

Let the net length of P be `k, with ` > 0. Let W be the infinite walk obtained byrepeatedly concatenating C; note that W is constricted from below. Let P ′ be the infinitewalk obtained by concatenating P with infinitely many repetitions of QP . Let Q′ be theinfinite walk congruent to P ′ obtained by similarly concatenating Q with repetitions ofPQ. Let C ′ be the walk in W , from u to a vertex u′ that is the `-th occurrence of u inW . Now we apply Corollary 5.10 to obtain a path S = s0, s1, . . . , st which is the commonpre-image of P,C ′, Q. In this application, we use P ′,W,Q′ as the infinite walks, and theends of P,C ′, Q as the vertices qi. (Note that P,C ′, Q all have net length `k. Corollary5.10 also yields homomorphisms f, g, h of S to P ′,W,Q′ taking s0 to the beginnings ofP ′,W,Q′ (also the beginnings of P,C ′, Q), and taking st to the ends of P,C ′, Q. Let P ′′

be the walk f(s0), f(s1), . . . , f(st), let Q′′ be the walk h(s0), h(s1), . . . , h(st), and let C ′′

be the walk g(s0), g(s1), . . . , g(st). Observe that P ′′, Q′′ avoid each other and between thewalks P ′′, Q′′ there are no faithful arc, because that was the case for P,Q.

Note that f(s0) = u and f(st) = v, g(s0) = g(st) = u and h(s0) = v, h(st) = u. Wedefine the costs as follows, the cu(s0) = cu(st) = 1, and cv(s0) = cv(st) = 0, and ci(x) = 0when i ∈ {f(x), g(x), h(y)}, x 6= u. For any other case the cost is |V (S)|.

We now conclude the proof as in Theorem 5.9, assuming that the homomorphismsf, g, h of S to V (P ′′)∪V (C ′′)∪V (Q′′) satisfy properties 1, 2, 3, and maximize the numberof vertices with f(si) = g(si) or g(si) = h(si). �

24

We are finally ready to conclude the Proof of Theorem 4.2, i.e., to prove the con-jecture from [18].

Recall that the polynomial case of the Theorem has been established in [18]. For theNP-completeness claim, the case when H is balanced in handled by Corollary 5.8. Thuswe may assume that H has an induced oriented cycle of some positive net length k. It is awell-known fact (e.g. Corollary 1.17 in [24]) that H has a homomorphism to ~Ck if and onlyif it does not contain a closed walk of net length not divisible by k. Suppose first that Hdoes not admit a homomorphism to ~Ck. Then the above fact implies that H contains aninduced oriented cycle of net length not divisible by k. Hence the problem MinHOM(H)is NP-complete by Theorem 5.9. If, on the other hand, H does admit a homomorphismto ~Ck, with a sym-k-invertible pair, then MinHOM(H) is NP-complete by Theorem 5.11.This completes the proof.

25


Recommended