-
Notifications
You must be signed in to change notification settings - Fork 3
[Model] MinimumCoveringByCliques #836
Description
Motivation
COVERING BY CLIQUES (P28) from Garey & Johnson, A1.1 GT17. A classical NP-hard problem useful for reductions. The edge clique cover number is a fundamental graph invariant equivalent to the intersection number, connecting this problem to intersection graph theory.
Associated rules:
- [Rule] PARTITION INTO CLIQUES to MinimumCoveringByCliques #889: PartitionIntoCliques → MinimumCoveringByCliques
- [Rule] COVERING BY CLIQUES to MinimumIntersectionGraphBasis #848: MinimumCoveringByCliques → MinimumIntersectionGraphBasis
Definition
Name: MinimumCoveringByCliques
Reference: Garey & Johnson, Computers and Intractability, A1.1 GT17
Mathematical definition:
INSTANCE: Graph G = (V,E).
OBJECTIVE: Find the minimum number of subsets V_1, V_2, ..., V_k of V such that each V_i induces a complete subgraph (clique) of G and such that for each edge {u,v} ∈ E there is some V_i that contains both u and v.
The objective value is Min(k), the minimum number of cliques needed to cover all edges.
Variables
- Count: |E| (one per edge)
- Per-variable domain: {0, 1, ..., |E|-1} (index of the clique covering that edge; upper bound since at most |E| cliques are ever needed)
- Meaning: Variable i indicates which clique covers edge i. The assignment is valid if every edge is assigned to a clique such that all edges assigned to the same clique index form a subset of edges within some clique in G. The objective minimizes the number of distinct clique indices used.
Schema (data type)
Type name: MinimumCoveringByCliques
Variants: (SimpleGraph, One) — unweighted, simple graph input
| Field | Type | Description |
|---|---|---|
graph |
SimpleGraph |
The input graph G = (V, E) |
Notes:
- This is an optimization problem:
Value = Min<usize>. - Key getter methods:
num_vertices()(= |V|),num_edges()(= |E|).
Complexity
- Decision complexity: NP-hard (Kou, Stockmeyer, and Wong, 1978; Orlin, 1976). Transformation from PARTITION INTO CLIQUES. NP-hard even for planar graphs and graphs with maximum degree 6.
- Best known exact algorithm: FPT parameterized by solution size k with a kernel of at most 2^k vertices, yielding 2^(2^O(k)) · n^O(1) time. Double-exponential dependence on k is necessary assuming ETH (Cygan et al., 2016). Brute-force: O(k^|E|) time.
- Concrete complexity expression:
"num_edges^num_edges"(fordeclare_variants!; brute-force bound with k ≤ |E|) - References:
- L.T. Kou, L.J. Stockmeyer, C.K. Wong (1978). "Covering Edges by Cliques with Regard to Keyword Conflicts among in a File." Comm. ACM 21(2), pp. 135-139.
- M. Cygan, M. Pilipczuk, M. Pilipczuk (2016). "Known Algorithms on Graphs of Bounded Treewidth Are Probably Optimal." ACM Trans. Algorithms 12(2), Article 21.
Extra Remark
Full book text:
INSTANCE: Graph G = (V,E), positive integer K ≤ |E|.
QUESTION: Are there k ≤ K subsets V_1, V_2, . . . , V_k of V such that each V_i induces a complete subgraph of G and such that for each edge {u,v} ∈ E there is some V_i that contains both u and v?
Reference: [Kou, Stockmeyer, and Wong, 1978], [Orlin, 1976]. Transformation from PARTITION INTO CLIQUES.
How to solve
- It can be solved by (existing) bruteforce. (Enumerate all possible clique covers; return the one with the fewest cliques.)
- It can be solved by reducing to integer programming. (Binary variables x_C for each maximal clique C; constraint that each edge is covered by at least one selected clique; minimize Σ x_C. Companion rule issue to be filed separately.)
- Other: (TBD)
Example Instance
Input:
Graph G with 6 vertices {0, 1, 2, 3, 4, 5} and 9 edges:
Edges: {0,1}, {1,2}, {2,3}, {3,0}, {0,2}, {4,0}, {4,1}, {5,2}, {5,3}
Optimal clique cover (4 cliques):
- C_1 = {0, 1, 2}: covers {0,1}, {1,2}, {0,2}
- C_2 = {0, 2, 3}: covers {2,3}, {3,0}
- C_3 = {0, 1, 4}: covers {4,0}, {4,1}
- C_4 = {2, 3, 5}: covers {5,2}, {5,3}
All 9 edges covered. Optimal value: Min(4).
No 3-clique cover exists (verified by exhaustive search over all 13 cliques of size ≥ 2). The minimum is tight.
Suboptimal cover (5 cliques): Replace C_1 with two smaller cliques: {0,1} and {1,2} and {0,2}. This uses 6 cliques — suboptimal.
Python validation script
from itertools import combinations
edges = [(0,1),(1,2),(2,3),(3,0),(0,2),(4,0),(4,1),(5,2),(5,3)]
edge_set = set(edges) | set((b,a) for a,b in edges)
edges_norm = set((min(a,b), max(a,b)) for a,b in edges)
# Verify 4-clique cover
cliques = [{0,1,2}, {0,2,3}, {0,1,4}, {2,3,5}]
covered = set()
for c in cliques:
members = list(c)
for a in range(len(members)):
for b in range(a+1, len(members)):
assert (members[a], members[b]) in edge_set
covered.add((min(members[a],members[b]), max(members[a],members[b])))
assert covered == edges_norm
print("4-clique cover verified")
# Verify no 3-clique cover exists
all_cliques = []
for size in range(2, 7):
for combo in combinations(range(6), size):
s = set(combo)
if all((a,b) in edge_set for a in s for b in s if a != b):
all_cliques.append(s)
found_3 = any(
set().union(*(
{(min(a,b),max(a,b)) for a in all_cliques[i] for b in all_cliques[i] if a<b}
for i in c3)) == edges_norm
for c3 in combinations(range(len(all_cliques)), 3)
)
assert not found_3
print("No 3-cover exists. Minimum is 4.")Metadata
Metadata
Assignees
Labels
Type
Projects
Status