Page 1

Minimum Cost Homomorphism Dichotomy for

Oriented Cycles

Gregory Gutin1, Arash Rafiey2, and Anders Yeo1

1Department of Computer Science

Royal Holloway, University of London

Egham, Surrey TW20 0EX, UK

gutin(anders)@cs.rhul.ac.uk

2School of Computing Science

Simon Fraser University

Burnaby, B.C., Canada, V5A 1S6

arashr@cs.sfu.ca

Abstract. For digraphs D and H, a mapping f : V (D)→V (H) is a homo-

morphism of D to H if uv ∈ A(D) implies f(u)f(v) ∈ A(H). If, moreover, each

vertex u ∈ V (D) is associated with costs ci(u),i ∈ V (H), then the cost of the

u∈V (D)cf(u)(u). For each fixed digraph H, we have the

minimum cost homomorphism problem for H (abbreviated MinHOM(H)). In

this discrete optimization problem, we are to decide, for an input graph D with

costs ci(u), u ∈ V (D),i ∈ V (H), whether there exists a homomorphism of D

to H and, if one exists, to find one of minimum cost. We obtain a dichotomy

classification for the time complexity of MinHOM(H) when H is an oriented

cycle. We conjecture a dichotomy classification for all digraphs with possible

loops.

homomorphism f is?

1Introduction

For directed (undirected) graphs G and H, a mapping f : V (G)→V (H) is a

homomorphism of G to H if uv is an arc (edge) implies that f(u)f(v) is an

arc (edge). Let H be a fixed directed or undirected graph. The homomorphism

problem for H asks whether a directed or undirected input graph G admits a

homomorphism to H. The list homomorphism problem for H asks whether a

directed or undirected input graph G with lists (sets) Lu⊆ V (H),u ∈ V (G)

admits a homomorphism f to H in which f(u) ∈ Lufor each u ∈ V (G).

Suppose G and H are directed (or undirected) graphs, and ci(u), u ∈ V (G),

i ∈ V (H) are nonnegative costs. The cost of a homomorphism f of G to H

is?

input graph G, together with costs ci(u), u ∈ V (G), i ∈ V (H), we wish to find

a minimum cost homomorphism of G to H, or state that none exists.

The minimum cost homomorphism problem was introduced in [10], where

it was motivated by a real-world problem in defence logistics. We believe it

u∈V (G)cf(u)(u). If H is fixed, the minimum cost homomorphism problem,

MinHOM(H), for H is the following discrete optimization problem. Given an

Page 2

2G. Gutin, A. Rafiey, and A. Yeo

offers a practical and natural model for optimization of weighted homomor-

phisms. The problem’s special cases include the homomorphism and list homo-

morphism problems [15,17] and the general optimum cost chromatic partition

problem, which has been intensively studied [13,19,20].

There is an extensive literature on the minimum cost homomorphism prob-

lem, e.g., see [5–10]. These and other papers study the time complexity of

MinHOM(H) for various families of directed and undirected graphs. In par-

ticular, Gutin, Hell, Rafiey and Yeo [6] proved a dichotomy classification for

all undirected graphs (with possible loops): If H is a reflexive proper inter-

val graph or a proper interval bigraph, then MinHOM(H) is polynomial time

solvable; otherwise, MinHOM(H) is NP-hard. It is an open problem whether

there is a dichotomy classification for the complexity of MinHOM(H) when H

is a digraph with possible loops. We conjecture that such a classification exists

and, moreover, the following assertion holds:

Conjecture 1. Let H be a digraph with possible loops. Then MinHOM(H) is

polynomial time solvable if H has either a Min-Max ordering or a k-Min-Max

ordering for some k ≥ 2. Otherwise, MinHOM(H) is NP-hard.

For the definitions of a Min-Max and k-Min-Max ordering see Section 3,

where we give theorems (first proved in [10,9]) showing that if H has one of

the two orderings, then MinHOM(H) is polynomial time solvable. So, it is the

NP-hardness part of Conjecture 1 which is the ‘open’ part of the conjecture.

Very recently Gupta, Hell, Karimi and Rafiey [5] obtained a dichotomy clas-

sification for all reflexive digraphs that confirms this conjecture. They proved

that if a reflexive digraph H has no Min-Max ordering, then MinHOM(H) is

NP-hard. Gutin, Rafiey and Yeo [8,9] proved that if a semicomplete multipar-

tite digraph H has neither Min-Max ordering nor k-Min-Max ordering, then

MinHOM(H) is NP-hard.

In this paper, we show that the same result (as for semicomplete multi-

partite digraphs) holds for oriented cycles. This provides a further support for

Conjecture 1. In fact, we prove a graph-theoretical dichotomy for the com-

plexity of MinHOM(H) when H is an oriented cycle. The fact that Conjecture

1 holds for oriented cycles follows from the proof of the graph-theoretical di-

chotomy. In the proof, we use a new concept of a (k,l)-Min-Max ordering

introduced in Section 3. Our motivation for Conjecture 1 partially stems from

the fact that we initially proved polynomial time solvability of MinHOM(H)

when V (H) has a (k,l)-Min-Max ordering by reducing it to the minimum cut

problem. However, we later proved that (k,l)-Min-Max orderings can simply

be reduced to p-Min-Max orderings for p ≥ 1 (see Section 3).

Homomorphisms to oriented cycles have been investigated in a number of

papers. Partial results for the homomorphism problem to oriented cycles were

obtained in [11] and [18]. A full dichotomy was proved by Feder [3]. Feder,

Page 3

Minimum Cost Homomorphism Dichotomy for Oriented Cycles 3

Hell and Rafiey [4] obtained a dichotomy for the list homomorphism problem

for oriented cycles. Notice that our dichotomy is different from the ones in [3]

and [4].

Bulatov [2] proved that there exists a dichotomy classification for the list

homomorphism problem for digraphs, but no such dichotomy has been ob-

tained and even conjectured to the best of our knowledge. For the homomor-

phism problem for digraphs, we do not even know whether a dichotomy exists

and there is no conjecture of such a classification for the general case.

The rest of this paper is organized as follows. In the next section we consider

so-called levels of vertices in oriented paths and cycles. The concepts of Min-

Max ordering, k-Min-Max ordering and (k,l)-Min-Max ordering are considered

in Section 3. In Section 4 we obtain a dichotomy classification for MinHOM(H)

when H is a balanced oriented cycle. For all oriented cycles H, a dichotomy is

proved in Section 5.

2 Levels of Vertices in Oriented Paths and Cycles

In this paper [p] denotes the set {1,2,...,p}. Let D be a digraph. We will use

V (D) (A(D)) to denote the vertex (arc) set of D. We say that xy (x,y ∈ V (D))

is an edge of D if either xy or yx is an arc of D. A sequence b1b2...bpof distinct

vertices of D is an oriented path if bibi+1is an edge for every i ∈ [p − 1]. If

b1b2...bpis an oriented path, we call C = b1b2...bpb1an oriented cycle if bpb1

is an edge. An edge bibi+1(here bpbp+1= bpb1) of an oriented path P or cycle

C is called forward (backward) if bibi+1∈ A(D) (bi+1bi∈ A(D)).

Let P = b1b2...bp be an oriented path. We assign levels to the vertices

of P as follows: we set levelP(b1) = 0, and levelP(bt+1) = levelP(bt) + 1, if

btbt+1is forward and and levelP(bt+1) = levelP(bt) − 1, if btbt+1is backward.

We say that P is of type r if r = max{levelP(bi) : i ∈ [p]} = levelP(bp) and

0 ≤ levelP(bt) ≤ r for each t ∈ [p].

An oriented cycle C is balanced if the number of forward edges equals the

number of backward edges; if C is not balanced, it is called unbalanced. Note

that the fact whether C is balanced or unbalanced does not depend on the

choice of the vertex b1or the direction of C.

Let C = b1b2...bpb1be an oriented cycle. It has two directions: b1b2...bpb1

and b1bpbp−1...b1. In what follows, we will always consider the direction in

which the number of forward arcs is no smaller than the number of backward

arcs. We can assign levels to the vertices of C as follows: level(b1) = k, where

k is a non-negative integer, and level(bt+1) = level(bt) + 1, if btbt+1is forward

and and level(bt+1) = level(bt) − 1, if btbt+1is backward. Clearly, the value of

each level(bi), i ∈ [p], depends on both k and the choose of the initial vertex

b1. Feder [3] proved the following useful result.

Page 4

4 G. Gutin, A. Rafiey, and A. Yeo

Proposition 1. The integer k and initial vertex b1 in an oriented cycle C

can be chosen such that level(b1) = 0 and level(bi) ≥ 0 for every i ∈ [p]. If

C is unbalanced, then k and b1 can be chosen such that level(b1) = 0 and

level(bi) > 0 for every i ∈ [p] \ {1}.

Since the proposition was proved in [3], we will not give its complete proof.

Instead, we will outline a procedure for finding appropriate k and b1 and

remark on how the procedure can be used in showing the proposition.

Let C = b1b2...bpb1be an oriented cycle. We may assume that b1is chosen

in such a way that if C has a backward edge, then bpb1is a backward edge.

Compute mi, the number of the forward arcs minus the number of backward

arcs in the oriented path b1b2...bi, for each i ∈ [p]. Set k = |min{mi: i ∈ [p]}|.

Assign the level to each vertex of C using the level definition and starting from

assigning level k to b1. By the definition of k, the level of each vertex bj is

non-negative and there are vertices biof level zero. Choose such a vertex bi

with maximum index i and reassign the levels to the vertices of C as follows.

Consider C?= bibi+1...bpb1b2...biand set level(bi) = 0 and the rest of the

levels according to the order of vertices given in C?.

This procedure can be turned into a proof of the proposition by observing

that if C?is unbalanced, then the level of b1 in C?will be greater than the

level of b1in C. Thus, the levels of all vertices vj, j ∈ [i − 1] will be greater

than their levels in C, implying that the only level zero vertex in C?is bi.

Thus, in the rest of the paper, we may assume that the ‘first’ vertex of b1

of an oriented cycle C = b1b2...bpb1is chosen in such a way that the levels of

all vertices of C satisfy Proposition 1.

We will extensively use the following notation: V L(C) = {bt: level(bt) =

0,t ∈ [p]}, h(C) = max{level(bj) : j ∈ [p]}, and V H(C) = {bt: level(bt) =

h(C),t ∈ [p]}. Note that for unbalanced cycles C we have |V L(C)| = 1.

The concepts of this section are illustrated on Figure 1. In particular, Z

is balanced with forward edges b1b2,b3b4,... and backward edges b2b3,b4b5,....

We have level(b1) = level(b3) = level(b5) = 0, level(b2) = level(b4) = level(b6) =

level(b8) = level(b14) = 1, level(b7) = level(b9) = level(b11) = level(b13) = 2

and level(b10) = level(b12) = 3. Thus, h(Z) = 3, V L(Z) = {b1,b3,b5}, V H(Z) =

{b10,b12}.

3k-Min-Max and (k,l)-Min-Max Orderings

All known polynomial cases of MinHOM(H) can be formulated in terms of

certain vertex orderings. In fact, all known polynomial cases can be partitioned

into two classes: digraphs H admitting a Min-Max ordering of their vertices

and digraphs H having a k-Min-Max ordering of their vertices (k ≥ 2). Both

types of orderings are defined in this section, where we also introduce a new

Page 5

Minimum Cost Homomorphism Dichotomy for Oriented Cycles5

b

b2

b

b

b

b

b

b

b

b

b

b

b

13

4

5

b6

7

8

9

10

11

12

13

14

Fig.1.

b1b2,b3b2,b3b4,b5b4,b5b6,b6b7,b8b7b8b9,b9b10,b11b10,b11b12,b13b12,b14b13,b1b14 are arcs.

A leveldiagram of orientedcycleZ=b1b2...b14b1,where

type of ordering, a (k,l)-Min-Max ordering. It may be surprising, but we prove

that the new type of ordering can be reduced to the two known orderings.

Let H be a digraph and let (v1,v2,...,vp) be an ordering of the vertices

of H. Let e = vivrand f = vjvsbe two arcs in H. The pair vmin{i,j}vmin{s,r}

(vmax{i,j}vmax{s,r}) is called the minimum (maximum) of the pair e,f. (The

minimum (maximum) of two arcs is not necessarily an arc.) An ordering

(v1,v2,...,vp) is a Min-Max ordering of V (H) if both minimum and maxi-

mum of every two arcs in H are in A(H). Two arcs e,f ∈ A(H) are called a

crossing pair if {e,f} ?= {g?,g??}, where g?(g??) is the minimum (maximum) of

e,f. Clearly, to check that an ordering is Min-Max, it suffices to verify that

the minimum and maximum of every crossing pair of arcs are arcs, too. The

concept of Min-Max ordering is of interest due to the following:

Theorem 1. [10] If a digraph H has a Min-Max ordering of V (H), then

MinHOM(H) is polynomial-time solvable.

We will sometimes call a Min-Max ordering also a 1-Min-Max ordering.

The reason for this will become apparent in the rest of this section.

A collection V1,V2,...Vkof subsets of a set V is called a k-partition of V

if V = V1∪ V2∪ ··· ∪ Vk, Vi∩ Vj= ∅ provided i ?= j.

Let H = (V,A) be a digraph and let k ≥ 2 be an integer. We say that H

has a k-Min-Max ordering of V (H) if there is a k-partition of V into subsets

V1,V2,...Vkand there is an ordering Vi= (vi

such that

1,vi

2,...,vi

?(i)) of Vifor each i

(i) Every arc of H is an arc from Vito Vi+1for some i ∈ [k] and

(ii) (Vi,Vi+1) = (vi

of the subdigraph of H induced by Vi∪ Vi+1for each i ∈ [k]. (All indices

are taken modulo k.)

1,vi

2,...,vi

?(i)vi+1

1

vi+1

2

,...,vi+1

?(i+1)) is a Min-Max ordering

Page 6

6 G. Gutin, A. Rafiey, and A. Yeo

In such a case, (V1,V2,...,Vk) is a k-Min-Max ordering of V (H); k-Min-Max

orderings are of interest due to the following:

Theorem 2. [9] If a digraph H has a k-Min-Max ordering of V (H), then

MinHOM(H) is polynomial-time solvable.

Our study of MinHOM(H) for oriented cycles H has led us to the following

new concept.

Definition 1. Let H = (V,A) be a digraph and let k ≥ 2 and l be integers.

For l < k we say that H has a (k,l)-Min-Max ordering if there is a (k+l−2)-

partition of V into subsets V1,V2,...,Vk,U2,U3,...,Ul−1(set U1= V1, Ul=

Vk) and there is an ordering Vi= (vi

and there is an ordering Ui= (ui

that

1,vi

2,...,ui

2,...,vi

?u(i)) of Uifor each 1 ≤ i ≤ l such

?v(i)) of Vifor each 1 ≤ i ≤ k

1,ui

(i) Every arc of H is an arc from Vito Vi+1) for some i ∈ [k − 1], or is an

arc from Ujto Uj+1for some j ∈ [l − 1].

(ii) (Vi,Vi+1) is a Min-Max ordering of the subdigraph H[Vi∪ Vi+1] for all

i ∈ [k − 1].

(iii) (Ui,Ui+1) is a Min-Max ordering of the subdigraph H[Ui∪ Ui+1] for all

i ∈ [l − 1].

(iv) (V1,V2,U2) is a Min-Max ordering of the subdigraph H[V1∪ V2∪ U2].

(v) (Ul−1,Vk−1,Vk) is a Min-Max ordering of the subdigraph H[Vk−1∪Ul−1∪

Vk].

It turns out that (k,l)-Min-Max orderings can be reduced to p-Min-Max

orderings as follows from the next assertion:

Theorem 3. If a digraph H has a (k,l)-Min-Max ordering, then MinHOM(H)

is polynomial-time solvable.

Proof. Let H have a (k,l)-Min-Max ordering as described in Definition 1. Let

d = k − l. We will show that H has a d-Min-Max ordering, which will be

sufficient because of Theorems 1 and 2. (Recall that a 1-Min-Max ordering is

simply a Min-Max ordering.) Let us consider two cases.

Case 1: d = 1. It is not difficult to show that the ordering

(V1,V2,U2,V3,U3,...,Vk−2,Uk−2,Vk−1,Vk)

is a Min-Max ordering. Indeed, all crossing pairs of arcs are only in the sub-

graphs given in (ii)-(v) of Definition 1. According to the definition, the maxi-

mum and minimum of every crossing pair is in H.

Page 7

Minimum Cost Homomorphism Dichotomy for Oriented Cycles7

Case 2: d ≥ 2. Let si= max{p : i+pd ≤ l} for each i ∈ [d]. Consider the

following orderings for each 2 ≤ i ≤ d

Wi= (Vi,Ui,Vi+d,Ui+d,Vi+2d,Ui+2d,...,Vi+sid,Ui+sid,Vi+(si+1)d)

and the ordering

W1= (V1,V1+d,U1+d,V1+2d,U1+2d,...,V1+s1d,U1+s1d,V1+(s1+1)d).

Observe that W1,W2,...,Wdform a partition of V (H) and that every arc is

from Wito Wi+1for some i ∈ [d], where Wd+1= W1. As in Case 1, it is not

difficult to see that (W1,W2,...,Wd) is a d-Min-Max ordering of H.

? ?

Remark 1. Notice that not always a p-Min-Max ordering can be reduced to a

(k,l)-Min-Max ordering. As an example, consider the directed cycle C5.

4 Balanced Oriented Cycles

We say that a balanced oriented cycle C = b1b2...bpb1is of the form (l+h+)q

with q ≥ 1 if P = C − bpb1can be written as P = P1R1P2R2...PqRq, where

V (Pi) ∩ V L(C) ?= ∅, V (Pi) ∩ V H(C) = ∅,

V (Ri) ∩ V L(C) = ∅, V (Ri) ∩ V H(C) ?= ∅

for each i ∈ [q]. We write l+h+instead of (l+h+)1. For example, the cycle in

Figure 1 is of the form l+h+. Balanced oriented cycles C of the form l+h+are

considered in the following:

Theorem 4. Let C = b1b2...bpb1 be a balanced oriented cycle of the form

l+h+. Then MinHOM(C) is polynomial time solvable.

Proof. Let q = min{j : bj ∈ V H(C)}, let m = h(C) and let V = V (C).

Consider the following ordering V = (bp,bp−1,...,bq+1,b1,b2...,bq) of V . We

can define the following natural (m+1)-partition of V : V1,V2,...,Vm+1, where

Vj= {bs∈ V (C) : level(bs) = j − 1}. Note that every arc of C is an arc from

Vjto Vj+1for some j ∈ [m].

Let Vjbe the ordering of Vjobtained from V by deleting all vertices not

in Vj and let Vj = (sj

has no crossing pair of arcs for any j ∈ [m] since, for every pair sj

of arcs in the digraph, we have that either α ≤ γ and β ≤ δ, or α ≥ γ and

β ≥ δ. Thus, C has an (m+1)-Min-Max ordering of vertices and, by Theorem

2, MinHOM(C) is polynomial-time solvable.

1,sj

2,...,sj

b(j)). Observe that the digraph C[Vj∪ Vj+1]

αsj+1

β

, sj

γsj+1

δ

? ?

The following lemma was first proved in [12]; see also [3,21] and Lemma

2.36 in [17].

Page 8

8 G. Gutin, A. Rafiey, and A. Yeo

Lemma 1. Let P1and P2be two oriented paths of type r. Then there is an

oriented path P of type r that maps homomorphically to P1and P2such that

the initial vertex of P maps to the initial vertices of P1and P2and the terminal

vertex of P maps to the terminal vertices of P1 and P2. The length of P is

polynomial in the lengths of P1and P2.

We need a modified version of Lemma 1, Lemma 2. We say that an oriented

path b1b2...bpof type r is of the form (l+h+)kif the balanced oriented cycle

b1b2...bpar−1ar−2...a2a1b1

is of the form (l+h+)k, where b1a1a2...ar−2ar−1bpis a directed path.

Lemma 2. Let P1 and P2 be two oriented paths of type r. Let P1 be of the

form h+l+and let P2be of the form (l+h+)k, k ≥ 1. Then there is an oriented

path P of type r that maps homomorphically to P1and P2such that the initial

vertex of P maps to the initial vertices of P1and P2and the terminal vertex of

P maps to the terminal vertices of P1and P2. The length of P is polynomial

in the lengths of P1and P2, and P is of the form (l+h+)k.

Proof. We will show that our construction implies that |V (P)| ≤ |V (P1)| ×

|V (P2)|.

We first prove the lemma for the case when k = 1. The proof is by induction

on r ≥ 0. If 0 ≤ r ≤ 1, the claim is trivial. Assume that r ≥ 2. Let P1 =

a1a2...ap, let P2 = b1b2...bq, let s1 = min{i :

s2 = min{i :

β2= min{levelP2(bi) : s2≤ i}. Without loss of generality assume that β1≤ β2

and let t1 = min{i :

levelP2(bi) = β1and i ≤ s2}. Note that β1> 1 as P1is of form h+l+.

By the induction hypothesis, there is an appropriate oriented path P?that

can be mapped homomorphically to a1a2...as1−1and b1b2...bs2−1. There is

also an oriented path P??that can be mapped homomorphically to as1as1+1...at1

and bs2bs2−1...bt2(by reversing the two paths and then reversing the path we

get by the induction hypothesis). Furthermore there is an oriented path P???

that can be mapped homomorphically to at1+1at1+2...apand bt2+1bt2+2...bp.

Let P = P?P??P???(where the arc between the last vertex of P?to the first ver-

tex of P??is oriented from P?to P??and similarly the arc between P??and P???

is oriented in that direction). Note that P is of type r and form h+l+and

maps homomorphically to P1and P2such that the initial vertex of P maps

to the initial vertices of P1and P2and the terminal vertex of P maps to the

terminal vertices of P1and P2. Furthermore |V (P)| ≤ (s1− 1)(s2− 1) + (t1−

s1+1)(s2−t2+1)+(p−s1)(q−t2). As (s1−1)+(t1−s1+1)+(p−s1) = p and

(s2− 1),(s2− t2+ 1),(q − t2) ≤ q we have |V (P)| ≤ pq ≤ |V (P1)| × |V (P2)|.

levelP1(ai) = r} and let

s1 ≤ i} andlevelP2(bi) = r}. Let β1 = min{levelP1(ai) :

levelP1(ai) = β1and i ≥ s1} and let s2 = max{i :

Page 9

Minimum Cost Homomorphism Dichotomy for Oriented Cycles9

Now we proceed by induction on k ≥ 1. The base case has already been

proved. Assume that k ≥ 2 and let P1= a1a2...apand P2= b1b2...bq. Let

t = max{i : levelP2(bi) = 0} and let s = max{i : i < t, levelP2(bi) = r}. By

the induction hypothesis, there is an appropriate oriented path P?that can be

mapped homomorphically to P1and b1b2...bs. Also, there is an appropriate

oriented path P??(P???) that can be mapped homomorphically to apap−1...a1

and bsbs+1...bt(P1and btbt+1...bq). Now obtain a new oriented path P by

identifying the terminal vertex of P?with the initial vertex of P??and the

terminal vertex of P??with the initial vertex of P???. Observe that P satisfies

the required properties.

? ?

Consider the oriented cycle C0

that 1,2,3,4 is a Min-Max ordering of V (C0

polynomial-time solvable.

4= 12341 with arcs 12,32,14,34. Observe

4) and, thus, MinHOM(C0

4) is

Theorem 5. Let C = b1b2...bpb1 be a balanced oriented cycle of the form

(l+h+)k, k ≥ 2, and let C ?= C0

Proof. Let C ?= C0

V L(C)}, t = min{j : j > q,bj∈ V H(C)} and m = h(C). Let P1= b1b2...bs,

P2= bqbq−1...bs, P3= bqbq+1...btand P4= b1bpbp−1...bt. Note that each

Pjis of type m. By Lemma 2 there is a path Q1of type m which is mapped

homomorphically to P4, P2 and P3. There is also a path Q2 of type m and

which is mapped homomorphically to P1and P3. Since C ?= C0

vertices vertices of Q1are mapped to the end-vertices vertices of P4, the path

Q1contains more than two vertices. Furthermore, by Lemma 2 we may assume

that Q1is of the form (l+h+)k−1and Q2is of the form l+h+.

Let x (y) be the terminal vertex of Q1 (Q2). Form a new oriented path

Q = q1q2...qlby identifying x with y and let 1 ≤ r ≤ l be defined such that

Q1= q1q2...qrand Q2= qlql−1...qr. As Q1contains more than two vertices

we have that r ≥ 3.

Let D be an arbitrary digraph. We will now reduce the problem of find-

ing a maximum independent set in D (i.e. in the underlying graph of D) to

MinHOM(C). Replace every arc ab of D by a copy of Q identifying q1with

a and qlwith b, and denote the obtained digraph by D?. For every path Q in

D?which we added in the construction of D?we define the cost function c as

follows, where M is a number greater than |V (D)|:

(i) cb1(q1) = cb1(ql) = 0 and cbq(q1) = cbq(ql) = 1;

(ii) cbs(qr) = cbt(qr) = 0 and cb(qr) = M for all b ∈ V (C) − {bs,bt};

(iii) cb2(q) = M for all q ∈ {q2,q3,...,qr−1} (?= ∅, as r ≥ 3);

(iv) if s = 2 then cb1(qr−1) = M;

(v) all other costs of mapping vertices of D?to H are zero.

4. Then MinHOM(C) is NP-hard.

4. Let s = min{j : bj∈ V H(C)}, q = min{j : j > s,bj∈

4and the end-

Page 10

10 G. Gutin, A. Rafiey, and A. Yeo

Consider a mapping g from V (Q) to V (C), where g(q1) = bq, g(ql) = bq,

and Q1 and Q2 are both homomorphically mapped to P3 (i.e., g(qr) = bt).

Observe that g is a homomorphism from Q to C of cost 2. This implies, in

particular, that there is a homomorphism from D?to H of cost less than M.

We now consider three other homomorphisms from Q to C:

(a) f(q1) = b1and f(ql) = bq, and Q1is mapped to P4and Q2is mapped

to P3homomorphically (i.e., f(qr) = bt). The cost of f is 1.

(b) f?(q1) = bq and f?(ql) = b1, and f?maps Q1 to P2 and Q2 to P1

homomorphically (i.e., f?(qr) = bs). The cost of f?is 1.

(c) f??(q1) = b1 and f??(ql) = b1. We will show that the cost of f??is at

least M. If this is not the case then f??(qr) ∈ {bs,bt} by (ii). First assume that

f??(qr) = bs. By (iii) no vertex of V (Q1) − {qr} is mapped to b2and if s = 2

then by (iv) qr−1is not mapped to b1. However as Q1is of the form (l+h+)k−1

and the path b1bpbp−1...bsis of the form (l+h+)kwe get a contradiction to

f??mapping Q1to C and f??(q1) = b1and f??(qr) = bs. So now assume that

f??(qr) = bt. However Q2is of the form (l+h+) and there is no path in C from

b1to btof the form (l+h+), a contradiction. Therefore the cost of f??is at least

M.

By the above a minimum cost homomorphism h : D?→ C maps all vertices

from a maximum independent set in D to b1and all other vertices from D to

bq. As finding a maximum independent set in a digraph is NP-hard we see that

MinHOM(C) is NP-hard.

? ?

5 Dichotomy and Unbalanced Oriented Cycles

We are ready to prove the following main result:

Theorem 6. Let C be an oriented cycle. If C is unbalanced or C is balanced

of the form l+h+or C = C0

Otherwise, MinHOM(C) is NP-hard.

4, then MinHOM(C) is polynomial-time solvable.

By Theorems 4 and 5, to show Theorem 6 it suffices to prove the following:

Theorem 7. Let C = b1b2...bpb1 be an unbalanced oriented cycle. Then

MinHOM(C) is polynomial-time solvable.

Proof. It is well-known that the minimum cost homomorphism problem to a

directed cycle is polynomial-time solvable (see, e.g., [7]). Thus, we may as-

sume that C is not a directed cycle. By Proposition 1, we may assume that

level(b1) = 0 and level(bi) > 0 for all i ∈ [p] \ {1}. Let q = max{j : bj ∈

V H(C)}.

Consider the oriented path P = b1b2...bq. Let Vi+1 = {bj ∈ V (P) :

level(bj) = i} for all i ∈ [k] ∪ {0}, where k = level(bq). Now consider the

Page 11

Minimum Cost Homomorphism Dichotomy for Oriented Cycles11

oriented path Q = b1bpbp−1...bq. Assign levels to the vertices of Q stating

from levelQ(b1) = 0 and continuing as described in Section 1. Observe that all

vertices of Q get non-negative levels. Let Ui+1= {bj∈ V (Q) : levelQ(bj) = i},

i ∈ [l] ∪ {0}, where l = levelQ(bq). Clearly, V1= U1= {b1}; set Ul+1= Vk+1.

Consider the ordering U = (b1,bp,bp−1,...,bq) of the vertices of Q. For

i ∈ [l + 1], the ordering Ui is obtained from U by deleting all vertices not

in Ui. Consider the ordering V = (b1,b2,...,bq) of the vertices of P. For

i ∈ [k + 1], the ordering Viis obtained from V by deleting all vertices not in

Vi. Observe that the ordering (V1,V2,U2) of the vertices of C[V1∪ V2∪ U2]

has no crossing arcs. Similarly, the ordering (Ul,Vk,Vk+1) of the vertices of

C[Ul∪Vk∪Vk+1] has no crossing arcs, and orderings (Vi,Vi+1) and (Uj,Uj+1)

(i ∈ [k],j ∈ [l]) have no crossing arcs. Thus, C has a (k + 1,l + 1)-ordering of

vertices. Now we are done by Theorem 3.

? ?

References

1. J. Bang-Jensen and G. Gutin, Digraphs: Theory, Algorithms and Applications, Springer-

Verlag, London, 2000; freely available online at www.cs.rhul.ac.uk/books/dbook/

2. A.A. Bulatov, Tractable conservative constraint satisfaction problems. To appear in

ACM Trans. Comput. Logic.

3. T. Feder, Homomorphisms to oriented cycles and k-partite satisfiability. SIAM J. Dis-

crete Math 14 (2001) 471-480.

4. T. Feder, P. Hell and A. Rafiey, List homomorphism to balanced digraphs. Submitted.

5. A. Gupta, P. Hell, M. Karimi and A. Rafiey, Minimum cost homomorphisms to reflexive

digraphs. To appear in LATIN 2008.

6. G. Gutin, P. Hell, A. Rafiey and A. Yeo, Minimum Cost Homomorphisms to Proper

Interval Graphs and Bigraphs. To appear in Europ. J. Combin.

7. G. Gutin, A. Rafiey and A. Yeo, Minimum Cost and List Homomorphisms to Semicom-

plete Digraphs. Discrete Appl. Math. 154 (2006), 890–897.

8. G. Gutin, A. Rafiey and A. Yeo, Minimum Cost Homomorphisms to Semicomplete Mul-

tipartite Digraphs. To apear in Discrete Applied Math.

9. G. Gutin, A. Rafiey and A. Yeo, Minimum Cost Homomorphisms to Semicomplete Bi-

partite Digraphs. Submitted.

10. G. Gutin, A. Rafiey, A. Yeo and M. Tso, Level of repair analysis and minimum cost

homomorphisms of graphs. Discrete Appl. Math. 154 (2006), 881–889. A preliminary

version appeared in Proc. 1st International Conference on Algorithmic Applications in

Management, Xian, China, June 2005, N. Megiddo, Y. Xu, N. Alonstioti and B. Zhu

(eds.), LNCS 3521 (2005), 427–439.

11. W. Gutjahr, Graph Colourings, PhD thesis, Free University, Berlin, 1991.

12. R. H¨ aggkvist, P. Hell, D.J. Miller and V. Neumann-Lara, On multiplicative graphs and

the product conjecture. Combinatorica 8 (1988), 63–74.

13. M. M. Halldorsson, G. Kortsarz, and H. Shachnai, Minimizing average completion of

dedicated tasks and interval graphs. Approximation, Randomization, and Combinatorial

Optimization (Berkeley, Calif, 2001), Lecture Notes in Computer Science, vol. 2129,

Springer, Berlin, 2001, pp. 114–126.

14. T.Feder, P.Hell, J.Huang, List homomorphisms and circular arc graphs. Combinatorica.

19 (1999) 487 - 505.

Page 12

12 G. Gutin, A. Rafiey, and A. Yeo

15. P. Hell, Algorithmic aspects of graph homomorphisms, in ‘Survey in Combinatorics

2003’, London Math. Soc. Lecture Note Series 307, Cambridge University Press, 2003,

239 – 276.

16. P. Hell and J. Neˇ setˇ ril, On the complexity of H-colouring. J. Combin. Theory B 48

(1990), 92–110.

17. P. Hell and J. Neˇ setˇ ril, Graphs and Homomorphisms. Oxford University Press, Oxford,

2004.

18. P. Hell and X. Zhu, The existence of homomorphisms to oriented cycles. SIAM J. Discrete

Math. 8 1995), 208–222.

19. K. Jansen, Approximation results for the optimum cost chromatic partition problem. J.

Algorithms 34 (2000), 54–89.

20. T. Jiang and D.B. West, Coloring of trees with minimum sum of colors. J. Graph Theory

32 (1999), 354–358.

21. X. Zhu, A simple proof of the multipilicatively of directed cycles of prime power length.

Discrete Appl. Math. , 36 (1992) 333-345.