TExcelTAD
Home › Parameterized & Fine-Grained Complexity › Crown Decompositions

Crown Decompositions

Buss's kernel leaves up to O(k2)O(k^2) vertices. A linear kernel needs a rule that can remove many low-degree vertices at once, and the degree-1 rule of Bounded Search Trees for Vertex Cover points the way: a pendant vertex vv with neighbour uu lets us take uu for free. A crown is the same picture with many pendant-like vertices and many "uu"s at once.

Definition

A crown decomposition of a graph GG is a partition of its vertices into three sets CC, HH, RR such that

  1. CC (the crown) is a nonempty independent set;
  2. H=N(C)H = N(C) (the head) separates CC from RR: there are no edges between CC and RR;
  3. there is a matching between HH and CC that saturates HH: every vertex of HH is matched to its own vertex of CC.
text
        C:  o   o   o   o   o        independent, all neighbours in H
            |  /|   |  /    
        H:  #   #   #               each head vertex matched into C (the | edges)
            |\  |  /|
        R:  rest of the graph        no edges between C and R

Crown rule. If (C,H,R)(C, H, R) is a crown decomposition, replace (G,k)(G, k) by (G−C−H,  k−∣H∣)(G - C - H, \; k - \lvert H \rvert).

Safety. Some minimum cover contains HH and nothing from CC. The matching gives ∣H∣\lvert H \rvert disjoint edges inside C∪HC \cup H, so every cover uses at least ∣H∣\lvert H \rvert vertices of C∪HC \cup H. On the other hand HH alone covers every edge touching C∪HC \cup H (edges at CC go to HH, since CC is independent and N(C)=HN(C) = H). So replacing a cover's part in C∪HC \cup H by HH never makes it larger, and what remains to cover is exactly the graph G−C−H=G[R]G - C - H = G[R]. □\square

The degree-1 rule is the special case C={v}C = \{v\}, H={u}H = \{u\}.

Finding a crown: the crown lemma

Crown lemma. Let GG have no isolated vertices and at least 3k+13k + 1 vertices. Then in polynomial time one can find either a matching with more than kk edges (so the answer is NO) or a crown decomposition.

Proof (constructive). Find a maximal matching MM greedily. If ∣M∣>k\lvert M \rvert > k, answer NO. Otherwise V(M)V(M), the matched vertices, has at most 2k2k vertices, and the rest I=V∖V(M)I = V \setminus V(M) is independent (an edge inside II could extend MM) with at least k+1k + 1 vertices. Consider the bipartite graph BB between II and V(M)V(M) formed by the edges of GG between them. Compute a maximum matching M′M' of BB and, by König's theorem (Bipartite Matching and König's Theorem), a minimum vertex cover XX of BB with ∣X∣=∣M′∣\lvert X \rvert = \lvert M' \rvert.

  • If ∣M′∣>k\lvert M' \rvert > k, answer NO.
  • Otherwise ∣X∣≤k<∣I∣\lvert X \rvert \le k < \lvert I \rvert, so C=I∖XC = I \setminus X is nonempty. Every edge of BB at CC is covered by XX at its other end, so N(C)⊆X∩V(M)N(C) \subseteq X \cap V(M); let H=N(C)H = N(C). Each vertex of XX is matched by M′M' and each edge of M′M' has exactly one endpoint in XX, so each h∈Hh \in H is matched to a vertex of I∖X=CI \setminus X = C. That matching saturates HH. And C≠∅C \ne \emptyset has neighbours because GG has no isolated vertices, so H≠∅H \ne \emptyset. □\square

Theorem. Vertex cover has a kernel with at most 3k3k vertices: apply the isolated-vertex rule and the crown rule until the graph has at most 3k3k vertices or the lemma reports NO.

Each application removes at least one vertex, so there are at most nn rounds, each polynomial (Chor, Fellows and Juedes, 2004; Abu-Khzam, Fellows, Langston and Suters, 2007).

Implementation

The program finds crowns as in the proof: a greedy maximal matching, then Kuhn's augmenting paths for the bipartite matching M′M', then König's construction of XX (vertices of II not reachable from free II-vertices by alternating paths, plus the reachable ones of V(M)V(M)).

python · try it yourself
import random
from itertools import combinations

def maximal_matching(adj):
    matched = set()
    for u in sorted(adj):
        for v in sorted(adj[u]):
            if u not in matched and v not in matched:
                matched |= {u, v}
    return matched

def bipartite_cover(I, adj):
    mate = {}                                         # vertex of V(M) -> its partner in I
    def augment(u, seen):
        for v in sorted(adj[u]):
            if v not in seen:
                seen.add(v)
                if v not in mate or augment(mate[v], seen):
                    mate[v] = u
                    return True
        return False
    for u in sorted(I):
        augment(u, set())
    matched_I = set(mate.values())
    reach_I, reach_M = {u for u in I if u not in matched_I}, set()
    stack = list(reach_I)
    while stack:                                      # alternating paths from free I-vertices
        u = stack.pop()
        for v in adj[u]:
            if v not in reach_M:
                reach_M.add(v)
                w = mate.get(v)
                if w is not None and w not in reach_I:
                    reach_I.add(w); stack.append(w)
    return len(mate), (set(I) - reach_I) | reach_M    # Koenig: a minimum vertex cover

def find_crown(adj, k):
    VM = maximal_matching(adj)
    if len(VM) // 2 > k:
        return "NO"
    I = set(adj) - VM
    size, X = bipartite_cover(I, adj)
    if size > k:
        return "NO"
    C = I - X
    H = {v for c in C for v in adj[c]}
    return (C, H) if C else None

def crown_kernel(adj, k, log):
    adj = {v: set(nb) for v, nb in adj.items()}
    while True:
        adj = {v: nb for v, nb in adj.items() if nb}  # drop isolated vertices
        if len(adj) <= 3 * k:
            return adj, k
        r = find_crown(adj, k)
        if r == "NO" or r is None:
            return None, k
        C, H = r
        log.append((len(C), len(H)))
        gone = C | H
        adj = {v: nb - gone for v, nb in adj.items() if v not in gone}
        k -= len(H)

def opt(adj):
    V = sorted(adj)
    E = [(a, b) for a in V for b in adj[a] if a < b]
    for s in range(len(V) + 1):
        for S in combinations(V, s):
            if all(a in S or b in S for a, b in E):
                return s

rng = random.Random(4)
for trial in range(4):
    n = 24
    adj = {v: set() for v in range(n)}
    hubs = rng.sample(range(n), rng.randint(3, 5))    # a small cover plus a few extra edges
    for v in range(n):
        for h in rng.sample(hubs, 2):
            if v != h:
                adj[v].add(h); adj[h].add(v)
    for _ in range(rng.randint(2, 4)):
        a, b = rng.sample(range(n), 2)
        adj[a].add(b); adj[b].add(a)
    o = opt(adj)
    log = []
    K, k2 = crown_kernel(adj, o, log)
    ko = opt(K) if K is not None else None
    print(f"n = {n}, OPT = {o}: crowns (|C|,|H|) {log} -> kernel {len(K)} vertices, k' = {k2}, OPT(kernel) = {ko}")
n = 24, OPT = 5: crowns (|C|,|H|) [(14, 3)] -> kernel 4 vertices, k' = 2, OPT(kernel) = 2
n = 24, OPT = 5: crowns (|C|,|H|) [(14, 3)] -> kernel 4 vertices, k' = 2, OPT(kernel) = 2
n = 24, OPT = 6: crowns (|C|,|H|) [(13, 4)] -> kernel 5 vertices, k' = 2, OPT(kernel) = 2
n = 24, OPT = 6: crowns (|C|,|H|) [(12, 4)] -> kernel 4 vertices, k' = 2, OPT(kernel) = 2

Every kernel has at most 3k3k vertices, and in every case OPT(G)=OPT(kernel)+∑∣H∣\text{OPT}(G) = \text{OPT}(\text{kernel}) + \sum \lvert H \rvert, which is the safety of the rule checked by brute force.

In C++

The crown search in C++ on a graph with 40 vertices and a planted cover of size 5. It prints the maximal matching size, the bipartite matching size, and the crown found.

cpp · try it yourself
#include <cstdio>
#include <functional>
#include <set>
#include <vector>

int main() {
    const int n = 40, k = 5;
    std::vector<std::set<int>> adj(n);
    unsigned s = 8;
    auto rnd = [&](int m) { s = s * 1103515245u + 12345u; return int((s >> 8) % m); };
    for (int v = k; v < n; v++) {                   // every edge touches the cover {0, ..., 4}
        int h = rnd(k);
        adj[v].insert(h); adj[h].insert(v);
    }
    adj[0].insert(1); adj[1].insert(0);
    std::vector<bool> inM(n, false);
    int msize = 0;
    for (int u = 0; u < n; u++)
        for (int v : adj[u])
            if (!inM[u] && !inM[v]) { inM[u] = inM[v] = true; msize++; }
    std::printf("maximal matching: %d edges\n", msize);
    std::vector<int> mate(n, -1);                   // mate[v] for v in V(M): its partner in I
    std::vector<bool> seen;
    std::function<bool(int)> augment = [&](int u) {
        for (int v : adj[u])
            if (inM[v] && !seen[v]) {
                seen[v] = true;
                if (mate[v] < 0 || augment(mate[v])) { mate[v] = u; return true; }
            }
        return false;
    };
    int bsize = 0;
    std::vector<bool> matchedI(n, false);
    for (int u = 0; u < n; u++)
        if (!inM[u]) { seen.assign(n, false); if (augment(u)) bsize++; }
    for (int v = 0; v < n; v++) if (mate[v] >= 0) matchedI[mate[v]] = true;
    std::printf("bipartite matching I - V(M): %d edges\n", bsize);
    std::vector<bool> rI(n, false), rM(n, false);
    std::vector<int> st;
    for (int u = 0; u < n; u++) if (!inM[u] && !matchedI[u]) { rI[u] = true; st.push_back(u); }
    while (!st.empty()) {
        int u = st.back(); st.pop_back();
        for (int v : adj[u])
            if (inM[v] && !rM[v]) {
                rM[v] = true;
                int w = mate[v];
                if (w >= 0 && !rI[w]) { rI[w] = true; st.push_back(w); }
            }
    }
    std::set<int> C, H;
    for (int u = 0; u < n; u++) if (!inM[u] && rI[u]) C.insert(u);   // I minus the cover X
    for (int c : C) for (int v : adj[c]) H.insert(v);
    std::printf("crown |C| = %zu, head H =", C.size());
    for (int h : H) std::printf(" %d", h);
    std::printf("\nremove C and H, k drops from %d to %d\n", k, k - (int)H.size());
}
maximal matching: 4 edges
bipartite matching I - V(M): 5 edges
crown |C| = 32, head H = 0 1 2 3 4
remove C and H, k drops from 5 to 0

Crowns and linear programming

The crown rule is closely tied to the LP relaxation of vertex cover. An optimal half-integral LP solution (values 00, 12\frac{1}{2}, 11) has its 0-vertices independent with all neighbours at value 1, and that pair of sets behaves like a crown. The next lesson, The Nemhauser-Trotter LP Kernel, uses this to get a kernel with 2k2k vertices. Whether vertex cover has a kernel with (2−ε)k(2 - \varepsilon)k vertices is open; a kernel with O(k2−ε)O(k^{2-\varepsilon}) edges is ruled out unless coNP ⊆\subseteq NP/poly (Dell and van Melkebeek, 2010).

Test yourself

Which condition is NOT part of a crown decomposition (C,H,R)(C, H, R)?

  1. CC is independent
  2. There are no edges between CC and RR
  3. There is a matching from HH into CC saturating HH
  4. HH is independent

Why is taking all of HH into the cover safe?

  1. Because HH has the highest degrees
  2. Because the matching forces at least ∣H∣\lvert H \rvert cover vertices in C∪HC \cup H, and HH alone covers every edge touching C∪HC \cup H
  3. Because CC is empty
  4. Because RR is independent

What does the crown lemma guarantee for a graph without isolated vertices and with at least 3k+13k + 1 vertices?

  1. A cover of size kk
  2. Either a matching with more than kk edges, so the answer is NO, or a crown decomposition found in polynomial time
  3. A clique of size kk
  4. A kernel with k2k^2 edges