GenerateRandomSearch

Graph Bridge Finder

A bridge is an edge with no alternative route around it: delete it and the graph falls in two. It is the edge-shaped version of a single point of failure, and the neat characterisation is that an edge is a bridge exactly when it lies on no cycle. Every bridge this page reports is also confirmed the blunt way — removed, with the components recounted — so the depth-first answer has something independent to agree with.

What this generator does

Builds a connected undirected graph and identifies every bridge using an iterative depth-first search over edge indices rather than node pairs, so a repeated edge cannot be mistaken for a bridge. Each result is then confirmed by removing that edge alone and counting the components.

How to use this tool

  1. Pick a node count and an extra-edge density.
  2. Look for edges with no way around them — those are the bridges.
  3. Generate, then read the Bridge column against your own answer.
  4. Push the density up until no bridges remain: that is a 2-edge-connected graph.

Understanding the controls

How many nodes
Between 4 and 12. Every edge is removed in turn for the check, which stays instant at these sizes.
Extra edge density (%)
At zero the graph is a tree and every edge is a bridge; raise it and the cycles start removing them.
Seed
Any word reproduces the same graph and the same set of bridges.

Common use cases

  • Teaching bridges and cycles with an answer that is checked, not asserted
  • Finding the fragile links in a small network diagram
  • Test instances for a bridge-finding implementation
  • Showing that adding one edge can remove several bridges at once
  • Setting a reproducible exercise from a seed

How this generator works

Depth-first search assigns each node a discovery time and a low-link value. The edge down to a child is a bridge exactly when the child's subtree cannot reach back to the parent or above it. The search tracks which edge it arrived by rather than which node, because two nodes joined by a repeated edge would otherwise look like a dead end and be reported as a bridge — which it is not, since the parallel edge still connects them.

Randomness and fairness

The graph is random; the bridges are computed and then proved. A seed reproduces the graph exactly and is therefore explicitly not cryptographically secure. Without a seed the browser's cryptographically secure generator is used.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Undirected graphs only.
  • A tree of n nodes has n−1 bridges, so very sparse settings produce an unexciting answer.
  • Twelve nodes is the ceiling, chosen so the per-edge removal check stays instant.
  • Edges carry no weights here — a bridge is a question about connectivity, not cost.
  • The page retains nothing, so seed a graph you want to reuse.

Privacy and your data

Everything is computed in your browser. Nothing about the graph or your seed is transmitted or kept.