Homomorphicity and non-coreness of labeled posets are NP

Homomorphicity and non-coreness of labeled
posets are NP-complete
Erkko Lehtonen∗
October 24, 2006
Abstract
Partially ordered sets labeled with k labels (k-posets) and their homomorphisms are examined. Using a representation of directed graphs by labeled
posets, it is shown that the problem of deciding whether there exists a
homomorphism between k-posets and the problem of deciding whether a
k-poset allows nonsurjective endomorphisms are NP-complete. Furthermore, a new proof for the universality of the homomorphicity order of
k-posets is established.
1
Introduction
A k-labeled partially ordered set (k-poset), also known as a partially ordered
multiset (pomset) or a partial word, is an object (P, c), where P is a partially
ordered set and c is a function that assigns to each element of P a label from
the set {0, 1, . . . , k − 1}. A homomorphism between k-posets is a mapping
h : (P, c) → (P 0 , c0 ) that preserves both order and labels. We define the homomorphicity quasiorder on the set of all finite k-posets as follows: (P, c) ≤ (P 0 , c0 )
if and only if there is a homomorphism of (P, c) to (P 0 , c0 ).
Labeled posets have been used as a model of parallel processes (see Pratt
[15]), and they can be viewed as a generalization of strings. Algebraic properties
of labeled posets have been studied by Grabowski [4], Gischer [3], Bloom and
Ésik [1], and Rensink [17]. Homomorphisms of k-posets were studied in the
context of Boolean hierarchies of partitions by Kosub [9], Kosub and Wagner
[10], and Selivanov [18]. Kuske [12] and Kudinov and Selivanov [11] studied
the undecidability of the first-order theory of the homomorphicity quasiorder
of k-posets. We applied k-posets in our analysis of certain relations between
operations on a finite set that are based on composition of functions from inside
with monotone functions [13], and we showed that the homomorphicity order
of k-posets is a universal distributive lattice [14].
∗ Institute of Mathematics, Tampere University of Technology, P.O. Box 553, FI-33101
Tampere, Finland. Email: [email protected].
1
In the current paper, we represent directed graphs by k-posets. Using this
representation, we will be able to prove the NP-completeness of certain decision
problems related to k-posets. More precisely, we show that the problem of
deciding whether there exists a homomorphism between two k-posets and the
problem of deciding whether a k-poset admits a nonsurjective endomorphism are
NP-complete. The represention also provides a proof that the homomorphicity
order of k-posets is universal in the sense that every countable poset can be
embedded into it.
2
Labeled posets and homomorphisms
For a positive natural number k = {0, 1, . . . , k − 1}, a k-labeled partially ordered
set (k-poset) is an object (P, ≤, c), where (P, ≤) is a partially ordered set and
c : P → k is a labeling function. A labeled poset is a k-poset for some k. Every
subset P 0 of a k-poset (P, ≤, c) may be considered as a k-poset (P 0 , ≤|P 0 , c|P 0 ),
called a k-subposet of (P, ≤, c). We often simplify these notations and write
(P, c) or P instead of (P, ≤, c), and we simply write c for any restriction of c.
If the underlying poset of a k-poset is a lattice, chain, tree, or forest, then we
refer to k-lattices, k-chains, k-trees, k-forests, and so on. We denote by Pk and
Lk the classes of all finite k-posets and k-lattices, respectively. For k ≤ l, every
k-poset is also an l-poset. Finite k-posets can be represented by Hasse diagrams
with numbers designating the labels assigned to each element; see Figure 1. For
general background on partially ordered sets, see any textbook on the subject,
e.g., [2].
A k-chain a1 < a2 < · · · < an with a labeling c is alternating, if c(ai ) 6=
c(ai+1 ) for all 1 ≤ i ≤ n−1. The alternation number of a k-poset (P, c), denoted
Alt(P, c), is the size of the longest alternating k-chain that is a k-subposet of
(P, c).
We will adopt much of the terminology used for graphs and their homomorphisms (see [7]). (Recall that a graph homomorphism h : G → G0 is an
edge-preserving mapping between vertex sets of graphs G and G0 . A core is
a graph that does not admit a homomorphism to any proper subgraph.). Let
(P, c) and (P 0 , c0 ) be k-posets. An order-preserving mapping f : P → P 0 such
that c = c0 ◦ f is called a homomorphism of (P, c) to (P 0 , c0 ) and denoted
f : (P, c) → (P 0 , c0 ). The composition of homomorphisms is again a homomorphism. An endomorphism of (P, c) is a homomorphism h : (P, c) → (P, c). A
bijective homomorphism of (P, c) to (P 0 , c0 ) whose inverse is a homomorphism
of (P 0 , c0 ) to (P, c) is called an isomorphism, and (P, c) and (P 0 , c0 ) are said to
be isomorphic.
We define a quasiorder ≤ on Pk as follows: (P, c) ≤ (P 0 , c0 ) if and only if
there is a homomorphism of (P, c) to (P 0 , c0 ). Denote by ≡ the equivalence
relation on Pk induced by ≤. If (P, c) ≡ (P 0 , c0 ), we say that (P, c) and (P 0 , c0 )
are homomorphically equivalent. We denote by Pk0 the quotient set Pk /≡, and
the partial order on Pk0 induced by the homomorphicity quasiorder ≤ is also
denoted by ≤. Similarly, we denote by L0k the quotient set L/≡.
2
1
....
0 ...............•................
0
....
...
.... .... 0
..•
....
... .... •
... ... ......
..
...
....•
... ... .............................. .....
1
1 ........ •................
.
.... ..................... .......
•..... .....
•.... .......... ............. .....................•......
..... •
.
1
•
...
...
.
...
0
.
... ....
... ...
1 0 ....1............ .......
0
... ...
..... ..
.......
1
...
•............. ... ..
..........•
•....................... ........ ...............•....................... ........ ....................•.....
.
.
........ ...
.. .....
.......
....
0
0
•...........
•
...
...
1
1
...
.
•..
0
•.........................................................•.........
...
...
...
...
...
...
...
...
...
...
...
...
..
...
.
..........
..........
................................................ .
....
•
•
Figure 1: Directed graph G and its representation by a 2-poset PG .
A k-poset (P, c) is a core, if all endomorphisms of (P, c) are surjective (equivalently, if (P, c) is not homomorphically equivalent to any k-poset of smaller
cardinality). Every k-poset is homomorphically equivalent to a core. Isomorphic k-posets are homomorphically equivalent by definition. Homomorphically
equivalent k-posets are not necessarily isomorphic, but homomorphically equivalent cores are isomorphic.
3
Representation of directed graphs by k-posets
Let G = (V, E) be a directed graph. We associate with G a 2-poset PG =
((P, ≤), c), where P = (V ∪ E) × {0, 1}, c(a, b) = b for all a ∈ V ∪ E, b ∈ {0, 1},
and the covering relations of ≤ are exactly the following:
• (a, 0) < (a, 1) for all a ∈ V ,
• (a, 1) < (a, 0) for all a ∈ E,
• for each edge (u, v) ∈ E, (u, 0) < ((u, v), 0), ((u, v), 1) < (v, 1).
See Figure 1 for an example of a directed graph and the associated 2-poset.
Proposition 3.1. Let G and H be directed graphs. Then G is homomorphic to
H if and only if PG is homomorphic to PH .
Proof. Let h : G → H be a homomorphism. Then the mapping g : PG → PH
defined as g(v, b) = (h(v), b) for all v ∈ V (G), b ∈ {0, 1}; g((u, v), b) =
((h(u), h(v)), b) for all (u, v) ∈ E(G), b ∈ {0, 1}, is easily seen to be a homomorphism. Clearly g preserves the labels, and in order to show that g(x) ≤ g(y)
in PH whenever x ≤ y in PG we have four cases to consider; recall that if
(u, v) ∈ E(G), then (h(u), h(v)) ∈ E(H).
• If x = (u, 0), y = (u, 1) where u ∈ V (G), then g(x) = g(u, 0) = (h(u), 0) <
(h(u), 1) = g(u, 1) = g(y).
• If x = ((u, v), 1), y = ((u, v), 0) where (u, v) ∈ E(G), then g(x) =
g((u, v), 1) = ((h(u), h(v)), 1) < ((h(u), h(v)), 0) = g((u, v), 0) = g(y).
• If x = (u, 0), y = ((u, v), 0) where u ∈ V (G), (u, v) ∈ E(G), then g(x) =
g(u, 0) = (h(u), 0) < ((h(u), h(v)), 0) = g((u, v), 0) = g(y).
3
• If x = ((u, v), 1), y = (v, 1) where (u, v) ∈ E(G), v ∈ V (G), then g(x) =
g((u, v), 1) = ((h(u), h(v)), 1) < (h(v), 1) = g(v, 1) = g(y).
Assume then that g : PG → PH is a homomorphism. Since alternating chains
must be mapped to similar alternating chains by homomorphisms, we have that
there are mappings h : V (G) → V (H), e : E(G) → E(H) such that g(v, b) =
(h(v), b) and e((u, v), b) = (e(u, v), b) for all v ∈ V (G), (u, v) ∈ E(G), b ∈
{0, 1}. Furthermore, the comparabilities (u, 0) < ((u, v), 0), ((u, v), 1) < (v, 1)
in PG must be preserved by g for all edges (u, v) ∈ E(G), that is, (h(u), 0) =
g(u, 0) < g((u, v), 0) = (e(u, v), 0) and (e(u, v), 1) = g((u, v), 1) < g(v, 1) =
(h(v), 1). Therefore, e(u, v) ∈ E(H) equals (h(u), h(v)). We conclude that h is
a homomorphism from G to H.
Proposition 3.2. Let G be a graph. Then PG is a core if and only if G is a
core.
Proof. If PG is a core, then it is not homomorphic to any proper k-subposet. In
particular, there is no proper subgraph H of G such that PG is homomorphic to
PH . Thus, G does not retract to any proper subgraph, and hence G is a core.
If PG is not a core, then there is a homomorphism h : PG → P 0 for some
proper k-subposet P 0 = Im h of G. It is clear from the proof of Proposition 3.1
that the homomorphic image P 0 of PG is of the form PH for some graph H.
Then H is a proper subgraph and a retract of G, and so G is not a core.
We describe a variant of the above representation of directed graphs by
2-posets. We associate with each directed graph G the 3-poset LG , which is
defined like PG but with a greatest element and a least element adjoined. The
two new elements have label 2. (For the empty graph ∅, we agree that L∅ is
the empty 3-poset.) It is easy to see that LG is a 3-lattice if and only if G is
loopless.
Proposition 3.3. Let G and H be loopless directed graphs. Then G is homomorphic to H if and only if LG is homomorphic to LH .
Proof. The proof is similar to that of Proposition 3.1. We only need to observe
that the greatest and least elements are the only elements with label 2, and any
homomorphism must map the greatest and least elements to the greatest and
least elements, respectively. Otherwise a homomorphism acts as described in
the proof of Proposition 3.1.
Proposition 3.4. Let G be a loopless graph. Then LG is a core if and only if
G is a core.
Proof. The proof is similar to that of Proposition 3.2.
It is a well-known fact that the homomorphicity order of directed graphs is
universal in the sense that every countable poset can be embedded into it (see
[16]; see also Hubička and Hešetřil’s [8] simpler proof). Our representation of
directed graphs by 2-posets and 3-lattices, together with Propositions 3.1 and
3.3, thus provide a new proof of the universality of Pk0 , k ≥ 2, and L0k , k ≥ 3,
which we established in a different way in [14].
4
4
NP-complete problems
We define the k-poset homomorphicity problem k-HOM and the k-poset noncoreness problem k-CORE as follows. Note that cores are precisely the k-posets
for which the answer to the question of k-CORE is no.
Problem k-HOM
Instance: k-posets (P, c) and (P 0 , c0 ).
Question: Is there a homomorphism (P, c) → (P 0 , c0 )?
Problem k-CORE
Instance: A k-poset (P, c).
Question: Is there a nonsurjective endomorphism of (P, c)?
k-HOM and k-CORE are analogues of the graph homomorphicity problem
and the graph non-coreness problem, defined as follows.
Problem HOM
Instance: Graphs G and G0 .
Question: Is there a homomorphism G → G0 ?
Problem CORE
Instance: A graph G.
Question: Is there a nonsurjective homomorphism G → G?
Theorem 4.1. The k-poset homomorphicity problem k-HOM and the k-poset
non-coreness problem k-CORE are NP-complete.
Proof. It is easy to see that both k-HOM and k-CORE are in NP. Namely, it
is easy to verify that a proposed mapping is a homomorphism or a nonsurjective
endomorphism.
It is well-known that HOM and CORE are NP-complete [5, 6]. We observe
that the representation of a graph G by a k-poset PG as described in the previous
section has size that is polynomial in the size of G, and the conversion from G
to PG is straightforward. In fact, the number of elements in PG is twice the
number of vertices and edges of G. Thus, instances of HOM and CORE can be
reduced in polynomial time to instances of k-HOM and k-CORE, respectively.
We conclude that k-HOM and k-CORE are NP-complete.
It follows from Proposition 3.3 that the k-HOM remains NP-complete even
when its inputs are restricted to k-lattices for k ≥ 3. However, for 2-lattices,
k-HOM is solvable in polynomial time. For, it was shown by Kosub and Wagner
[10] that every 2-lattice is homomorphically equivalent to its longest alternating
chain. Thus a 2-lattice (L, c) is homomorphic to a 2-lattice (L0 , c0 ) if and only
if Alt(L, c) < Alt(L0 , c0 ) or Alt(L, c) = Alt(L0 , c0 ) and the smallest elements of
(L, c) and (L0 , c0 ) have the same label. The alternation number of a finite k-poset
(P, c) with a smallest element a and a greatest element b can be determined by
Algorithm 1. In the description of the algorithm, we denote x̂ = {y ∈ P :
y covers x} and x̌ = {y ∈ P : x covers y} for an element x ∈ P .
5
Algorithm 1 Determine the alternation number of a finite k-poset (P, c) with
a smallest element a and a greatest element b.
1: for all x ∈ P do
2:
if x = a then
3:
p(x) ← 1, r(x) ← 2
4:
else if x ∈ â then
5:
r(x) ← 1
6:
else
7:
r(x) ← 0
8:
end if
9: end for
10: while r(b) 6= 2 do
11:
Let x be an element such that r(x) = 1 and r(y) = 2 for all y ∈ x̌.
12:
for all y ∈ x̌ do
13:
if c(y) = c(x) then
14:
q(y) ← p(y)
15:
else
16:
q(y) ← p(y) + 1
17:
end if
18:
end for
19:
p(x) ← maxy∈x̌ q(y), r(x) ← 2
20:
for all y ∈ x̂ do
21:
r(y) ← 1
22:
end for
23: end while
24: return p(b)
6
The algorithm keeps track of the alternation numbers of the intervals between the smallest element a and each x ∈ P in the variables p(x). The variables
r(x) are used to indicate whether an element x ∈ P has been processed by the
algoritm: if r(x) = 0, then x is still unprocessed; if r(x) = 1, then a child of x
has been processed and x may get processed provided all its children have been
processed; if r(x) = 2, then x has been processed.
It is easy to verify that Algorithm 1 runs in polynomial time. For an input
(P, c) with |P | = n, the for loop on lines 1–9 is repeated n times. The while
loop on lines 10–23 is repeated n − 1 times. The search of the element x on line
11 takes at most n2 steps, the two for loops are repeated at most n times, and
the search of maximum on line 19 requires at most n comparisons. We conclude
that the algorithm takes O(n3 ) steps.
Note that Algorithm 1 can be easily modified to actually find a longest
alternating chain. We only need to record for each x an element y covered by
x that gives rise to the largest q(y) on line 19. When all elements have been
processed, we can then construct a chain by starting from the largest element b
and then going down in the Hasse diagram, always choosing the child recorded
for each node. This chain necessarily contains a longest alternating chain.
Consider also the k-poset (Q, d)-homomorphicity problem k-(Q, d)-HOM,
defined as follows. Here (H, d) is a fixed k-poset and we should decide whether
any given k-poset is homomorphic to (H, d).
Problem k-(Q, d)-HOM
Instance: A k-poset (P, c).
Question: Is there a homomorphism (P, c) → (Q, d)?
This is an analogue of the graph H-colouring problem H-HOM, defined as
follows.
Problem H-HOM
Instance: A graph G.
Question: Is there a homomorphism of G to H?
It was shown by Hell and Nešetřil [5] that H-HOM is NP-complete for
any non-bipartite graph H, and it is polynomial-time solvable for any bipartite
graph H. Thus, there are NP-complete cases of k-(Q, d)-HOM, e.g., the cases
where (Q, d) = PG for some nonbipartite graph G. There are also easy cases,
e.g., the cases where the labeling d in (Q, d) is a constant function—it only
suffices to check whether the labeling function c is constant taking on the same
value as d, and this can certainly be done in polynomial time.
It is clear that every case of k-(Q, d)-HOM is in NP. It remains an open
question whether there is a dichotomy between the polynomial-time solvable
and NP-complete cases of k-(Q, d)-HOM.
Acknowledgements
This research was initiated while the author was visiting the University of Waterloo. The author would like to thank Ross Willard for useful discussions of
7
the topic.
References
[1] S. L. Bloom, Z. Ésik, Free shuffle algebras in language varieties, Theoret.
Comput. Sci. 163 (1996) 55–98.
[2] B. A. Davey, H. A. Priestley, Introduction to Lattices and Order,
Second edition, Cambridge University Press, 2002.
[3] J. L. Gischer, The equational theory of pomsets, Theoret. Comput. Sci.
61 (1988) 199–224.
[4] J. Grabowski, On partial languages, Ann. Soc. Math. Polon. Ser. IV
Fund. Inform. 4(2) (1981) 427–498.
[5] P. Hell, J. Nešetřil, On the complexity of H-coloring, J. Combin. Theory Ser. B 48 (1990) 92–110.
[6] P. Hell, J. Nešetřil, The core of a graph, Discrete Math. 109 (1992)
117–126.
[7] P. Hell, J. Nešetřil, Graphs and Homomorphisms, Oxford Lecture Series in Mathematics and Its Applications 28, Oxford University Press, Oxford, New York, 2004.
[8] J. Hubička, J. Nešetřil, Universal partial order represented by means
of oriented trees and other simple graphs, European J. Combin. 26 (2005)
765–778.
[9] S. Kosub, NP-partitions over posets with an application to reducing the
set of solutions of NP problems, Theory Comput. Systems 38 (2005) 83–
113.
[10] S. Kosub, K. W. Wagner, The Boolean hierarchy of NP-partitions, in
H. Reichel, S. Tison (eds.), STACS 2000, 17th Annual Symposium on Theoretical Aspects of Computer Science, Lecture Notes in Comput. Sci. 1770,
Springer-Verlag, Berlin, 2000, pp. 157–168. An expanded version is available as Technical Report TUM-I0209, Institut für Informatik, Technische
Universität München, München, 2002.
[11] O. V. Kudinov, V. L. Selivanov, Undecidability in the homomorphic
quasiorder of finite labeled forests, in A. Beckmann, U. Berger, B. Löwe, J.
V. Tucker (eds.), Logical Approaches to Computational Barriers, Lecture
Notes in Comput. Sci. 3988, Springer-Verlag, Berlin, 2006, pp. 289–296.
[12] D. Kuske, Theories of orders on the set of words, RAIRO—Inf. Theor.
Appl. 40 (2006) 53–74.
8
[13] E. Lehtonen, Descending chains and antichains of the unary, linear,
and monotone subfunction relations, Order (2006), doi:10.1007/s11083006-9036-y.
[14] E. Lehtonen, Labeled posets are universal, manuscript, 2006, http://
math.tut.fi/algebra/.
[15] V. R. Pratt, Modelling concurrency with partial orders, Internat. J. Parallel Programming 15 (1987) 33–71.
[16] A. Pultr, V. Trnková, Combinatorial, Algebraic and Topological Representations of Groups, Semigroups and Categories, North-Holland, Amsterdam, 1980.
[17] A. Rensink, Algebra and theory of order-deterministic pomsets, Notre
Dame J. Formal Logic 37 (1996) 283–320.
[18] V. L. Selivanov, Boolean hierarchies of partitions over a reducible base,
Algebra Logic 43 (2004) 44–61. Translated from Algebra Logika 43 (2004)
77–109.
9