Write and . Suppose each vertex identifier, list descriptor, link and optional edge weight occupies a constant number of machine words, and indexed array access and identifier comparison take constant time. There are list descriptors and directed, or undirected, neighbour entries. Hence adjacency lists use machine words in Big O notation. A full adjacency matrix has entries, regardless of . These are counts under a storage model, not fixed byte sizes.[ref]
Our undirected example has six list descriptors and fourteen neighbour entries, versus thirty-six full adjacency matrix entries. The numbers and count different kinds of logical items: they do not prove a particular byte saving. A linked list also needs links; an array may have unused capacity. Storing only half of a symmetric matrix changes its exact count while leaving quadratic growth. If identifiers or weights require growing numbers of machine words, their size must be included in the space complexity.
Figure 1.
Adjacency matrix storage and queries compared with adjacency lists on the same six-vertex graph
. Details.
An unsorted adjacency list answers "does the edge exist?" by linear search through . In the worst case it inspects all entries, giving time, or for . Even if is absent, an uninspected entry could still contain it, so arbitrary lists require the whole scan. On our example, looking for in 's list compares with and fails after three comparisons. A full adjacency matrix instead answers from its single entry in time.[ref]
Different promises change the query. A sorted array of neighbour identifiers permits binary search in time, but maintaining order after insertion may require shifting entries. A per-vertex hash table permits expected constant-time membership under the hashing and load assumptions of that data structure; it does not give that guarantee to an arbitrary adjacency list. A stored list length can likewise make a vertex degree query constant-time even though neighbour enumeration still has to visit its entries.
The advantage grows with scale. For a graph path on vertices, , so there are undirected neighbour entries and descriptors, versus full adjacency matrix entries. Such a family is a sparse graph with . For a complete graph, , so the undirected neighbour entries already number : the adjacency list advantage in growth rate disappears. Choose by the workload: following existing edges favours adjacency lists; many arbitrary pair-membership queries can favour a full adjacency matrix. The representation organizes the same graph for different questions.
Balanced complete multipartite blow-up Created 2026-10-05 Updated 2026-10-07
The balanced complete multipartite blow-up replaces each vertex of the complete graph by an independent set of vertices, placing every possible edge between different sets and none inside a set. Every fixed graph of chromatic number at most embeds into for sufficiently large .
Branch set of a graph minor Created 2026-10-05 Updated 2026-10-14
A branch set of a graph minor is the connected region representing one target vertex. For finite simple graphs and , a witness to assigns a nonempty set to each , such that the sets are pairwise disjoint, each induced subgraph is a connected graph, and every has a witnessing edge of between and . Extra edges between branch sets of a graph minor are allowed: they can be deleted. Unused vertices are also allowed.[ref]
Figure 1.
Connected branch sets of a graph minor and their witnessing edges, with an optional edge deletion
. Details.
In the diagram, the host graph has vertex set and edges
Choose , , and . Their internal edges establish connectedness. The edges witness , respectively, so they form a model of the complete graph . The additional edge also joins to ; it supplies another witness for the same target edge, not a fourth target edge. Contracting and merging duplicate edges gives exactly .
The same branch sets of a graph minor also witness the path graph : retain the witnesses , and delete to remove the unwanted adjacency. This demonstrates why the definition requires an edge for every target adjacency, without forbidding other adjacencies in the host graph. For a complete graph , there are no unwanted pairs: its model consists of disjoint connected branch sets of a graph minor with an edge between every pair.
To turn a model into an operation sequence, keep a spanning tree inside each , keep one witnessing edge for each edge of , and delete all other edges and unused vertices. Contract each chosen spanning tree to one vertex. Disjointness prevents two target vertices from merging; connectedness provides the edge contractions that merge each individual region. Conversely, track the original vertices merged into every surviving vertex during a deletion-and-edge contraction sequence. They form disjoint connected branch sets of a graph minor, and each surviving edge comes from an original edge between its two regions. A list of these regions, their connecting trees, and their witnessing edges therefore gives a directly checkable certificate.
Cayley's formula 2026-10-14
For an integer , let be the set of labelled trees with fixed vertex set . Each tree is a finite simple graph, with no distinguished root of a tree, and two trees are different exactly when their sets of edges differ. Then
Equivalently, this is the number of spanning trees of the complete graph . The labelled combinatorial structure includes the fixed labels: drawings, positions, and the order in which edges are listed do not create extra trees. For , the single vertex with no edges is the unique tree; count it separately, since the Prüfer sequence construction requires . For , the unique tree has edge and corresponds to the empty Prüfer sequence. [ref]
For four fixed labels, there are labelled trees, but only two unlabelled trees: the star graph and the path graph. There are four star graphs, one for each choice of centre. There are path graphs: arrange the labels along a graph path, then identify each ordering with its reversal, which describes the same set of edges. Thus . For instance, star graphs centred at and at have different sets of edges even though they have the same shape.
Figure 1.
All sixteen labelled trees on four fixed vertices: four star graphs and twelve path graphs, each with its Prüfer sequence
. Details.
The striking point is that connectedness and the absence of a graph cycle are global restrictions on edges, yet the answer is a power with no correction factor. The Prüfer sequence supplies a bijection that turns those restrictions into freely chosen labels. The rule of product then gives immediately. The same representation makes vertex degrees easy to count and supports uniform labelled tree generation for simulations and algorithm experiments.
Arthur Cayley's 1889 paper "A theorem on trees", published in the Quarterly Journal of Pure and Applied Mathematics, volume 23, pages 376–378, treats the counting problem and its refinement by vertex degrees. It was reprinted as paper 895 in volume XIII of his Collected Mathematical Papers, pages 26–28. This publication is the historical context for the name Cayley's formula; the name alone is not a claim of priority. [ref] [ref]
Chordal graph Created 2026-10-14 Updated 2026-10-18
A chordal graph is a finite simple graph with no induced cycle of length at least four. Equivalently, every cycle in a graph with at least four vertices has a chord: an edge joining two nonconsecutive vertices of that graph cycle. The word "induced" matters: the induced subgraph on the chosen vertices must contain exactly the cycle's edges, with no chords. Triangles are allowed. This definition concerns adjacency, independently of how the graph is drawn.
For the square cycle graph , take vertex set and set of edges , where abbreviates . Its graph neighbourhoods are and . The square is an induced cycle, so is not a chordal graph. Add the single edge : now , , , and . The only possible four-vertex graph cycle has chord , so this new graph is a chordal graph. Its maximal cliques are exactly and .
Figure 1.
An induced cycle loses its obstruction when one diagonal is added; the resulting maximal cliques form a junction tree
. Details.
Connect these two maximal cliques by a single edge labelled with their intersection . The result is a junction tree, also called a clique tree: its nodes are maximal cliques, and the nodes containing any fixed original vertex induce a connected graph inside the tree. Here occur in both nodes, while each occur in just one. This is the running intersection property. More generally, a nonempty connected graph is a chordal graph exactly when its maximal cliques admit such a tree; a disconnected chordal graph can be represented by one such tree per connected component of a graph.[ref]
A chordal graph need not be a planar graph: the complete graph is a chordal graph, since every pair of distinct vertices is adjacent, but its ten edges violate the planar graph edge bound . Conversely, even a plane drawing whose bounded faces are triangles can hide an induced cycle: a wheel graph with a four-vertex rim and a central vertex joined to the whole rim still has the rim as an induced cycle. Adding chords to obtain a chordal graph is called triangulation of an undirected graph; this is an adjacency condition, rather than a requirement about planar faces.
Why is this structure useful? The maximal cliques collect local interactions, and the running intersection property makes their overlaps sufficient for consistent communication. For random variables with finite state sets, a probabilistic graphical model of the square-plus-diagonal form can have
where the two nonnegative clique potentials have a positive normalizing constant . Eliminating produces the two-variable junction-tree sum-product message
The shared clique carries everything needed from the eliminated side. For possible states per random variable, this example uses two sums over configurations after reusing the message, rather than directly summing over configurations. The example's message is an exact finite sum, with no simulated data. Large maximal cliques still make exact inference expensive; chordal graphs provide a decomposition, not a universal guarantee of cheap inference.[ref]
Chromatic number Created 2026-09-24 Updated 2026-10-14
For a nonempty finite simple graph , the chromatic number is the least positive integer for which has a proper vertex graph coloring with at most colours. To establish an exact chromatic number, give a colouring using that many colours and explain why fewer cannot suffice. A colouring alone gives only an upper bound.[ref]
Figure 1.
Optimal graph colorings of the cycle graphs
. Numbers inside dots are colour labels, and labels outside are vertices. The cycle graph alternates two colours. The odd cycles need three, although is a triangle-free graph. Details.
These small graphs show why the chromatic number measures more than the presence of triangles in a graph:
For a cycle graph of even length, alternating two colours closes consistently; for an odd cycle, it does not, and a third colour on the final vertex suffices. More generally, the two-colourability criterion for bipartite graphs says that exactly when is a bipartite graph, and the odd-cycle characterization of bipartite graphs identifies the obstruction as an odd cycle. A nonempty graph with no edges has chromatic number one; a bipartite graph with at least one edge has chromatic number exactly two.
In the pairwise-conflict scheduling model of graph coloring, is the least number of interchangeable slots needed. This turns a drawing into an optimization question: how many groups of compatible activities are unavoidable? Greedy coloring constructs a valid grouping quickly, but its number of colours can exceed the chromatic number.
Chromatic polynomial Created 2026-09-24 Updated 2026-10-14
The chromatic polynomial turns a graph coloring problem into a counting problem: how many choices remain when adjacent vertices must have different colours? For a finite simple graph and a positive integer , is the number of proper vertex colorings using a fixed, distinguished palette of colours. A colouring need not use every available colour, and exchanging two palette colours generally gives a different colouring. Although is a polynomial, its values at arbitrary noninteger arguments are not counts of colourings.
Consider the three-vertex path graph ----. Choose in ways, then in ways, then in ways: and may agree because they are not adjacent. The multiplication principle gives
Adding the edge makes the three-vertex complete graph . Now must avoid both preceding colours, so
With three available colours, the path graph has 12 colourings, whereas the triangle has 6. With two colours the counts are and : the extra constraint makes the triangle impossible to colour.
Figure 1.
All twelve proper colourings of a three-vertex path using a three-colour palette
. Details.
For a nonempty graph, the chromatic number records only the first positive integer for which . The chromatic polynomial also counts the choices for every larger palette. For the path the chromatic number is , and for the triangle it is . Counting assignments also gives a useful interpretation for scheduling: if adjacent vertices represent tasks that must use different slots, the chromatic polynomial counts the valid assignments to named slots. Adding a conflict edge can only remove assignments.
The chromatic polynomial also remembers some of the graph's structure. For a simple graph with vertices and edges, its leading terms are ; its degree of a polynomial gives the number of vertices, and its next coefficient gives the number of edges. It does not determine the graph completely. A four-vertex path graph and a four-vertex star graph are not related by a graph isomorphism, but both are trees and have chromatic polynomial .
The early connection to map colouring appears in George D. Birkhoff's article [ref]. For a derivation of the counting recurrence and its leading coefficients, see Paul Johnson's MAS 341 lecture on chromatic polynomials.
Chromatic polynomial after attaching a leaf Created 2026-09-24 Updated 2026-10-14
Attaching a new vertex that is a leaf of a graph multiplies the chromatic polynomial by : after colouring the old graph, the new vertex may receive any colour except its neighbour's. Starting with one vertex and repeatedly adding a leaf of a graph constructs any finite tree. Thus a tree with vertices has
In contrast, every pair of vertices in a complete graph must receive different colours, so the multiplication principle gives the falling factorial
For positive integers this product vanishes, expressing the impossibility of assigning distinct colours to all vertices.
Clique count in a binomial random graph Created 2026-09-24 Updated 2026-10-06
If counts copies of the complete graph in , then
Consequently implies by the first moment method.
For the uniform set family of vertex sets of -cliques, its -fold lower shadow consists of graph edges. Repeated use of the Kruskal-Katona theorem bounds clique count from edge count. Sixteen four-cliques have at least twenty-three triples in their shadow and at least eighteen edges in their second shadow, by the expansions and . Hence a graph with fifteen edges has at most fifteen four-cliques, attained by the complete graph on six vertices.
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.
Clique number Created 2026-10-06 Updated 2026-10-14
The clique number is the maximum number of vertices in a clique of a finite graph:
We use for the graph with no vertices. For a nonempty complete graph, ; for the five-vertex example, .
If the graph contains and no as subgraphs, its clique number is exactly , because every larger clique contains a clique with vertices. Also : a proper vertex coloring must assign different colors to all members of any clique. This lower bound need not be an equality; the cycle graph has clique number and chromatic number .
Closed walk Created 2026-10-06 Updated 2026-10-14
A closed walk is a walk with equal endpoint vertices, . Under our convention this includes the zero-length walk ; returning after traversing at least one edge requires . Closure imposes no other restriction on repeated vertices or edges. In a directed graph, a closed directed walk must also follow every directed edge in its permitted direction.[ref]
Figure 1.
Returning to : backtracking closed walk, closed trail with a repeated internal vertex, and graph cycle
. Details.
In the shared simple graph, is a length-two closed walk that immediately backtracks along . It is not a trail, since is used twice, and it is not a graph cycle. The length-six closed walk is a trail, since its six edges are distinct, but is not a graph cycle: it returns to midway through the journey. The length-three closed walk is a graph cycle, with all vertices distinct apart from the required endpoint repetition. In a simple graph that is an undirected graph, a graph cycle has length at least three; the two-step backtrack is excluded.[ref]
A positive-length closed walk therefore need not reveal a graph cycle: even a tree permits an out-and-back journey on an edge. A positive-length closed trail in a simple graph does contain a graph cycle. For a proof outline, choose a shortest positive-length consecutive portion of the trail whose endpoint vertices coincide. It cannot repeat an internal vertex, since that would give a shorter such portion; it cannot have length one or two because self-loops and repeated edges are excluded. It is consequently a graph cycle. Cutting it out leaves another closed trail, possibly of length zero, so repetition partitions the original edges into graph cycles. In our six-step example these are the two triangles in a graph. A closed trail using every edge would be an Euler circuit; here is omitted.
Counting return journeys makes closed walks useful even when they repeat edges. For a finite simple graph with adjacency matrix , the walk count from powers of an adjacency matrix gives length- walks from to , for every nonnegative integer . A proof outline is that matrix multiplication appends one allowed step, summing over the previous endpoint; is the identity matrix, recording the unique zero-length walk at each vertex. Consequently
The trace counts closed walks with a specified starting vertex and traversal order, not distinct graph cycles. These formulas use adjacency entries, not arbitrary travel costs in a weighted graph.[ref]
In our example, : the five length-two closed walks are , , , , and . Also , going round either triangle in a graph in either direction, and : each of the two triangles in a graph supplies three choices of starting vertex and two directions. These exact counts for the constructed graph illustrate why return counts and graph cycle counts differ.
A closed walk naturally models a delivery or inspection journey that returns to its depot. Repeated vertices let it combine several excursions; repeated edges let it serve a dead end and return. For an Euclidean travelling salesman tour, one can first construct a closed walk visiting all locations and then use the triangle inequality to shortcut repeated visits without increasing total length. That argument assumes direct travel between the retained locations is permitted, as in a complete graph weighted by Euclidean distance; an arbitrary road network need not contain those shortcut edges.
Complete graph Created 2026-09-24 Updated 2026-10-14
A complete graph is a simple graph in which every two distinct vertices are joined by an edge. The finite complete graph on vertices is denoted . Here the edges are undirected, and self-loops are excluded. The usual pictures below use : is a single vertex, a single edge, and a triangle in a graph.[ref]
Completeness describes all the possible pairs, rather than a drawing style. Different layouts can represent the same graph through a graph isomorphism. Crossing lines away from the drawn vertices do not add new vertices or edges.
Figure 1.
Complete graphs with one through five vertices
. Each original drawing joins every pair of distinct vertices exactly once. The complete graphs have respectively edges. Intersections of drawn lines in the panel are not additional vertices. Details.
There are unordered pairs of distinct vertices, so this is the edge count of a complete graph. Each vertex has vertex degree . The degree-sum formula gives the same count: . These formulas make a complete graph the upper extreme for edge counts among simple graphs of a fixed size.
This is useful when modelling pairwise relationships. If every pair of objects needs its own direct connection, ten vertices require edges, while twenty require . Adding one more vertex to introduces further edges. This counts a specified direct-link model; it does not require every communication system to implement every relationship with a separate physical connection.
A proper vertex coloring of must give every vertex a different color, so its chromatic number is . For , its independence number is : two distinct vertices already have an edge between them. Thus complete graphs provide immediate test cases for graph coloring and independent sets.
Complete graph subdivision Created 2026-09-29 Updated 2026-10-14
A is a subdivision of the complete graph . Its original complete-graph vertices are branch vertices and its replaced edges are branch paths.
Complete uniform hypergraph Created 2026-10-06 Updated 2026-10-07
The complete -uniform hypergraph on vertices contains every -subset of its vertex set. A hypergraph clique here means a restriction to a vertex subset of this form, rather than merely a clique in the pairwise shadow. For , it is an ordinary complete graph.
In a partially fixed two-colour edge coloring of a complete graph, complete all unassigned edges independently and fairly. For a fixed clique with unassigned edges, its conditional probability of becoming monochromatic is zero if both colours already occur; if a colour is fixed and no conflicting colour occurs; and if none is fixed. Sum these conditional probabilities over the cliques to obtain a computable conditional expectation. Fix each next edge to a colour that does not increase this conditional expectation, yielding a deterministic minimization construction.
A connected regular graph has exactly two distinct adjacency eigenvalues if and only if it is a complete graph with . Its eigenvalues are on the constant vectors and on their orthogonal complement.
Edge coloring Created 2026-10-03 Updated 2026-10-14
An edge colouring assigns a label called a colour to every edge of a graph: it is a function . Here this definition allows arbitrary assignments. Two edges sharing a vertex may receive the same colour. A proper edge colouring imposes the additional condition that such edges receive different colours. Some textbooks use "edge colouring" as shorthand for this proper version; check the convention before applying a theorem.[ref]
The distinction matters in Ramsey theory. In a red-blue edge colouring of a complete graph, a triangle in a graph is monochromatic when its three edges have the same colour. These are arbitrary edge colourings: forbidding equal colours on edges sharing a vertex would forbid the very monochromatic triangles in a graph being sought. For example, assigning red to every edge of is a valid arbitrary edge colouring, although it is not a proper edge colouring. Colour labels can also stand for time slots: then proper edge colouring turns incompatible jobs into separate rounds.
For a finite set of vertices, a simple graph selects some of their unordered pairs as edges. There are ordered pairs of distinct vertices; each unordered pair is counted twice, giving possibilities. Hence every simple graph on those vertices satisfies
with equality exactly when is a complete graph. The binomial coefficient also shows why the count grows quadratically with the number of vertices.