How this calculation works
Find a minimum collection of possibly overlapping cliques that covers every edge of a simple graph.
min |C| subject to every edge belonging to at least one complete vertex subset in C.A worked example
The two triangles 0,1,2 and 2,3,4 cover all six default edges with two cliques; one clique cannot cover the missing cross connections.
Good to know
Simple undirected graph on 1–12 vertices and at most 24 edges. Exact maximal-clique set-cover search,1,000,000 partial-state cap; overlapping cliques allowed, isolated vertices require no covering clique. Exhaustion means unresolved.
Reference: Marx: edge clique cover problem definition (opens in a new tab) ↗
Cover edges rather than partition vertices
An edge clique cover is a collection of complete vertex subsets whose internal edges together contain every input edge. A vertex may belong to several selected cliques. That overlap is allowed and often necessary, so the task differs from partitioning the vertices into mutually disjoint complete classes.
The distinction also affects isolated vertices. An isolated vertex has no edge to cover and therefore does not force an additional singleton clique. The answer for an edgeless graph is zero, even when the declared vertex universe contains many named or isolated locations.
Compare this with the Minimum clique partition calculator with vertex classes. Cover every edge with the fewest cliques that may overlap; vertex partitioning neither requires edge coverage nor permits overlapping classes.
Entering the graph accurately
Declare the full vertex count, then enter one unordered pair of zero-based labels per edge. Include vertices that have no incident pair. The input is a simple undirected graph: loops, duplicate unordered pairs, parallel edge identities and weights do not belong to this particular mathematical model.
An absent edge is a restriction, not an unknown observation. A selected clique must contain every pairwise adjacency among its vertices in the supplied graph. The calculator never fills missing edges to make a promising larger class complete; that would be a graph-editing problem with a different objective.
Two triangles sharing a vertex
The default graph consists of triangles on vertices zero, one, two and on vertices two, three, four. Each triangle covers its three edges, and vertex two participates in both classes. Together they cover all six edges using two complete subsets without adding any connection.
One clique is impossible because that would need to contain the endpoints of all six edges. It would then include vertices from both triangles that are not adjacent, such as zero and three. This example shows why an overlapping edge cover can be small even when the whole graph is far from complete.
Why maximal cliques suffice
Any clique in a cover can be enlarged to a maximal clique without uncovering an edge or increasing the number of selected cliques. An optimum therefore exists among maximal cliques. The implementation enumerates those candidates first, preserving their vertex memberships and the exact edge sets they cover.
The remaining problem is finite set cover on the graph's edge universe. At each search node an uncovered edge is selected and only candidate cliques containing that edge are considered. A current best complete cover supplies an upper bound, while memoized covered-edge states avoid repeating an inferior partial selection.
Reading the coverage witness
The headline gives the smallest completed clique count. The clique list identifies one optimum, and the edge table assigns every original edge to a selected clique that contains both endpoints. Different optima can assign some edges to multiple classes; the displayed assignment chooses one covering witness per edge.
Coverage alone proves feasibility, not minimality. Minimality follows from the completed bounded search and its sound pruning. A partial list that happens to cover everything remains only an upper bound if computation stops before excluding smaller covers. The resource-cap error deliberately does not present such an upper bound as a certified minimum.
Bounds and combinatorial cost
The number of maximal cliques can grow exponentially, and a small graph can still require a substantial exact search. This page limits vertices, edges and visited search states. The limits keep edge masks and witness tables finite; they are not a theorem that larger graphs lack a cover.
Every finite simple graph has an edge clique cover because each edge is itself a two-vertex clique. A failed resource check therefore means the optimum is unresolved within this implementation, not that the graph is infeasible. For large instances, dedicated exact or approximate covering software is more appropriate.
Useful independent checks
For a complete graph containing an edge, one clique suffices. For a triangle-free graph, no clique contains more than one edge, so the minimum equals the number of edges. Disconnected components with edges can be checked separately because no clique can span their missing cross adjacencies.
Use these identities alongside the returned edge table when comparing another program. Check that it solves edge clique cover rather than vertex clique partition, edge partition or ordinary edge cover. Those familiar names refer to different feasible sets and can legitimately produce completely different numbers for the same drawing.
A few questions, answered
May selected cliques overlap?
Yes. Edge clique cover permits shared vertices and shared covered edges.
Does an isolated vertex need a clique?
No. It contributes no edge to the covering universe.
Are missing edges inserted?
No. Every selected vertex subset must already be complete in the supplied graph.
Does a resource cap mean no cover exists?
No. Every simple graph can be covered by its edges; the cap leaves only the optimum unresolved.