University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

23
arXiv:2111.10393v1 [math.CO] 19 Nov 2021 The r -coloring and maximum stable set problem in hypergraphs with bounded matching number and edge size Yanjia Li and Sophie Spirkl * University of Waterloo, Waterloo, ON N2L 3G1, Canada November 23, 2021 Abstract Motivated by the analogous questions in graphs, we study the complexity of coloring and stable set problems in hypergraphs with forbidden substructures and bounded edge size. Letting ν (G) denote the maximum size of a matching in H , we obtain complete dichotomies for the complexity of the following problems parametrized by fixed r, k, s N: r-Coloring in hypergraphs G with edge size at most k and ν (G) s; r-Precoloring Extension in k-uniform hypergraphs G with ν (G) s; r-Precoloring Extension in hypergraphs G with edge size at most k and ν (G) s; Maximum Stable Set in k-uniform hypergraphs G with ν (G) s; Maximum Weight Stable Set in k-uniform hypergraphs with ν (G) s; as well as partial results for r-Coloring in k-uniform hypergraphs ν (G) s. We then turn our attention to 2-Coloring in 3-uniform hypergraphs with forbidden induced subhypergraphs, and give a polynomial-time algorithm when restricting the input to hypergraphs excluding a fixed one-edge hypergraph. Finally, we consider linear 3-uniform hypergraphs (in which every two edges share at most one vertex), and show that excluding an induced matching in G implies that ν (G) is bounded by a constant; and that 3-coloring linear 3-uniform hypergraphs G with ν (G) 532 is NP-hard. * We acknowledge the support of the Natural Sciences and Engineering Research Council of Canada (NSERC), [funding reference number RGPIN-2020-03912]. Cette recherche a été financée par le Conseil de recherches en sciences naturelles et en génie du Canada (CRSNG), [numéro de référence RGPIN-2020-03912]. 1

Transcript of University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

Page 1: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

arX

iv:2

111.

1039

3v1

[m

ath.

CO

] 1

9 N

ov 2

021

The r-coloring and maximum stable set problem in

hypergraphs with bounded matching number and

edge size

Yanjia Li and Sophie Spirkl∗

University of Waterloo, Waterloo, ON N2L 3G1, Canada

November 23, 2021

Abstract

Motivated by the analogous questions in graphs, we study the complexity ofcoloring and stable set problems in hypergraphs with forbidden substructuresand bounded edge size. Letting ν(G) denote the maximum size of a matching inH, we obtain complete dichotomies for the complexity of the following problemsparametrized by fixed r, k, s ∈ N:

• r-Coloring in hypergraphs G with edge size at most k and ν(G) ≤ s;

• r-Precoloring Extension in k-uniform hypergraphs G with ν(G) ≤ s;

• r-Precoloring Extension in hypergraphs G with edge size at most k

and ν(G) ≤ s;

• Maximum Stable Set in k-uniform hypergraphs G with ν(G) ≤ s;

• Maximum Weight Stable Set in k-uniform hypergraphs with ν(G) ≤ s;

as well as partial results for r-Coloring in k-uniform hypergraphs ν(G) ≤ s. Wethen turn our attention to 2-Coloring in 3-uniform hypergraphs with forbiddeninduced subhypergraphs, and give a polynomial-time algorithm when restrictingthe input to hypergraphs excluding a fixed one-edge hypergraph. Finally, weconsider linear 3-uniform hypergraphs (in which every two edges share at mostone vertex), and show that excluding an induced matching in G implies that ν(G)is bounded by a constant; and that 3-coloring linear 3-uniform hypergraphs G

with ν(G) ≤ 532 is NP-hard.

∗We acknowledge the support of the Natural Sciences and Engineering Research Council of Canada(NSERC), [funding reference number RGPIN-2020-03912].Cette recherche a été financée par le Conseil de recherches en sciences naturelles et en génie du Canada(CRSNG), [numéro de référence RGPIN-2020-03912].

1

Page 2: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

1 Preliminaries

A hypergraph G is a pair (V,E) where V is a finite set, and E ⊆ 2V \ {∅}. V is calledthe set of vertices and E is called the set of edges. For a hypergraph G = (V,E), wedefine V (G) = V and E(G) = E. For k ∈ N, we say that G is k-uniform if |e| = kfor all edges e ∈ E, and G is k-bounded if |e| ≤ k for all edges e ∈ E. A 2-uniformhypergraph is simply called a graph.

Given a set X ⊆ V (G), G[X ] = (X, {e ∈ E(G) : e ⊆ X}) is an induced hypersub-

graph of G. A matching of G is a set of pairwise disjoint edges. A maximal matching

of G is a matching which is maximal with respect to inclusion. For a hypergraph G,we denote ν(G) be the maximum integer s such that G contains a matching of size s.A set S ⊆ V (G) of G is stable if e ∩ S 6= e for every e ∈ E(G).

We use [r] to denote the set {1, . . . , r}. Given a hypergraph G and a positive integerr, a function c : V (G) → [r] is an r-coloring of G if for all i ∈ [r], c−1(i) is a stable setin G. G is r-colorable if there exists an r-coloring of G. The chromatic number of G,denoted χ(G), is the minimum integer r such that G is r-colorable.

A function c : X → [r] for some X ⊆ V (G) is a partial r-coloring of G if c isan r-coloring of G[X ]. For convenience, we also denote a partial coloring as (X, c).Given a partial r-coloring (X, c) of G, an r-precoloring extension of (X, c) is a partialr-coloring (X ′, c′) with c′(v) = c(v) for all v ∈ X, and X ⊂ X ′. We say that a partialcoloring (X, c) r-extends to G if there is an r-precoloring extension (V (G), c′) of (X, c).

For a fixed integer r, the Hypergraph r-Coloring Problem is to decidewhether a given hypergraph G is r-colorable, and the Hypergraph r-PrecoloringExtension Problem is to decide given a hypergraph G and a partial r-coloring(X, c), whether (X, c) r-extends to G.

The Graph r-Coloring Problem is a well-known NP-hard problem:

Theorem 1.1 (Karp [9]). For every fixed integer r with r ≥ 3, the Graph r-Coloring Problem is NP-complete.

However, placing structural restrictions on the input graphs may make the problemeasier. This is well-studied for graphs; see [7] for a survey of complexity results forcoloring problems in graphs with forbidden induced subgraphs. Few graphs H havethe property that r-coloring H-free graphs can be solved in polynomial time for all r.The following is result shows that graphs of the form H = sP2 (that is, matchings)have this property:

Theorem 1.2 (Golovach, Johnson, Paulusma and Song [7]; Balas and Yu [2]; Tsukiyama,Ide, Ariyoshi, Shirakawa [15]). For fixed positive integers r and s, the Graph r-Coloring Problem restricted to sP2-free graphs is polynomial-time solvable.

The hypergraph coloring problem is a natural extension of the graph coloring prob-lem; see the survey [3]. The following result shows that the problem is NP-hard, evenin uniform hypergraphs.

2

Page 3: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

Theorem 1.3 (Lovász [10]; Phelps and Rödl [12]). For all k ≥ 3 and r ≥ 2, the

k-Uniform Hypergraph r-Coloring Problem is NP-complete.

It is natural to ask which restrictions of the input hypergraphs make the Hyper-graph r-Coloring Problem polynomial-time solvable. In this paper, we mainlyfocus on bounded or uniform hypergraphs. In view of Theorem 1.2, we are particularlyinterested in excluding a matching; but as it turns out, even bounded the maximumsize of a matching (a much stronger condition than excluding an induced matching)does not always lead to a polynomial-time algorithm. We will prove the followingdichotomies:

Theorem 1.4. Let k, r and s be positive integers with k, r ≥ 2. The k-Bounded Hy-pergraph r-Coloring Problem, the k-Bounded Hypergraph r-PrecoloringExtension Problem as well as the k-Uniform Hypergraph r-PrecoloringExtension Problem, restricted to hypergraphs with ν(G) ≤ s, are polynomial-time

solvable if

• s ≤ r − 1, or

• k = 3 and r = 2, or

• k = 2,

and NP-complete otherwise.

We will also show the following result:

Theorem 1.5. Let k, r and s be positive integers with k, r ≥ 2. The k-UniformHypergraph r-Coloring Problem restricted to hypergraphs with ν(G) ≤ s is

polynomial-time solvable if

• s ≤ r − 1, or

• k = 3 and r = 2, or

• k = 2,

and is NP-complete if

• s ≥ (r − 1)k + 1, and

• k ≥ 4 or r ≥ 3.

Theorem 1.2 is based on a result of [2] that sP2-free graphs have only polynomiallymany maximal (with respect to inclusion) stable sets. Using this, [2] gave a polynomial-time algorithm for finding a maximum (weight) stable set in an sP2-free graph. Weask an analogous question in hypergraphs with bounded maximum matching size, andprove:

3

Page 4: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

Theorem 1.6. For fixed positive integers k and s with k ≥ 3, the k-Uniform Hyper-graph Maximum Stable Set Problem restricted to hypergraphs with ν(G) ≤ sis polynomial-time solvable, and the k-Uniform Hypergraph Maximum WeightStable Set Problem restricted to hypergraphs with ν(G) ≤ s is NP-complete.

We also give a first result for excluding an induced subhypergraph:

Theorem 1.7. Let t ∈ N be fixed, and let H be the 3-uniform hypergraph with t + 3vertices and one edge. Then there is a polynomial-time algorithm for the 3-BoundedHypergraph 2-Coloring Problem restricted to H-free hypergraphs.

Finally, we consider linear hypergraphs. A hypergraph G is linear if |e∩ e′| ≤ 1 forevery two distinct e, e′ ∈ E(G). The restriction to linear hypergraphs does not affectNP-hardness:

Theorem 1.8 (Phelps and Rödl [12]). For every r ≥ 2, the 3-Uniform Hypergraphr-Coloring Problem restricted to linear hypergraphs is NP-complete.

The following result gives an algorithm for 2-coloring certain linear hypergraphs:

Theorem 1.9 (Chattopadhyay and Reed [4]). There is a polynomial-time algorithm

for the k-Uniform Hypergraph 2-Coloring Problem restricted to linear hyper-

graphs with maximum degree bounded by a function of k.

We ask how our results extend to linear 3-uniform hypergraphs. For s ∈ N, we letMs denote the 3-uniform hypergraph with 3s vertices and s pairwise disjoint edges.We will show that in linear hypergraphs, excluding a fixed induced matching impliesbounded matching number, which immediately implies (assuming Theorems 1.4 and1.6):

Theorem 1.10. Let s ∈ N. The 3-Uniform Hypergraph 2-Coloring Problem,

the 3-Uniform Hypergraph 2-Precoloring Extension Problem, and the 3-Uniform Hypergraph Maximum Stable Set Problem restricted to linear Ms-

free hypergraphs are polynomial-time solvable.

We will prove:

Theorem 1.11. Let s ∈ N. The 3-Uniform Hypergraph 3-Coloring Problemrestricted to linear hypergraphs G with ν(G) ≤ s is NP-complete.

We will give polynomial-time algorithms for the case k = 3 and r = 2 and the cases ≤ r − 1 of Theorems 1.4 and 1.5 in Section 2 and Section 3 respectively. In Section4, we will talk about some NP-hard cases and complete the proof of Theorems 1.4 and1.5. In Section 5, we will prove Theorem 1.6. In Section 6, we will prove Theorem1.7. Finally, in Section 7, we will prove results about linear hypergraphs, includingTheorem 1.11.

4

Page 5: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

2 Algorithm for the case k = 3 and r = 2

In this section, we will prove:

Theorem 2.1. For every fixed positive integer s, the 3-Bounded Hypergraph2-Coloring Problem restricted to hypergraphs with ν(G) ≤ s is polynomial-time

solvable.

A common strategy for coloring algorithms is using an algorithm for 2-SAT asa subroutine: Given an instance I consisting of n Boolean variables and m clauses,each of which contains 2 literals, the 2-Satisfiability Problem (2-SAT) is to de-cide whether there exists a truth assignment for every variable such that every clausecontains at least one true literal. We say I is satisfiable if it admits such an assignment.

Theorem 2.2 (Aspvall, Plass and Tarjan [1]). The 2-SAT Problem can be solved in

time O(n+m), where n is the number of variables and m is the number of clauses.

We say that two collections C, C′ of partial r-colorings of a hypergraph G are r-equivalent if either both C and C′ contain a partial coloring (X, c) which r-extends toG, or neither of them does. We say (X, c) is r-equivalent to C if the collection {(X, c)}is r-equivalent to C.

Proof of Theorem 2.1. Let G be a 3-bounded hypergraph with ν(G) ≤ s. First, wecreate a collection C of partial 2-colorings as follows. We fix a maximal matching Fof G. We define the set XF = ∪e∈F e. Let C be the set of all partial 2-colorings(XF , c : XF → [2]) of G.

We claim that the collection C has the following three properties. The theoremfollows immediately from these properties.

(1) C is 2-equivalent to G.

It suffices to show that if G has a 2-coloring c, then there is a partial 2-coloring inC which has a 2-precoloring extension. Let c be a 2-coloring of G. Consider the partial2-coloring (XF , c|XF ) ∈ C. Then c is a 2-precoloring extension of c|XF . Thus we haveproved (1).

(2) C can be computed in time O(n3).

Let |V (G)| = n. Since G is 3-bounded, |E(G)| ≤ O(n3). We can go through alledges and construct a maximal matching F in time O(n3). Checking whether (X, c) isa partial 2-coloring takes time O(1), as the size of X is bounded. Since |F | ≤ ν(G) ≤ s,we have |C| ≤ 23s = O(1). Thus, C can be constructed from F in time O(n3).

(3) For every partial 2-coloring c′ in C, whether c′ has a 2-precoloring extension

(V (G), c) can be decided in polynomial time.

Let (XF , c′) ∈ C. Since F is a maximal matching and G is 3-uniform, for everyedge e ∈ E(G) \ F , 1 ≤ |e \XF | ≤ 2.

5

Page 6: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

We define a 2-precoloring extension (X, c) of c′ as follows. We define the setsX0, X1, . . . iteratively. Let X0 = XF . Let c(v) = c′(v) for all v ∈ XF . Supposethat we have defined Xi. If there exists an edge e ∈ E(G) such that e ⊆ Xi ande is monochromatic, then c′ does not have a 2-precoloring extension and we returnthis determination. If there exists an edge e ∈ E(G) such that |e \ Xi| = 1 andc(e ∩Xi) = {j} for some j ∈ [2], we define c(w) to be the unique element of [2] \ {j}for w ∈ e \ Xi, and define Xi+1 = Xi ∪ {w}. Otherwise we stop and let X = Xi.This terminates within at most O(n3) steps. From the construction, clearly {(Xi, c)}is equivalent to {(Xi+1, c)} at every step; and it follows that {(X, c)} is equivalent to{(XF , c′)}, and that if this step returns a determination that (XF , c′) does not 2-extendto G, then this determination is correct.

We define a 2-SAT instance as follows. For every v ∈ V (G) \X, we have a variablexv. Let E ′ ⊆ E(G) be the set of edges such that |e \X| = 2 for all e ∈ E ′. For everyedge e ∈ E ′, we create a clause Ce. Let e = {v, u, w} with v ∈ X and u, w ∈ V (G) \X.If c(v) = 1, we set Ce = xu ∨ xw. Otherwise, let Ce = xu ∨ xw.

If the 2-SAT instance has a solution x, where "true" and "false" are representedby 0 and 1 respectively, then we set c(v) = xv + 1 for every v ∈ V (G) \X. Take anedge e ∈ E(G). If |e \ X| ≤ 1, by the construction of X, e is not monochromatic.If |e \ X| = 2, the clause Ce of 2-SAT instance and the construction of c guaranteesthat at least one of the vertices in e \X receives the opposite color from the vertex ine ∩X. Since F is maximal, there is no edge e in E(G) with |e \X| = 3. Thus, c is a2-precoloring extension of (X, c′).

If there is a 2-precoloring extension d of (X, c), then we set xv = d(v)− 1 for everyv ∈ V (G) \ X. For every edge e = {v, u, w} ∈ E ′ with e ∩ X = {v}, if d(v) = 1,then Ce = xu ∨ xw. Since e is not monochromatic, without loss of generality we mayassume d(u) = 2, and so xu = d(v)− 1 = 1. Thus, the clause Ce is satisfied. A similarargument applies for d(v) = 2. From the construction of clauses of this 2-SAT instance,we conclude that x is a solution to the 2-SAT instance.

Therefore, deciding whether (X, c) has a 2-coloring extension is equivalent to solvingthe 2-SAT instance defined above.

It remains to show that this can be done in polynomial-time. Let n be the numberof vertices of G. Constructing the set X takes time O(n3). Constructing the equivalent2-SAT instance takes time O(n3). Solving this 2-SAT instance takes time O(n). Sothe total running time is O(n3).

This immediately implies, for fixed r, a polynomial-time algorithm for 2-coloringtournaments with no r vertex-disjoint cyclic triangles, which was first proved by Hajebi[8].

3 Algorithm for the case s ≤ r − 1

In this section, we will prove:

6

Page 7: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

Theorem 3.1. For fixed positive integers r, k, s with s ≤ r − 1, the k-BoundedHypergraph r-Precoloring Extension Problem restricted to hypergraphs Gwith ν(G) ≤ s is polynomial-time solvable.

Lemma 3.2. Let r, k, s ∈ N with s ≤ r − 1. Let G be a k-bounded hypergraph with

ν(G) ≤ s. Given a partial r-coloring (X, c) of G, we define Ei = {e ∈ E(G) : e ∩X ⊆c−1(i)}. If Ei 6= ∅ for all i ∈ [r], then there is a vertex set X ′ ⊃ X and a collection of

partial r-colorings C such that

• For every (X∗, c∗) ∈ C, X∗ = X ′;

• |C| ≤ rks = O(1), and C can be computed from (X, c) in time O(n3);

• There is a color j ∈ [r] such that for every edge e ∈ Ej, |e ∩X′| ≥ |e ∩X| + 1;

and

• C is r-equivalent to (X, c).

Proof. Let S be a matching in G such that S ⊆⋃

i∈[r]Ei, and S is maximal with

respect to this condition. Let XS = ∪e∈Se. Let X ′ = X ∪ XS. Let C be the setof all partial r-colorings (X ′, c′ : X ′ → [r]) such that c′|X = c. The first propertyfollows immediately from the construction. Since |S| ≤ s, |XS| ≤ ks, and we have|C| ≤ rks = O(1). Finding S takes time O(n3), and thus, C can be computed from(X, c) in time O(n3). This proves the second property.

For every e ∈ S, there exists i ∈ [r] such that e ∈ Ei, and therefore we have thatc(v) = i for all v ∈ e ∩X. Since |S| ≤ s ≤ r − 1, there exists a color j ∈ [r] such thatc(v) 6= j for all v ∈ X ∩XS. Let e be an edge in Ej . We know that e∩X ⊆ c−1(j), soe ∩XS ∩X = ∅. But from the definition of S, we have e ∩XS 6= ∅, as otherwise S isnot maximal. Thus, e ∩ (XS \X) 6= ∅. This proves the third property.

Suppose that there is a partial r-coloring (X ′, c′) ∈ C which r-extends to G. Thenby the construction of C, c′|X = c. Thus, every r-precoloring extension of (X ′, c′) isalso an r-precoloring extension of (X, c). Now suppose (X, c) r-extends to V (G), thatis, there is a coloring c′ : V (G) → [r] with c′|X = c. Then by the construction of C,(X ′, c′|X′) ∈ C. Therefore, the last property holds.

Theorem 3.3. For fixed positive integers r, k, s with s ≤ r − 1, there is an algorithm

with the following specifications:

• Input: A k-bounded hypergraph G with ν(G) ≤ s, and an r-precoloring (X, c).

• Output: one of

– an r-precoloring extension of (X, c) to V (G);

– a determination that (X, c) does not r-extend to G.

• Running time: O(|V (G)|3).

7

Page 8: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

Proof. We will define a sequence C0, . . . of collections of partial r-colorings iteratively,as follows. Let C0 = {(X, c)}.

Suppose that we have defined Ct. Given a partial r-coloring (Y, d) ∈ Ct, let EY,dt,i =

{e ∈ E(G) : e ∩ Y ⊆ d−1(i)}. If EY,dt,i = ∅ for some i ∈ [r] and (Y, d) ∈ Ct, then we

define d′ by setting d′|Y = d|Y and d′(v) = i for all v ∈ V (G) \ Y and return d′. Notethat d′ is an r-coloring of G: Since (Y, d) is a partial r-coloring, it follows that no edgeof G[Y ] is monochromatic. Therefore, if G contains an edge e which is monochromaticwith respect to d′, then e \ Y 6= ∅. It follows that e \ Y 6= ∅, and since d′(v) = ifor all v ∈ V (G) \ Y , it follows that every vertex of e is colored i by d′. But thene ∩ Y ⊆ d−1(i), a contradiction. This shows that d′ is an r-coloring of G.

Otherwise, for every (Y, d) ∈ Ct, we have that EY,dt,i 6= ∅, and so there is a collection

of partial r-colorings CY,dt+1 which satisfies the properties in Lemma 3.2 applied to G

and (Y, d). Let Ct+1 = ∪(Y,d)∈CtCY,dt+1. By Lemma 3.2, Ct+1 is r-equivalent to Ct; and

inductively, Ct+1 is equivalent to C0 = {(X, c)}. Thus, if Ct+1 = ∅, then (X, c) does notr-extend to G and we return this.

It remains to show that this algorithm terminates and runs in polynomial time. Toprove this, we define a potential function ψ((Y, d)) =

i∈[r]max({0}∪{|e\Y | : e∩Y ⊆

d−1(i)}). We have ψ((X, c)) ≤ rk since each summand is at most k. We will prove byinduction on t that for every (Y, d) ∈ Ct, we have ψ((Y, d)) ≤ rk − t.

It suffices to show that if (Y, d) ∈ Ct and (Y ′, d′) ∈ CY,dt+1 then ψ((Y ′, d′)) ≤

ψ((Y, d)) − 1. By the third property of Lemma 3.2, there is a color j ∈ [r] suchthat for every edge e ∈ EY,d

t,j , |e ∩ Y ′| ≥ |e ∩ Y | + 1, which means that max({0} ∪{|e \ Y ′| : e ∩ Y ′ ⊆ d′−1(j)}) ≤ max({|e \ Y | : e ∩ Y ⊆ d−1(j)}) − 1. It follows thatψ((Y ′, d′)) ≤ ψ((Y, d))− 1, as claimed.

Since ψ((Y, d)) ≥ 0 for every partial r-coloring (Y, d) of G, it follows that thisalgorithm terminates in t′ steps for some t′ ≤ rk. Since there are O(1) iterations,and by Lemma 3.2, we have |Ct| = O(1) for all t ≤ t′. Moreover, the set Ct+1 can becomputed from Ct in time |Ct| · O(n

3) = O(n3). Thus, each step takes time O(n3). Sothe total running time is O(n3).

4 NP-hardness results for bounded matching number

Let G and H be two hypergraphs. We define an operation, ⋉, via G⋉H := (V (G) ∪V (H), E(G) ∪ {e ∪ {x} : e ∈ E(H), x ∈ V (G)}).

We have the following properties.

Lemma 4.1. Let G and H be hypergraphs. Then ν(G⋉H) ≤ |V (G)|.

Proof. This follows immediately from the fact that every edge in G ⋉ H contains atleast one vertex in V (G).

Lemma 4.2. Let H be a hypergraph. If G is a hypergraph with χ(G) = r, then G⋉His r-colorable if and only if H is r-colorable.

8

Page 9: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

Proof. Suppose for a contradiction that G ⋉ H has an r-coloring c and H is not r-colorable. Since c|V (H) is not an r-coloring of H , there exists an edge e ∈ E(H) suchthat e is monochromatic with respect to c|V (H). Since χ(G) = r and (G⋉H)[V (G)] =G, there exist vertices v1, . . . , vr ∈ V (G) such that c(vi) = i for all i ∈ [r]. But thenone of the edges e ∪ {v1}, . . . , e ∪ {vr} is monochromatic, which contradicts the factthat c is an r-coloring of G⋉H .

Now suppose that H has an r-coloring d. Since χ(G) = r, G has an r-coloring d′.We define a new function d∗ : V (G ⋉ H) → [r] with d∗(v) = d(v) if v ∈ V (H) andd∗(v) = d′(v) otherwise. For every edge e ∈ E(G ⋉H), if e ∈ E(G), then d∗|e = d′|e.So e is not monochromatic. Otherwise e = e′ ∪ {v} for some e′ ∈ E(H) and v ∈ V (G).Then d∗|e′ = d|e′, and since the edge e′ is not monochromatic, it follows that e is notmonochromatic. Thus d∗ is an r-coloring of G⋉H .

Theorem 4.3. Given fixed integers k and r with k, r ≥ 2, if the k-Bounded Hy-pergraph r-Coloring Problem is NP-complete, then the (k + 1)-Bounded Hy-pergraph r-Coloring Problem restricted to hypergraphs with ν(G) ≤ r is NP-

complete.

Proof. Let H be a k-bounded hypergraph. We set the hypergraph G = Kr, a completegraph on r vertices. We have χ(G) = r. The hypergraph G ⋉ H can be constructedfrom G and H in time O(nk+1), where n = |V (G⋉H)|. By the construction, G⋉H is(k + 1)-bounded. The remaining part of the proof follows immediately from Lemmas4.1 and 4.2.

Theorem 4.4. Given fixed integers k and r with k, r ≥ 2, if the k-Uniform Hyper-graph r-Coloring Problem is NP-complete, then the (k + 1)-Uniform Hyper-graph r-Coloring Problem restricted to hypergraphs with ν(G) ≤ (r − 1)k + 1 is

NP-complete.

Proof. Let H be a k-uniform hypergraph and let G be a complete (k + 1)-uniformhypergraph with (r−1)k+1 vertices. The hypergraph G⋉H can be constructed fromG and H in time O(nk+1), where n = |V (G ⋉ H)|. By the construction, G ⋉ H is(k + 1)-uniform.

We want to show that χ(G) = r. We choose k vertices to color i for every i ∈[r − 1], and color the remaining vertex r. Since G is (k + 1)-uniform, every edge ofG receives at least two colors. Thus, χ(G) ≤ r. Suppose for a contradiction thatχ(G) ≤ r − 1. Then take an (r − 1)-coloring c of G. There exists one color i with

|c−1(i)| ≥ ⌈ (r−1)k+1r−1

⌉ ≥ ⌈k + 1r−1

⌉ = k + 1. This means that there is a monochromaticedge in G, which contradicts the fact that c is an (r − 1)-coloring of G.

The remaining part of the proof follows immediately from Lemmas 4.1 and 4.2.

Theorem 4.5. Given fixed integers k and r with k, r ≥ 2, if the k-Uniform Hy-pergraph r-Coloring Problem is NP-complete, then the (k + 1)-Uniform Hy-pergraph r-Precoloring Extension Problem restricted to hypergraphs with

ν(G) ≤ r is NP-complete.

9

Page 10: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

Proof. Let H be a k-uniform hypergraph and let G be a graph with a set of vertices{v1, . . . , vr} and no edges. Define the precoloring of G ⋉ H to be (V (G), c′) withc′(vi) = i for all i ∈ [r]. The hypergraph G ⋉ H can be constructed from G and Hin time O(nk+1), and the precoloring (V (G), c′) of G⋉ H can be constructed in timeO(n), where n = |V (G⋉H)|. The graph H is k-uniform and E(G) = ∅, so G⋉H is(k + 1)-uniform.

It remains to show that G⋉H has an r-precoloring extension with respect to theprecoloring (V (G), c′) if and only if H is r-colorable.

Suppose G⋉H has an r-precoloring extension c. Assume for a contradiction that His not r-colorable. Since c|V (H) is not an r-coloring of G, there exists an edge e ∈ E(H)such that e is monochromatic. By the definition of c′, one of the vertices v1, . . . , vrreceives the same color as e, which contradicts the fact that c is an r-precoloringextension of G⋉H and (V (G), c′).

Now suppose that H has an r-coloring d. We define a new function d∗ : V (G⋉H) →[r] with d∗(v) = d(v) if v ∈ V (H) and d∗(v) = c′(v) otherwise. For every edgee ∈ E(G⋉H), e = e′ ∪ {v} for some e′ ∈ E(H) and v ∈ V (G). Then d∗|e′ = d|e′. Theedge e′ is not monochromatic, so e is not monochromatic. Thus d∗ is an r-coloring ofG⋉H which r-extends (V (G), c′).

Theorem 4.6. Given fixed integers k and r with k, r ≥ 2, the k-Uniform Hyper-graph r-Coloring Problem is NP-complete if k + r ≥ 5.

Proof. The statement holds for the cases k = 3 and r = 2 by Theorem 1.3, andk = 2 and r ≥ 3 by Theorem 1.1. By Theorem 4.4, if the k-Uniform Hypergraphr-Coloring Problem is NP-complete, then the (k + 1)-Uniform Hypergraphr-Coloring Problem is NP-complete.

Now we are ready to prove our main results.

Proof of Theorem 1.4. The first and second polynomial-time solvable cases follow fromTheorem 3.1 and Theorem 2.1 respectively. The third polynomial-time solvable casefollows from Theorem 1.2, as a graphG with ν(G) ≤ s is guaranteed to be (s+1)P2-free.Combining Theorem 4.6 with either Theorem 4.3 or Theorem 4.5, we have completedthe dichotomies.

Proof of Theorem 1.5. The first and second polynomial-time solvable cases follow fromTheorem 3.1 and Theorem 2.1 respectively. The third polynomial-time solvable casefollows from Theorem 1.2, as a graphG with ν(G) ≤ s is guaranteed to be (s+1)P2-free.The NP-completeness result comes from Theorems 4.6 and 4.4.

5 Stable Set

In this section, we consider the complexity of stable set problems in hypergraphs withbounded matching number. The k-Uniform Hypergraph Maximum Weight Sta-ble Set Problem is the following: Given a k-uniform hypergraph G and a weight

10

Page 11: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

function w : V (G) → R≥0, compute a stable set S ⊆ V (G) with w(S) maximized.When all weights are 1, this is called the k-Uniform Hypergraph Maximum Sta-ble Set Problem.

For graphs, the Graph Maximum Weight Stable Set Problem can be solvedin polynomial time if the maximum size of an induced matching is bounded:

Theorem 5.1 (Balas and Yu [2]). For a fixed positive integer s, the Graph MaximumWeight Stable Set Problem restricted to sP2-free graphs can be solved polynomial

time.

For hypergraphs, we notice that:

Theorem 5.2. For fixed positive integers k and s, the k-Uniform HypergraphMaximum Stable Set Problem restricted to hypergraphs with ν(G) ≤ s is polynomial-

time solvable.

Proof. Let G be a k-uniform hypergraph with ν(G) ≤ s, and let F ⊆ E(G) be amaximal matching. Let n be the number of vertices of G. We have |F | ≤ s. The setV (G) \ (∪e∈F e) is stable as F is maximal, and |V (G) \ (∪e∈Fe)| ≥ n − ks. Thus, amaximum stable set of G is of size at least n− ks.

Therefore, to find a maximum stable set, we can simply enumerate all choices of aset U ⊆ V (G) with |U | ≤ ks, and check if the set V (G) \ U is stable, and return thelargest stable set found this way. There are nks choices of the set U , and for each U ,it takes time O(nk) to verify stability. Thus, the total running time is O(nk).

In contrast, we will show the following result for the weighted version of the problem:

Theorem 5.3. For a fixed positive integer k ≥ 3, the k-Uniform HypergraphMaximum Weight Stable Set Problem restricted to hypergraphs with ν(G) ≤ 1is NP-complete.

In order to prove Theorem 5.3, we need the following results.

Theorem 5.4 (Garey and Johnson [6]). The Maximum Stable Set Problem is

NP-complete.

Lemma 5.5. For a fixed positive integers k ≥ 3, if the (k−1)-Uniform HypergraphMaximum Weight Stable Set Problem is NP-complete, then the k-UniformHypergraph Maximum Weight Stable Set Problem restricted to hypergraphs

with ν(G) ≤ 1 is NP-complete.

Proof. Suppose the (k − 1)-Uniform Hypergraph Maximum Weight StableSet Problem is NP-complete. Let G be a (k − 1)-uniform hypergraph with weightfunction w. We construct a new k-uniform hypergraph H with V (H) = {v} ∪ V (G)and E(H) = {{v} ∪ e : e ∈ E(G)}. We define the weight function w′ : V (G) → R≥0

such that w′(u) = w(u) for each u ∈ V (G) and w′(v) =∑

u∈V (G) w(u) + 1. From the

11

Page 12: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

construction, since v is contained in every edge of H , it follows that the hypergraph Hsatisfies ν(H) ≤ 1.

For a set T ⊆ V (G), T is a stable set of G if and only if T ∪ {v} is a stable set ofH . Let S be a maximum weight stable set of H with respect to the weight functionw′. By the construction, the vertex v is in S. It follows that S \ {v} is a maximumweight stable set of G, and thus, to find a maximum weight stable set of G, it sufficesto find a maximum weight stable set of H .

Since the construction can be done in polynomial time, we have proved this lemma.

Proof of Theorem 5.3. We prove this by induction on k. When k = 2, by Theorem 5.4,the Graph Maximum Stable Set Problem is NP-complete. Thus, the GraphMaximum Weight Stable Set Problem is NP-complete.

Suppose that the k-Uniform Hypergraph Maximum Weight Stable SetProblem is NP-complete. By Lemma 5.5, the (k+1)-Uniform Hypergraph Max-imum Weight Stable Set Problem restricted to hypergraphs with ν(G) ≤ 1 isNP-complete. Moreover, the (k + 1)-Uniform Hypergraph Maximum WeightStable Set Problem is NP-complete.

6 Excluding an induced subhypergraph with one edge

For t ∈ N with t ≥ 3, let Ht be the 3-bounded hypergraph with t+ 3 vertices and oneedge. In this section, we will give a polynomial-time algorithm for 2-coloring 3-boundedHt-free hypergraphs.

Lemma 6.1. Let t ∈ N, and let G be a 3-bounded Ht-free hypergraph. There is a

polynomial-time algorithm to test if G has a 2-coloring with at least t vertices of each

color.

Proof. We may assume that |e| ≥ 2 for all e ∈ E(G), since G is not 2-colorableotherwise. Let C be a partial 2-coloring collection containing all partial 2-colorings(X ∪ Y, c′) for every pair of disjoint sets X, Y ⊆ V (G) with |X| = |Y | = t and X, Ystable, and c′ : X ∪ Y → [2] with c′(v) = 1 for all v ∈ X and c′(v) = 2 otherwise. Itsuffices to show that C has the following three properties.

(1) C is 2-equivalent to G.

We only need to show that if G has a 2-coloring c with at least t vertices of eachcolor, then there exists a partial 2-coloring in C which 2-extends to G. Let c be a2-coloring of G such that |c−1(i)| ≥ t for all i ∈ [2]. Let X and Y be subsets of c−1(1)and c−1(2) respectively, with |X| = |Y | = t. We have (X ∪ Y, c|X∪Y ) ∈ C, and c is a2-precoloring extension of (X ∪ Y, c|X∪Y ) to V (G). This proves (1).

(2) C can be computed in time O(n2t+3), where n = |V (G)|.

Since G is 3-bounded, |E(G)| ≤ O(n3). By construction, we have |C| ≤ O(n2t).

12

Page 13: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

Constructing the sets X, Y and the corresponding partial 2-coloring c takes timeO(n2t). Checking whether (X ∪ Y, c) is a partial 2-coloring takes time O(n3). Thus, Ccan be constructed in time O(n2t+3). This proves (2).

(3) For every partial 2-coloring (S, c) in C, whether c 2-extends to G can be decided

in polynomial time.

We define a 2-SAT instance as follows. For every v ∈ V (G) \ S, we have a variablexv. Let E ′ ⊆ E(G) be the set of edges e ∈ E(G) with |c(e ∩ S)| = 1. Note that forevery edge e ∈ E ′, we have e∩S 6= ∅ and e \S 6= ∅ (since (S, c) is a partial 2-coloring).Thus, |e \ S| ∈ {1, 2}. For every edge e ∈ E ′, we create a clause Ce. Let u, w ∈ e \ Swith u 6= w with |e \ S| = 2. If c(e ∩ S) = {1}, we set Ce = xu ∨ xw. Otherwise, letCe = xu ∨ xw. Next, let E ′′ be the set of edges e ∈ E(G) with |e| = 2 and e ∩ S = ∅.For every e ∈ E ′′, say e = {u, w}, we add two clauses C ′

e = xu ∨ xw and C ′′e = xu ∨ xw.

If the 2-SAT instance has a solution (sv)v∈V (G)\S , where "true" and "false" arerepresented by 0 and 1 respectively, then we set d(v) = sv + 1 for every v ∈ V (G) \ S,and d(v) = c(v) for all v ∈ S. We claim that d is a 2-coloring of G. Consider anedge e ∈ E(G). If |c(e ∩ S)| > 1, then e is not monochromatic. If |c(e ∩ S)| = 1,then e ∈ E ′. It follows that the clause Ce of 2-SAT instance and the construction of dguarantees that at least one vertex in e\S receives the opposite color from the verticesin e ∩ S. Since both sets are non-empty, it follows that e is not monochromatic. Itremains to consider the case that e ∩ S = ∅. If |e| = 2, then the clauses C ′

e and C ′′e

guarantee that the two vertices of e receive different colors. Therefore, we may assumethat |e| = |e \ S| = 3. Suppose for a contradiction that e is monochromatic. Withoutloss of generality, assume d(v) = 1 for all v ∈ e. Let X = (S ∩ c−1(1)), and considerthe set X ∪ e. Since all edges with a non-empty intersection with S and all edges ofsize 2 are non-monochromatic, there is no edge e′ ∈ E(G) with e′ ⊆ X ∪ e and e′ 6= e.Thus, G[X ∪ e] is an induced copy of Ht in G, which contradicts the fact that G isHt-free. Therefore, d is a 2-precoloring extension of (S, c).

If there is a 2-precoloring extension d of (S, c), then we set xv = d(v)− 1 for everyv ∈ V (G) \S. For every edge e ∈ E ′, if Ce = xu ∨ xw, then e∩S contains only verticescolored 1, and so d(u) = 2 or d(w) = 2; it follows that Ce is satisfied. If Ce = xu ∨ xw,then e ∩ S contain only vertices colored 2, and so d(u) = 1 or d(w) = 1; it followsthat Ce is satisfied. For every edge e = {u, w} ∈ E ′′, it follows that d(u) 6= d(w), andhence one of xu, xw is "true" and the other is "false." It follows that C ′

e and C ′′e are

satisfies. From the construction of clauses of this 2-SAT instance, we conclude thatthis assignment is a solution to the 2-SAT instance. Therefore, deciding whether (S, c)has a 2-coloring extension is equivalent to solving the 2-SAT instance defined above.

It remains to show that this can be done in polynomial time. Constructing the2-SAT instance takes time O(n3). Solving this 2-SAT instance takes time O(n3). Sothe total running time is O(n3). This proves (3) and concludes the proof.

Theorem 6.2. Let t ∈ N, and let G be a 3-bounded Ht-free hypergraph. There is a

polynomial-time algorithm which takes G as input, and outputs either a 2-coloring of

13

Page 14: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

G, or a determination that G is not 2-colorable.

Proof. If G satisfies the conditions of Lemma 6.1, then we are done. Otherwise we cango through every possible coloring such that less than t vertices receive color i for somei ∈ [2], and check whether it is a 2-coloring, in time O(nt+3).

Note that the proof of Lemma 6.1 can be modified to work for the precoloringextension version of the problem, and so can Theorem 6.2.

7 Linear Hypergraphs

7.1 The polynomial-time algorithm

We say a k-uniform hypergraph is complete if its edge set is the set of all k-vertex subsetsof its vertex set. The hypergraph Ramsey number, Rk(n1, . . . , nt), is the smallest integerN such that for every function f : E(G) → [t] for a complete k-uniform hypergraph Gwith at least N vertices, there exists i ∈ [t] and a set S ⊆ V (G) with |S| ≥ ni suchthat all edges e ⊆ S satisfy f(e) = i.

Theorem 7.1 (Ramsey [14]). For all positive integers k, n1, . . . , nt, the hypergraph

Ramsey number Rk(n1, . . . , nt) exists.

Lemma 7.2. For every positive integer s, there exists a positive integer s′ such that

every 3-uniform linear hypergraph G which contains a matching of size s′ contains an

induced matching of size s.

Proof. We may assume that s ≥ 4. Let X = {G1, . . . , Gt} be the set of all linear

3-uniform hypergraphs with vertex set {x1, . . . , x9}. Since there at most 2(9

3) distinct

3-uniform (labelled) hypergraphs on 9 vertices, it follows that t ≤ 2(9

3). Let s′ =

R3(n1, . . . , nt) with n1 = · · · = nt = s.Let {e1, . . . , es′} be a matching of size s′ in G. For i ∈ [s′], let ei = {ui, vi, wi}. Let

H be a complete 3-uniform hypergraph V (H) = {1, . . . , s′}. We define f : E(H) → [t]as follows. For e = {i, j, k} ⊆ [s′] with i < j < k, we define f(e) =m if G[ei ∪ ej ∪ ek] isisomorphic to Gm via the isomorphism ui 7→ x1, vi 7→ x2, wi 7→ x3, uj 7→ x4, vj 7→ x5,wj 7→ x6, uk 7→ x7, vk 7→ x8 and wk 7→ x9.

From Theorem 7.1, it follows that there is a set S ⊆ [s′] with |S| = s and m ∈ [t]such that f(e) = m for all e ⊆ S. We claim that

E(Gm) = {{x1, x2, x3}, {x4, x5, x6}, {x7, x8, x9}}.

Let i, j, k, l ∈ S with i < j < k < l. Since G[ei, ej , ek] contains the edges ei, ej , ek, itfollows that {{x1, x2, x3}, {x4, x5, x6}, {x7, x8, x9}} ⊆ E(Gm). Suppose for a contradic-tion that E(Gm) contains a fourth edge {xa, xb, xc}. Then, since Gm is linear, we mayassume that a ∈ {1, 2, 3}, b ∈ {4, 5, 6}, and c ∈ {7, 8, 9}. The graphs G[ei∪ ej ∪ ek] and

14

Page 15: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

G[ei∪ej∪el] are isomorphic to Gm via isomorphisms ϕ, ϕ′, say; and from the definitionof f it follows that ϕ−1(xa) = ϕ′−1(xa), ϕ

−1(xb) = ϕ′−1(xb), and ϕ−1(xc) 6= ϕ′−1(xc)(since ϕ−1(xc) ∈ ek and ϕ′−1(xc) ∈ el and ek∩el = ∅). But this implies that G containsthe edges ϕ−1({xa, xb, xc}) and ϕ′−1({xa, xb, xc}) which have exactly two vertices incommon, contrary to the assumption that G is linear. This proves our claim.

It follows that G[⋃

s∈S es]

is an induced matching of size s in G.

Theorem 7.3. For all s, the 2-Precolouring Extension Problem restricted to

3-uniform linear hypergraphs with no induced matching of size at least s can be solved

in polynomial time.

Proof. By Theorem 3.1 and Lemma 7.2.

7.2 NP-hardness of 3-coloring with bounded matching number

In this section, we will prove the following result.

Theorem 7.4. The 3-Uniform Hypergraph 3-coloring Problem restricted to

linear hypergraphs with ν(G) ≤ s is NP-complete for all s ≥ 532.

We will use the following theorems.

Theorem 7.5 (Garey, Johnson and Stockmeyer [5]). The 3-Coloring Problemrestricted to graphs with maximum degree at most 4, is NP-complete.

Theorem 7.6 (Vizing [16], Misra and Gries [11]). There is a O(mn)-algorithm for

edge-coloring a graph G with D+1 colors, where D is the maximum degree of G, m is

the number of edges and n is the number of vertices.

Let us introduce a new way to describe 3-uniform hypergraphs. Instead of usingedges with three vertices, we use 2-edges with labeled vertices. Given a graph G, wesay a function l : E(G) → V (G) with l(e) /∈ e for all e ∈ E(G) is a labeling of G. Thevertex l(e) is called the label of e, and the edge e is a labeled edge.

For a linear 3-uniform hypergraph G, let l : E(G) → V (G) be a function withl(e) ∈ e for all e ∈ E(G). Let G′ be the graph with vertex set V (G) and edge set{{e \ {l(e)} : e ∈ E(G)}, and let l′(e \ {l(e)}) = l(e). Since G is linear, each edge ofG′ corresponds to a unique edge of G, and thus l′ is well-defined. We call (G′, l′) alabeled graph representation of G. Notice that with a labeled graph representation, wecan reconstruct the corresponding linear 3-uniform hypergraph.

In this section, all of the pictures of 3-uniform hypergraphs are drawn using thelabeled graph representation.

The following two lemmas give constructions for gadgets we will use in our NP-hardness reduction. The existence of similar gadgets in 3-uniform linear hypergraphswas first proved in [13]. Here we give an explicit construction to obtain a precise boundfor the matching number. The construction is shown in Figure 1.

15

Page 16: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

Lemma 7.7. There is a linear 3-uniform hypergraph G1 with three specified vertices

a, b, c with the following properties:

• For every 3-coloring f of G1, either f(a), f(b), f(c) are all distinct, or f(a) =f(b) = f(c).

• There is a 3-coloring f ′ of G1 with f(a), f(b), f(c) all distinct.

• There is a set Z ⊆ V (G1) with |Z| ≤ 19 such that G1 \ Z has no edges, and

a, b, c ∈ Z.

• No edge e of G1 contains more than one of the vertices a, b, c.

Proof. We want to define G1 using the labeled graph representation (G′1, l). First,

we create three vertices a, b, c. Then we create 4 copies of K4, say H1, H2, H3, H4.For i ∈ [4], let V (Hi) = {si, ti, ui, vi}. We define the labeling l(siti) = l(uivi) = a,l(siui) = l(tivi) = b, and l(sivi) = l(tiui) = c.

Let S = V (H1)×V (H2)×V (H3)×V (H4). For every 4-tuple T = (x, y, z, w) ∈ S, wecreate 5 new copies of K4, say HT

0 , HT1 , H

T2 , H

T3 , H

T4 . Let V (HT

i ) = {sTi , tTi , u

Ti , v

Ti } for

i ∈ [4], and V (HT0 ) = {rT1 , r

T2 , r

T3 , r

T4 }. We define the labeling l(sTi t

Ti ) = l(uTi v

Ti ) = a,

l(sTi uTi ) = l(tTi v

Ti ) = b and l(sTi v

Ti ) = l(tTi u

Ti ) = c for i ∈ [4], and l(rT1 r

T2 ) = l(rT3 r

T4 ) =

a, l(rT1 rT3 ) = l(rT2 r

T4 ) = b and l(rT1 r

T4 ) = l(rT2 r

T3 ) = c. For each i ∈ [4], we add edges

sTi rTi with l(sTi r

Ti ) = x, tTi r

Ti with l(tTi r

Ti ) = y, uTi r

Ti with l(uTi r

Ti ) = z and vTi r

Ti with

l(vTi rTi ) = w.

Let V (G′1) = {a, b, c}∪ (∪i∈[4]V (Hi))∪ (∪T∈S ∪

4i=0 V (H

Ti )), and E(G′

1) be the set ofall labeled edges defined above. By the construction, the function l defined above is alabeling of G′

1. Notice that there is no edge incident to more than one of the verticesa, b, c, and l(V (G′

1)) = {a, b, c} ∪ (∪i∈[4]V (Hi)). Thus, by taking Z = l(V (G′1)), we

have |Z| ≤ 19 and a, b, c ∈ Z; so Z satisfies the third property of the lemma. We nowprove the other properties.

(1) The 3-uniform hypergraph G1 is linear.

Let X1 = {a, b, c}, X2 = (∪i∈[4]V (Hi)) and X3 = (∪T∈S ∪4i=0 V (H

Ti )). From the

construction, it follows that for every edge e of G1, there exist i, j ∈ [3] with i < j suchthat e contains one vertex of Xi and two vertices of Xj and with e∩Xj ∈ E(G′

1) (andtherefore, {l(e ∩Xj)} = e ∩Xi).

Suppose for a contradiction that there exist distinct e, e′ ∈ E(G1) with |e∩ e′| = 2.Let j, j′ ∈ [3] such that |e∩Xj | = 2 and |e′ ∩Xj′| = 2. It follows that j = j′. Since G′

1

is simple, we have e∩Xj 6= e′∩Xj , and so e\Xj = e′ \Xj = {l(e∩Xj)} = {l(e′∩Xj)}.But in G′

1, every two edges with the same label are not incident to a common vertex,a contradiction. We conclude that G1 is linear. This proves (1).

(2) There is a 3-coloring f ′ of G1 with f ′(a), f ′(b), f ′(c) all distinct.

We define a function f ′ : (V (G1)) → [3] as follows. Let f ′(a) = 1, f ′(b) = 2 andf ′(c) = 3. For each i ∈ [4], let f ′(si) = f ′(ti) = 2 and f ′(ui) = f ′(vi) = 3. Since

16

Page 17: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

l(siti) = l(uivi) = a, the edges of G1 corresponding to labeled edges in G′1[V (Hi)] are

not monochromatic.For each T ∈ S and each i ∈ [4], let f ′(sTi ) = f ′(uTi ) = 1, f ′(tTi ) = f ′(vTi ) = 3,

f ′(rT1 ) = f ′(rT4 ) = 1, and f ′(rT2 ) = f ′(rT3 ) = 2. For i ∈ [4], no vertex v ∈ V (HTi )

has f ′(v) = 2, and no edge between V (HTi ) and V (HT

0 ) is labeled a. So there is nomonochromatic edge e in G1 with e ∩ ∪4

i=0V (HTi ) 6= ∅. Therefore, the function f ′ is a

3-coloring of G1. This proves (2).

(3) For each 3-coloring f of G1, either f(a), f(b), f(c) are all distinct, or f(a) = f(b) =f(c).

Assume for a contradiction that, without loss of generality, there is a 3-coloringf of G1 such that f(a) = f(b). Without loss of generality, we may assume thatf(a) = f(b) = 1 and f(c) = 2.

We claim that there exists x0 ∈ V (H1) such that f(x0) = 3. Assume for a contra-diction that every vertex v ∈ V (H1) has f(v) 6= 3. Since l(s1v1) = c and f(c) = 2,without loss of generality let f(s1) 6= 2. So f(s1) = 1. Since l(s1t1) = a, l(s1u1) = band f(a) = f(b) = 1, we have f(t1) = f(u1) = 2. But the edge t1u1 is labeled c andf(c) = 2, the corresponding edge {t1, u1, c} of G1 is monochromatic, which violates thecondition that f is a 3-coloring of G1.

A similar argument holds for every Hi with i ∈ {2, 3, 4}, and HTj with T ∈ S and

j ∈ {0, 1, . . . , 4}. There exist vertices y0 ∈ V (H2), z0 ∈ V (H3), w0 ∈ V (H4) such thatf(y0) = f(z0) = f(w0) = 3. Let T = (x0, y0, z0, w0). By the argument above, thereis a j ∈ [4] such that f(rj) = 3. Since there is a vertex v ∈ V (HT

j ) with f(v) = 3,and f(l(vrj)) = 3 (because l(vrj) ∈ {x0, y0, z0, w0}), the edge {v, rj, l(vrj)} of G1 ismonochromatic, which contradicts the condition that f is a 3-coloring of G1. Thisproves (3).

Lemma 7.8. There is a linear 3-uniform hypergraph G2 with specified vertices a, b, cwith the following properties:

• For every 3-coloring f of G2, we have f(a), f(b), f(c) all distinct.

• G2 is 3-colorable.

• There is a set Z ⊆ V (G2) with |Z| ≤ 19 such that G2 \ Z has no edges, and

a, b, c ∈ Z.

• At most one edge of G2 contains more than one of the vertices a, b, c.

Proof. Let G2 be obtained from G1 defined in Lemma 7.7 by adding the edge {a, b, c}.The result follows immediately from Lemma 7.7.

Now we are ready to prove Theorem 7.4.

17

Page 18: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

a

b

c

s1 t1

u1 v1

s2 t2

u2 v2

s3 t3

u3 v3

s4 t4

u4 v4

sT1 tT1

uT1 vT1

sT2 tT2

uT2 vT2

sT3 tT3

uT3 vT3

sT4 tT4

uT4 vT4

rT1 rT2

rT3 rT4

xy

z w

x y

z w

x y

z w

x y

z w

Figure 1: The construction from Lemma 7.7. The colored edge means the label of thisedge is the vertex of the corresponding color. The right-hand side shows HT

0 , . . . , HT4

for T = (x, y, z, w).

18

Page 19: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

Proof of Theorem 7.4. We give an NP-hardness reduction from the Graph 3-ColoringProblem restricted to graphs with maximum degree at most 4, which is NP-hard byTheorem 7.5.

Let G∗ be a graph with maximum degree at most 4. Let f ′ : E(G∗) → [5] be anedge-coloring of G∗. We construct a labeled graph representation (G′, l) of a 3-uniformlinear hypergraph G as follows.

We create three sets of vertices A = {a11, . . . , a110}, B = {a21, . . . , a

210} and C =

{a31, . . . , a310}. For the vertices a11, a

21, a

31, we create a new copy ofG2 as defined in Lemma

7.8, denoted G1, with a11, a21, a

31 as its specified vertices. For every i ∈ {2, . . . , 10}, we

create three new copies of G1 as defined in Lemma 7.7, one with specified verticesa1i , a

21, a

31, one with specified vertices a11, a

2i , a

31 and one with specified vertices a11, a

21, a

3i ,

respectively. We denote these three hypergraphs Gi,1, Gi,2 and Gi,3 respectively. Forconvenience, we also define G1,1 = G1,2 = G1,3 = G1.

Next, for all k ∈ [5] and for each edge e = xy ∈ E(G∗) with f ′(xy) = k, wecreate three copies of K4, say He

1 , He2 , H

e3 ; see Figure 2 for a picture of the construction

described below. Let V (Hei ) = {sei , t

ei , u

ei , v

ei } for i ∈ [3]. Let l(sei t

ei ) = a

(i+1)2k−1 , l(s

eiu

ei ) =

l(teivei ) = a

(i+2)2k−1 , l(u

eiv

ei ) = a

(i+1)2k and l(seiv

ei ) = l(teiu

ei ) = a

(i+2)2k for all i ∈ [3], where

superscripts are read modulo 3, so a4j = a1j and a5j = a2j for all j ∈ [10]. We also addedges xsei , yt

ei with l(xsei ) = l(ytei ) = ai2k−1, and edges xuei , yv

ei with l(xuei ) = l(yvei ) =

ai2k for all i ∈ [3].Let G = {G1}∪{Gi,j : i ∈ {2, . . . , 10}, j ∈ [3]}. Let U = (∪G′′∈GV (G

′′))\(A∪B∪C),W = ∪e∈E(G∗) ∪i∈[3] V (He

i ). Let V (G′) = A∪B ∪C ∪U ∪W ∪V (G∗) and let E(G′) bethe set of all labeled edges defined above. By the construction, the function l definedabove is a labeling of G′. Let G be the corresponding 3-uniform hypergraph of (G′, l).

Notice that from the construction, there is no other edge e ∈ E(G) with e∩ U 6= ∅and e∩(W ∪V (G∗)) 6= ∅. Furthermore, except for the edge {a11, a

21, a

31}, there is no edge

e ∈ E(G) with e ⊆ A∪B∪C∪V (G∗). Moreover, for every edge e ∈ E(G)\{a11, a21, a

31},

we have |e ∩ (A ∪ B ∪ C)| ≤ 1. Thus, for each edge e ∈ E(G) \ {a11, a21, a

31}, exactly

one of the conditions |e ∩ U | ≥ 2 and |e ∩ (W ∪ V (G∗))| = 2 holds. Moreover, for alle ∈ E(G), we have that |e ∩ V (G∗)| ≤ 1.

(1) The 3-uniform hypergraph G is linear.

We take two edges e, e′ ∈ E(G) with e 6= e′. Assume for a contradiction that|e∩e′| = 2. It follows that e, e′ 6= {a11, a

21, a

31}, since no edge except {a11, a

21, a

31} contains

more than one vertex of A ∪B ∪ C.If |e∩U | ≥ 2, then e ⊆ Ga,b for some a ∈ [10] and b ∈ [3]. Since |e∩e′| = 2, we have

that e′∩U 6= ∅, and so |e′∩U | ≥ 2. It follows that e′ ⊆ V (Gc,d) for some c ∈ [{2, . . . , 10}]and d ∈ [3]. By Lemma 7.7, (a, b) 6= (c, d). But then V (Ga,b) ∩ V (Gc,d) ⊆ {a11, a

21, a

31}

and so e ∩ e′ ⊆ {a11, a21, a

31}. But |e ∩ {a11, a

21, a

31}| ≤ 1, so |e ∩ e′| ≤ 1, which is a

contradiction.If |e∩ (W ∪ V (G∗))| = 2, then |e∩ (A∪B ∪C)| = 1. Since |e∩ e′| = 2 and exactly

one of e′ ∩ U 6= ∅ and e′ ∩ (W ∪ V (G∗)) 6= ∅ holds, we have e′ ∩ (W ∪ V (G∗)) 6= ∅. It

19

Page 20: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

follows that |e′∩ (W ∪V (G∗))| = 2. Consider the labeled graph G′. Notice that by theconstruction above, for each e∗ ∈ E(G∗), no two edges of G′[e∗ ∪ (∪i∈[3]V (H

e∗

i ))] withthe same label are incident to one common vertex. Thus e and e′ are both incident to acommon vertex x ∈ V (G∗). For every xy1, xy2 ∈ E(G∗), since f ′ is an edge coloring ofG∗, f ′(xy1) 6= f ′(xy2). Thus, for every two edges e1, e2 of G′ incident to x, |e1∩e2| = 1.Hence, we have proved |e ∩ e′| ≤ 1, which leads to a contradiction. This proves (1).

(2) We have ν(G) ≤ 532.

By Lemmas 7.7 and 7.8, for every graph G′′ = Gi,j ∈ G, there is a set SG′′ of size atmost 19 which contains aji such that G′′\SG′′ has no edges; for G1, the set SG1 containsall of a11, a

21, a

31. Each edge which is not a subset of A∪B ∪C ∪U contains a vertex in

A ∪ B ∪ C. Thus, the set X = ∪G′′∈GSG′′ meets all edges of G, and |X| ≤ 19 · 28. Soν(G) ≤ 19 · 28 = 532. This proves (2).

(3) The graph G∗ is 3-colorable if and only if G is 3-colorable.

Let c′ be a 3-coloring of G. By Lemma 7.8, c′(a11), c′(a21) and c′(a31) are all distinct.

Without loss of generality let c′(a11) = 1, c′(a21) = 2 and c′(a31) = 3. From the construc-tion, by Lemma 7.7, c′(a1i ) = 1, c′(a2i ) = 2 and c′(a3i ) = 3 for all i ∈ [10]. We want toprove that c′|V (G∗) is a 3-coloring of G∗.

Suppose for a contradiction that there exists an edge xy ∈ E(G∗) with c′(x) = c′(y).Let k = f ′(xy). Without loss of generality, let c′(x) = c′(y) = 1. Then considerthe graph Hxy

1 . Because of the edges {x, sxy1 , a12k−1}, {x, u

xy1 , a

12k}, {y, t

xy1 , a

12k−1} and

{y, vxy1 , a12k}, all of the vertices sxy1 , t

xy1 , u

xy1 , v

xy1 are colored 2 or 3. Since c′(a32k−1) = 3,

from the edge {sxy1 , uxy1 , a

32k−1}, it follows that one of the vertices sxy1 , u

xy1 is not colored

3. Without loss of generality let c′(sxy1 ) = 2. Because of the edge {sxy1 , txy1 , a

22k−1},

we have c′(txy1 ) = 3. Consider the edges {txy1 , uxy1 , a

32k} and {txy1 , v

xy1 , a

32k−1}. Since

c′(a32k) = c′(a32k−1) = 3, we have c′(uxy1 ) = c′(vxy1 ) = 2. But then the edge {uxy1 , vxy1 , a

22k}

is monochromatic, which contradicts the fact that c′ is a 3-coloring of G. This provesthat if G is 3-colorable, then so is G∗.

For the converse direction, let c be a 3-coloring of G∗. We want to define a 3-coloringd of G. Let d(v) = 1 for all v ∈ A, d(v) = 2 for all v ∈ B, and d(v) = 3 for all v ∈ C.By Lemmas 7.7 and 7.8, there is a way to extend d to G[A ∪B ∪ C ∪ U ].

Let d(v) = c(v) for all v ∈ V (G∗). For each edge xy ∈ E(G∗) and each i ∈ [3],since c is a 3-coloring of G∗, one of the vertices x, y is not colored i. If c(x) 6= i, thenfor the set V (Hxy

i ), we set d(sxyi ) = d(uxyi ) = i and d(txyi ) = d(vxyi ) = i + 1, readingcolors modulo 3 (so if this would assign color 4, we assign color 1 instead). If c(x) = i,then c(y) 6= i, and for the set V (Hxy

i ), we set d(sxyi ) = d(uxyi ) = i + 1, again readingcolors modulo 3; and d(txyi ) = d(vxyi ) = i. Thus, we have defined the function d for allvertices of G.

We then want to show that d is a 3-coloring of G. From the construction, all edgese with e∩U 6= ∅ are contained in G[A∪B ∪C ∪U ] and hence not monochromatic. Itremains to consider edges e ∈ E(G) with e ∩W 6= ∅. It follows that there is an edge

20

Page 21: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

xy ∈ E(G∗) and i ∈ [3] such that ∅ 6= e∩V (Hxyi ) = e∩W . If x ∈ e, then either sxyi ∈ e

or txyi ∈ e and from the construction of d, we have that d(e ∩ (A ∪B ∪ C)) = {i}, andeither d(x) 6= i or d(sxyi ), d(txyi ) 6= i. The case y ∈ e follows analogously. Therefore, wemay assume that |e ∩ V (Hxy

i )| = 2. Now either the two vertices in e ∩ V (Hxyi ) receive

different colors, or they receive the same color in {i, i+1} and d(e∩(A∪B∪C)) = {i+2}.Thus, the edge e is not monochromatic. This proves (3).

(4) The 3-hypergraph G can be constructed from G∗ in time O(n3), where n = |V (G∗)|.

Since |V (G1)| = O(1) and |E(G1)| = O(1), the 3-uniform hypergraph G1 can beconstructed in time O(1). Similarly, the 3-uniform hypergraph G2 can be constructedin time O(1). We create 3 · (10) − 2 = 28 copies of the gadgets G1 or G2. This stepcan be done in time O(1).

Let n = |V (G∗)|, and m = |E(G∗)|. The edge coloring f ′ of G∗ can be computedin time O(mn) ≤ O(n3) by Theorem 7.6. For each edge e ∈ E(G∗), we create 12 newvertices and 30 edges. Thus, constructing the vertex set W and all edges incident toW takes time O(n2).

x y

sxy1 txy1

uxy1 vxy1

a22k−1

a22k

a32k−1 a32k−1a32k a32k

a12k−1

a12k

a12k−1

a12k

sxy2 txy2

uxy2 vxy2

a32k−1

a32k

a12k−1 a12k−1a12k a12k

a22k−1

a22k

a22k−1

a22k

sxy3 txy3

uxy3 vxy3

a12k−1

a12k

a22k−1 a22k−1a22k a22ka32k−1

a32k

a32k−1

a32k

Figure 2: The construction of Hxy3 , Hxy

2 , Hxy1 (top to bottom) for an edge xy with

f ′(xy) = k.

21

Page 22: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

References

[1] B. Aspvall, M. F. Plass, and R. E. Tarjan. A linear-time algorithm for testingthe truth of certain quantified boolean formulas. Information Processing Letters,8(3):121–123, 1979.

[2] E. Balas and C. S. Yu. On graphs with polynomially solvable maximum-weightclique problem. Networks, 19:247–253, 1989.

[3] C. Bujtás, Z. Tuza, and V. Voloshin. Hypergraph colouring. In Topics in Chro-

matic Graph Theory, pages 230–254. Cambridge University Press, 05 2015.

[4] A. Chattopadhyay and B. A. Reed. Properly 2-colouring linear hypergraphs.In M. Charikar, K. Jansen, O. Reingold, and J. D. P. Rolim, editors, Approxi-

mation, Randomization, and Combinatorial Optimization. Algorithms and Tech-

niques, pages 395–408, Berlin, Heidelberg, 2007. Springer.

[5] M. Garey, D. Johnson, and L. Stockmeyer. Some simplified NP-complete graphproblems. Theoretical Computer Science, 1(3):237–267, 1976.

[6] M. R. Garey and D. S. Johnson. Computers and Intractability: A Guide to the

Theory of NP-Completeness. W. H. Freeman and Company, USA, 1979.

[7] P. A. Golovach, M. Johnson, D. Paulusma, and J. Song. A survey on the com-putational complexity of coloring graphs with forbidden subgraphs. Journal of

Graph Theory, 84(4):331–363, 2017.

[8] S. Hajebi. Private communication. 2020.

[9] R. M. Karp. Reducibility among combinatorial problems. In Complexity of Com-

puter Computations, pages 85–103. Springer, 1972.

[10] L. Lovász. On chromatic number of finite set-systems. Acta Mathematica

Academiae Scientiarum Hungaricae, 19:59–67, 03 1968.

[11] J. Misra and D. Gries. A constructive proof of Vizing’s theorem. Information

Processing Letters, 41(3):131–133, 1992.

[12] K. Phelps and V. Rödl. On the algorithmic complexity of coloring simple hyper-graphs and Steiner triple systems. Combinatorica, 4:79–88, 03 1984.

[13] K. Phelps and V. Rödl. On the algorithmic complexity of coloring simple hyper-graphs and steiner triple systems. Combinatorica, 4:79–88, 03 1984.

[14] F. P. Ramsey. On a problem of formal logic. Proceedings of the London Mathe-

matical Society, 2(1):264–286, 1930.

22

Page 23: University of Waterloo, Waterloo, ON N2L 3G1, Canada ...

[15] S. Tsukiyama, M. Ide, H. Ariyoshi, and I. Shirakawa. A new algorithm for gener-ating all the maximal independent sets. SIAM Journal on Computing, 6:505–517,1977.

[16] V. G. Vizing. On an estimate of the chromatic class of a p-graph. Diskret. Analiz,(3):25–30, 1964.

23