A circuit in graph theory is a closed route through a graph that begins and ends at the same vertex without repeating any edge — and understanding it precisely is the key that unlocks Eulerian paths, deadlock detection, circuit board routing, genome assembly, and a surprising amount of modern network science. This guide breaks down the definition step by step, clears up the notorious confusion between a circuit and a cycle, walks through worked examples, and shows where the idea earns its keep in the real world.
Most guides skip this. Don't The details matter here..
What Is a Circuit in Graph Theory?
Formally, a circuit is a closed trail: a sequence of vertices and edges that starts and ends at the same vertex, in which no edge is used more than once. Vertices, however, may be repeated And that's really what it comes down to. Less friction, more output..
That single sentence contains the whole idea, but it only makes sense once you know what a trail is — and a trail only makes sense once you know what a walk is. So let's build the vocabulary from the ground up.
Building Blocks: Vertices, Edges, and the Language of Movement
A graph is a pair G = (V, E), where V is a set of vertices (also called nodes) and E is a set of edges connecting pairs of vertices. Graphs come in flavours that matter for circuits:
- Undirected graph: edges have no direction, so you may traverse AB either way.
- Directed graph (digraph): each edge points from one vertex to another.
- Multigraph: multiple edges may join the same pair of vertices, and loops (edges from a vertex to itself) are allowed.
- Weighted graph: each edge carries a number, such as distance, cost, or capacity.
Walk, Trail, Path, and Closed Walk
These four terms form a strict hierarchy. Each one adds a restriction to the previous:
- Walk — any alternating sequence of vertices and edges where consecutive vertices are adjacent. Repetition of vertices and edges is allowed. Example: A–B–C–B–A.
- Trail — a walk with no repeated edge. Vertices may still repeat.
- Path — a walk with no repeated vertex (which automatically means no repeated edge). A path is always a trail, but not every trail is a path.
- Closed walk — a walk that starts and ends at the same vertex.
Now combine the two ideas:
- Closed trail = circuit
- **Closed path