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]
Graph Theory by Reinhard Diestel. §1.1, printed p. 3 of the third electronic edition (2005): pairwise adjacency, complete graphs and triangle notation
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.
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.
Prüfer degree formula 2026-10-14
For a labelled tree with vertices, the vertex degree of label is one plus the number of occurrences of in its Prüfer sequence:Each recording of corresponds to an incident edge removed when a neighbouring leaf of a graph is deleted. Exactly one incident edge remains when itself is deleted, or when it belongs to the final pair. In particular, is a leaf of a graph exactly when it never occurs in the Prüfer sequence. The same reasoning applies to each remaining tree and its remaining code. [ref]
https://www.cs.columbia.edu/~cs4203/files/GT-Lec4.pdf. Columbia University, Graph Theory Lecture 4, Proposition 7.1: degree equals occurrences plus one
For , the occurrence counts in label order are , giving the degree sequence . Its sum is , as required by the degree-sum formula. More generally, summing the occurrence counts gives , so summing the vertex degrees gives .
Tree (graph theory) 2026-10-13
A tree is a nonempty connected graph containing no graph cycle. Think of seven locations joined so that everyone can reach everyone else, but no connection supplies an alternative route. For a finite simple graph with vertices, three descriptions are equivalent: being a tree; having exactly one simple graph path between every pair of distinct vertices; and being a connected graph with exactly edges. Here a simple graph path repeats no vertex. Connectedness in the last description is essential. [ref]
https://www.maths.tcd.ie/~dwilkins/Courses/MA2C03/MA2C03Courseware_2014to15/MA2C03_S4_Yr1415.pdf. Trinity College Dublin, graph theory notes, Theorems 4.24–4.26 and Corollary 4.27
For a concrete tree, label the vertices and take the edgeswhere abbreviates the unordered pair . There are seven vertices and six edges. The unique graph path from to is , using five edges. The degree sequence in label order is : its sum is , as the degree-sum formula predicts. Each of is a leaf of a graph, having vertex degree one.
A seven-vertex tree: one graph path, two connected components of a graph after deletion, and one graph cycle after insertion
. Details. Deleting edge leaves precisely two connected components of a graph, on and . Every edge of a tree is a bridge in a graph. Instead add edge to the original tree: it closes the unique existing graph path into exactly one graph cycle. Thus a tree provides economical connections with no redundancy: a single failed link separates locations. Every finite tree with at least two vertices has at least two instances of a leaf of a graph; the endpoints of a longest graph path supply them. [ref]
https://www.mathstat.dal.ca/~janssen/2113/notes/class14/. Dalhousie University, Trees: leaves and indispensable edges
The number alone proves nothing about connectedness: a cycle graph on together with an isolated vertex has seven vertices and six edges, yet is disconnected. Briefly, two different simple graph paths between the same vertices would contain a graph cycle. Repeatedly removing a leaf of a graph and its incident edge proves the tree count by mathematical induction, starting with one vertex and no edges.
Uniform labelled tree generation 2026-10-14
For , choose independent random variables, each with the uniform distribution on a finite set , and decode their values as a Prüfer sequence. Every sequence has probability , and the bijection gives each labelled tree the same probability. This produces a uniform spanning tree of the complete graph without repeatedly proposing sets of edges and rejecting those that fail to be trees. It supplies random inputs for testing implementations of breadth-first search and a tractable model of random connections. [ref]
https://sites.math.rutgers.edu/~zeilberg/Combo20/hw.html. Doron Zeilberger, Rutgers Math 454 (2020), Lecture 23: generate random labelled trees by sampling and inverting Prüfer codes
This distribution is uniform over fixed-label trees, rather than over unlabelled trees. With four labels, the star graph shape has probability and the path graph shape has probability . Also, for a fixed label , the Prüfer degree formula givesHere the binomial distribution counts the independent code positions equal to . The expected value agrees with the average vertex degree from the degree-sum formula. Individual labels have the same distribution by symmetry, though their vertex degrees are constrained together by their fixed sum. When , simply return the single isolated vertex.

