Clique (graph theory) Created 2026-10-14 Updated 2026-10-14
A clique in a simple graph is a set of vertices such that every pair of distinct members is adjacent. Equivalently, its induced subgraph is a complete graph. The surrounding graph need not itself be complete: a clique describes complete pairwise connectivity within a selected group.
Consider the original graph with
The set is a clique because all three pairs are edges. The set is not a clique: the edge is missing. A path in a graph connecting all selected vertices is therefore insufficient; every pair must have a direct edge.
Figure 1.
A maximum clique and a smaller maximal clique in the same graph
. Left: the three highlighted vertices form the unique maximum clique. Right: the edge gives a maximal clique of size two, because no outside vertex is adjacent to both endpoints. Both panels use the same original graph; highlighted vertices and edges select different cliques. Details.
Here the clique number is . The maximum clique is , but and are also maximal cliques. This distinction is useful when an algorithm stops as soon as its current clique cannot be enlarged: that stopping condition establishes maximality, while finding the largest possible clique is a separate requirement.
The University of Oxford computer science finals examination dated Wednesday 3 June 2015, Trinity Term 2015. The four-page original has three questions, on computability theory, time complexity and logarithmic space. The public examination-paper archive supplied by the University of Oxford contains it as 2015-complex.pdf. Questions 2 and 3 are marked corrected. Question 3(e) uses the word path in a graph without specifying whether repeated vertices are permitted; the even-length directed reachability proof uses directed walks with length counted with multiplicity.
Edge cutset Created 2026-10-05 Updated 2026-10-31
An edge cutset separating two vertices is a set of edges whose removal leaves no path in a graph between those vertices. For a vertex set containing exactly one of the two vertices, its edge boundary is such a cutset.
Decide whether a finite directed graph has an even-length directed walk from a specified source to a specified target . Vertices may repeat and a zero-length walk is allowed. The NL-completeness proof uses the graph of pairs with tracking integer parity: every original edge flips , and acceptance means reaching from . At most steps are needed in the parity graph. For hardness, subdivide every edge of an ordinary reachability instance into two directed edges. Both constructions are computable by logspace transducers. Requiring a simple path in a graph in the original graph changes the question; deleting an odd closed portion need not preserve integer parity.
Hamiltonian path Created 2026-10-07 Updated 2026-10-25
A Hamiltonian path is a path in a graph that visits every graph vertex exactly once. Removing any edge from a Hamilton cycle produces a Hamiltonian path. Conversely, a Hamiltonian path closes to a Hamilton cycle exactly when its endpoints are joined by an edge.
Directed reachability is NL-complete under logspace many-one reductions. For membership, let be the number of vertices. Store a current vertex, initially , and a counter initially zero. Accept immediately if the current vertex is . Otherwise guess a next vertex, verify by scanning the input that the appropriate directed edge exists, move there and increment the counter. Reject a branch that has made steps without reaching .
Whenever a directed walk reaches , removing closed portions between repeated vertices produces a path in a graph with at most edges. Thus this bound preserves all yes-instances. The current and guessed vertices and the counter use bits, while adjacency checks only need repeated read-only input scans. All branches halt, so directed reachability belongs to NL.
For hardness, let and fix a Nondeterministic Turing machine accepting in work space. On input , construct its configuration graph . A vertex is a possible Turing machine configuration within the fixed work-space bound. Put a directed edge exactly when one legal transition of on changes into . Take the initial Turing machine configuration as source, and add a fresh target with an incoming edge from every accepting Turing machine configuration. Then
There are only a polynomial number of Turing machine configurations, by the count used in part (c). More importantly, their encodings have length . A logspace transducer can enumerate candidate encodings and pairs of candidate encodings with bits of counters. For each pair, it checks the finite transition rule, the scanned input symbol and the local work-tape change using work space. It emits the corresponding adjacency matrix entry or edge-list record. Invalid candidate encodings may be discarded or represented by isolated vertices.
The configuration graph is thus output by a logspace transducer, rather than stored in its work tapes. This supplies the required logspace many-one reduction from every and proves NL-completeness.
The printed question calls the route a path in a graph and writes , without specifying whether repeated vertices are allowed.[ref] Use the computational reachability convention that a permitted route is a directed walk: repeated vertices are allowed and length counts traversed edges with multiplicity. This matters for the integer parity restriction, because deleting a closed portion of odd length can change the integer parity. The proof below establishes the stated NL-completeness for this convention; it does not establish that claim for a simple path in a graph.
For membership of even-length directed reachability in NL, form the conceptual parity graph with vertex set
and directed edges
After a directed walk of length from , the second coordinate equals . Therefore there is an even-length directed walk from to in exactly when is reachable from in this parity graph. It has vertices. Guess successive edges while storing the original current vertex, one parity bit, and a counter bounded by . If the target pair is reachable, it has a simple path in a graph in this enlarged graph of at most edges. This is an NL procedure; the parity graph need not be materialized.
For NL-hardness, reduce directed reachability by subdividing each directed edge with its own new vertex :
Retain as the endpoints and add no other edges. Every original directed walk of length becomes a directed walk of even length . Conversely, a directed walk between original vertices in the new graph must alternate original and subdivision vertices. Compressing each two-edge segment recovers a directed walk in . Hence
A logspace transducer enumerates the original edges, labels each new vertex by its edge endpoints or its position in the input, and emits its two replacement edges. All labels and counters take bits, and the output is of polynomial size. Thus this is a logspace many-one reduction, proving
As in ordinary reachability, a zero-length directed walk is permitted, so is an immediate yes-instance. Both the membership procedure and the subdivision many-one reduction preserve that case.
For the Johnson graph, an edge exchanges one member of a -set. Along one edge, intersection size with a fixed target can increase by at most one, so any path in a graph from to has length at least . Replacing the elements of successively by elements of gives a path in a graph attaining that bound. Hence the distance in a Johnson graph is
If two ordered pairs have the same distance , their four regions (intersection, first-only, second-only and outside the union) have sizes . Choose bijections between corresponding regions. Their union is a ground-set permutation sending the ordered pair to the other pair and preserving graph adjacency. The symmetric group is distance-transitive. For the graph diameter is .
For the Grassmann graph, a codimension-one exchange changes intersection dimension with a fixed target by at most one. More explicitly, if are adjacent, their common -space shows , and exchanging the two gives the reverse bound. Thus distance is at least .
Choose a basis of , complement it in by , and in by . These combined vectors are independent because . The spaces
form a path in a graph of length . Consequently
Equal-distance ordered pairs have the same dimensions in this adapted basis construction. Extend both combined bases to bases of , and match them by a invertible linear map. It maps the first ordered pair to the second and preserves dimensions of intersections, hence graph adjacency. is distance-transitive, over an arbitrary field, with graph diameter under .
For the symplectic dual polar graph, vertices are Lagrangian -spaces. Let have dimension . The quotient is a nonsingular symplectic vector space of dimension , and are complementary Lagrangian subspaces. Their mutual pairing is nonsingular: a vector orthogonal to both lies in , so vanishes in the quotient. Choose dual bases in and in , and lift them into . Their span is a nonsingular symplectic -space. Complete it by a basis of and suitable dual partners. This gives the pair normal form
The spaces remain totally isotropic subspace: a present pairs only with the absent . They give an adjacent-step path in a graph of length . The previous intersection-dimension lower bound still applies, proving
For two ordered pairs at the same distance, match their adapted symplectic bases. The resulting map preserves the alternating bilinear form and sends the pairs to each other, so lies in . Equivalently, construct the isometry of a space with a form on from the displayed normal form and extend it by Witt's lemma. The action of the symplectic group over a field is distance-transitive, over every field, and its graph has graph diameter . The zero-dimensional boundary cases give a single vertex and trivial transitivity.
Let be the transition matrix of a finite irreducible Markov chain with at least two states, reversible with stationary distribution . Its Dirichlet form of a Markov chain is
The Discrete Poincare inequality states that for every real . Its optimal constant is , where is the second largest eigenvalue of . Indeed, detailed balance makes self-adjoint on . Expand in an orthonormal eigenbasis. Then and , proving the inequality and its sharpness.
The useful constructive version is the canonical paths Poincare bound. Choose transition graph paths between each ordered pair, write , and define
where counts occurrences of the directed transition. The Cauchy-Schwarz inequality along each path in a graph gives . Multiply by and sum. The identity proves .
For a lazy Markov chain this also proves the mixing time estimate
To see this, the centred initial density has norm at most ; laziness puts all nonconstant eigenvalues between zero and . Their powers contract that norm, and the Cauchy-Schwarz inequality bounds total variation distance by half the density's norm.
Here is a precise sufficient density condition for the permanent application: every row and every column has more than ones. Interpret the permanent of a matrix as the number of perfect matchings in its bipartite graph, with vertices per side. Write for the number of -edge matchings in a graph.
First prove the short augmenting paths in a dense bipartite graph bound. Given a nonperfect matching in a graph, choose unmatched on opposite sides. If either has an unmatched neighbour, augment with one edge. Otherwise the matched partners of and the neighbours are subsets of the same -element side whose total size exceeds . Their intersection gives an alternating path in a graph of length three, with a matching edge. Repeating proves . Choose augmentations by a fixed deterministic rule. A reverse augmentation is specified by at most four vertices, so a next-size matching in a graph has at most preimages. Therefore
Use the matching generating function and the weighted matching Markov chain on all matchings in a graph, with stationary weights . It stays put with probability ; otherwise it chooses a graph edge uniformly and proposes its deletion, its addition if both endpoints are unmatched, or its exchange for the unique incident matching edge if precisely one endpoint is matched. Other proposals stay put. Accept with probability . Reverse proposals use the opposite exchanged edge, so detailed balance holds. Deletions connect every state to the empty matching in a graph.
For completeness, the canonical paths for the weighted matching chain give a polynomial bound without assuming a mixing theorem. The symmetric difference consists of alternating graph paths and graph cycles. Order its components deterministically, orient open components from their smaller endpoint, and convert them from to by moving an unmatched endpoint with exchanges. If the first edge belongs to , delete it first. For a graph cycle, delete one -edge, move the unmatched endpoint around the opened cycle, then insert the last -edge. Each intermediate state is a matching in a graph, and each entire transition path in a graph has length at most .
Fix a directed transition with initial state . The complementary edge set agrees with one of the two matchings in a graph outside the active component and has at most two degree-two vertices on that component. Remove at most two offending edges to obtain a matching in a graph . Store those edges and one bit specifying the initial alternating colour of the active component. This encoding is injective for the fixed transition: it restores and , identifies the active component from the changed edges, and recovers the two colours using the fixed component order. Completed components have 's colour in , pending components have 's colour, and the stored bit resolves the active component. Common edges are .
There are at most auxiliary records per , where is the number of graph edges. If , then
Also . Sum over the encodings and use the path length bound to obtain
This is polynomial whenever and are polynomially bounded. Starting at the empty matching in a graph, , so the Discrete Poincare inequality gives polynomial-time sampling to any prescribed total variation distance. The addition/deletion/exchange construction is also described in Section 12.4 of Jerrum and Sinclair's survey.
It remains to turn sampling into a relative count; merely sampling perfect matchings would not do that. For , choose and . The elementary bounds above give
Choose a schedule whose successive ratios are at most . It has stages. The annealing ratios for a matching generating function satisfy
Each observable lies in , so the Hoeffding inequality gives relative accuracy with independent samples per stage. Run independent copies of the chain from the empty matching in a graph; make the total variation distance per sample at most , where is that sample count. The coupling characterization of total variation distance and the union bound make the entire sample collection coincide with exact stationary samples except with probability at most . Choose the sample-count constant so all stationary sample means are accurate except with probability at most .
Let be the product of the sample means, and output . On the successful event its multiplicative error relative to lies between and . Combining the two endpoint bounds proves
Activities, sample counts, simulation lengths and rational bit lengths are polynomial in . Thus this is a fully polynomial randomized approximation scheme. Small dimensions can be evaluated directly.
We use the uniqueness of the infinite percolation cluster on : for , there is almost surely exactly one infinite percolation cluster, denoted . Fix and let . Two observations account for the possible distinct endpoints of the face connections.
First, the probability that some finite percolation cluster meeting reaches tends to zero as . There are only finitely many vertices in , and each of their finite percolation clusters has finite radius; apply the union bound and continuity from above of a measure.
Second, all vertices of are joined to one another inside with probability tending to one. On each configuration, this is a finite set of vertices of one connected percolation cluster. Choose a finite open path in a graph from one such vertex to each of the others; the union of these finitely many paths is contained in some finite box. The assertion is vacuous if the set is empty.
By part (b.ii), each of the two face-connection events within fails with probability at most . Outside the two exceptional events just described, their endpoints in belong to and can be joined inside . Concatenating the left-face path, that joining path, and the right-face path produces a crossing of . Consequently
Now let . Since ,
The order of limits matters: is fixed while the finitely many relevant percolation clusters are connected inside increasingly large boxes.
For each of the coordinate faces of , define the increasing event that an open path in a graph lying in joins to . Their union is exactly the event of connection from to within . The bond percolation law and the centered boxes are invariant under coordinate permutations and sign changes, so all events have the same probability.
Apply the square-root trick for positively associated events from part (a), with in place of the number of events. If , part (b.i) gives, for every ,
In particular this holds for the left and right faces, and it proves the stronger statement in which each connecting path in a graph stays inside the outer box.
Put , the union of all infinite percolation clusters. Since , the percolation probability is positive. The translation ergodicity of Bernoulli percolation makes a zero-one event; it has positive probability because , hence it occurs almost surely.
Let . These events increase to , so continuity from below of a measure gives . On , some vertex of has an infinite open path in a graph. For every , the segment up to its first visit to lies entirely in . Thus even with this restriction on the connecting path in a graph,
This proves the requested uniformity and supplies the version needed for crossings later.
For , let be the set of vertices of connected to by an open path in a graph using only edges of . Every infinite-cluster vertex of belongs to , by stopping an infinite open path in a graph at its first boundary visit. Hence the increasing event
has probability at least by part (a). Importantly, depends only on the edges with both endpoints in .
Open all perimeter edges joining successive vertices of . They form a cycle in a graph, and opening them joins every vertex of into one percolation cluster, containing the specified perimeter vertex . The Harris-FKG inequality bounds the probability of this event together with below by .
Close all edges in the edge boundary of . These edges are distinct from the internal edges already considered, so their states are independent of those events. The resulting percolation cluster of is finite, contained in , and has at least vertices. Therefore, by translating to the origin,
For , choose . Then the threshold is at least , and . Put and ; both are positive. The preceding lower bound is at least with, for example,
The construction modifies only order- boundary edges while trapping order- vertices, which explains the stretched exponential scale. Here is interpreted as the positive integers; the proposed lower bound at would be false because .
The Thomson principle states that the effective resistance is the minimum energy of a flow among all unit flows from to :
The flow is antisymmetric on oriented edges, and the sum counts each unoriented edge once. The Rayleigh monotonicity principle states that increasing edge resistances, including deleting edges by setting their resistance to infinity, cannot decrease the effective resistance. Decreasing resistances or identifying vertices cannot increase it.
Take a shortest path in a graph from to , of length , and send one unit of flow along it, with zero flow on all other edges. Its energy of a flow is because each edge resistance is one. The Thomson principle gives
Alternatively, delete all edges outside that path and use the Rayleigh monotonicity principle; the remaining edges are in series, with total resistance . When , both quantities are zero.
Let
be a longest path in . Every neighbour of either endpoint lies on . Suppose . Among the possible cut positions of the path, the sets
have total size greater than , so they intersect. The corresponding two edges close a cycle containing all vertices of .
If , connectivity supplies an edge from a vertex outside this cycle to a vertex on it. Breaking the cycle there and adjoining the outside vertex creates a path longer than , a contradiction. Hence
Since and , the long path from minimum degree gives . Thus contains .
Colour the vertices of in groups of size . Colour edges within groups blue and edges between groups red. The red graph is complete -partite, so it has no red . Every blue component has only vertices, so it has no path of length . Therefore
Let
be the terminal set, and let be the vertex set of the given complete graph . Any vertex set meeting every - path has size at least : if , choose and . Since is -connected, is connected, so it contains a - path avoiding , a contradiction.
The Set version of Menger theorem therefore gives pairwise vertex-disjoint - paths. Truncate them at their first and last vertices in . Since both sets have vertices, every terminal is the endpoint of one path and the other endpoints are distinct vertices of . Denote the path from a terminal to its clique endpoint by , and call that endpoint .
For each , the clique contains the edge . Concatenating
gives an - path in a graph. The linkage paths are mutually vertex-disjoint, their clique endpoints are all distinct, and the joining clique edges pair those endpoints without introducing a new vertex. The resulting paths are therefore mutually vertex-disjoint. In particular, under the stated clique hypothesis, the -connected graph is -linked for these terminals.
Write ; because , as . Every path in a graph of length contains, by a greedy selection, at least vertices at mutual graph distance greater than two, where . The corresponding field values are jointly independent by part (a). Hence the probability that a fixed path lies in the superlevel set is at most
There are at most length- paths from the origin. The union bound therefore gives
Choose a finite for which and let . There is then no unbounded component through the origin, and translation invariance rules out an unbounded component anywhere almost surely. Thus the critical threshold for level-set percolation satisfies .
Choose a spanning tree of the finite connected graph . It contains every vertex of and has edges by part (i). Collapsing to a point is a homotopy equivalence: is a contractible subcomplex, and collapsing a contractible cofibration in a CW complex preserves homotopy type.
Every edge outside then becomes a circle attached to the common point. Hence the quotient space is a bouquet of circles with
petals. The fundamental group of a bouquet of circles is the free group with one member of a free basis of a group for each petal. Therefore the rank of the fundamental group of a finite connected graph is
More concretely, choose a vertex as base point; follow the unique path in a graph in to one end of a non-tree edge, traverse it, and return through . These based loops give the free basis of a group. Thus is the number of free group generators, equivalently the minimum size of a generating set of a group, rather than the size of every possible redundant generating set of a group. Minimality also follows by abelianization, since has abelianization .
A finite tree is a nonempty connected graph with no graph cycles. We show by mathematical induction on its number of vertices that it has edges. For there are no edges, so the assertion holds.
If , take a path in a graph of maximal length among those without repeated vertices. Each endpoint is a leaf of a tree: an additional incident edge would either extend the path in a graph or create a graph cycle. Delete one such leaf of a tree and its unique incident edge. The remaining graph stays connected, since a path in a graph between remaining vertices never needs that terminal edge, and it has no graph cycles. It is therefore a tree with vertices and, by mathematical induction, edges. Restoring the deleted edge gives .
Thus its Euler characteristic is