Connectivity and Edge-Connectivity

The question

Eight routers, numbered 0 to 7, and fourteen cables. Routers 0–3 are all wired to each other, and so are 4–7. Router 3 has two more cables, to 4 and to 5:

0 1 2 3 4 5 6 7 The network N: two groups of four fully wired routers, joined by the cables 3-4 and 3-5.

Every router has at least three cables. Does that mean the network survives any two failures? No. If the two cables 3–4 and 3–5 fail, the left group can no longer reach the right group. Worse, one router failure is enough: if router 3 fails, the same split happens.

So there are two different questions, with two different answers. How many routers must fail before the network splits (here, 1)? How many cables (here, 2)? And how do both compare with the smallest number of cables at any one router (here, 3)? This module defines the two numbers, proves how they are ordered, and shows that each comparison can be strict.

The naive approach, and where it wastes work

A computer can answer both questions by trying every set of routers, then every set of cables, smallest first, until one disconnects the network:

from itertools import combinations
from collections import deque

def network(edges):
    g = {}
    for u, v in edges:
        g.setdefault(u, set()).add(v)
        g.setdefault(v, set()).add(u)
    return g

def connected(g, removed_vertices=(), removed_edges=()):
    """Is what remains of g connected? (One vertex or none counts as connected.)"""
    gone = set(removed_vertices)
    cut = {frozenset(e) for e in removed_edges}
    left = [v for v in g if v not in gone]
    if len(left) <= 1:
        return True
    seen, queue = {left[0]}, deque([left[0]])
    while queue:
        u = queue.popleft()
        for w in g[u]:
            if w not in gone and w not in seen and frozenset((u, w)) not in cut:
                seen.add(w)
                queue.append(w)
    return len(seen) == len(left)

def edges_of(g):
    return sorted({tuple(sorted((u, v))) for u in g for v in g[u]})

def kappa(g):
    """Fewest vertices whose removal disconnects g; n - 1 for a complete graph (by brute force)."""
    n = len(g)
    if all(len(g[v]) == n - 1 for v in g):
        return n - 1
    return next(k for k in range(n) for S in combinations(sorted(g), k) if not connected(g, S))

def kappa_edges(g):
    """Fewest edges whose removal disconnects g (by brute force over edge sets)."""
    E = edges_of(g)
    return next(k for k in range(len(E) + 1) for F in combinations(E, k) if not connected(g, (), F))

K4_left = list(combinations(range(4), 2))
K4_right = [(a + 4, b + 4) for a, b in K4_left]
N = network(K4_left + K4_right + [(3, 4), (3, 5)])
assert len(edges_of(N)) == 14 and min(len(N[v]) for v in N) == 3
assert kappa(N) == 1 and kappa_edges(N) == 2

That is fine for fourteen cables, but the number of cable sets grows like 2m. And it proves nothing a reader can check without rerunning it. The rest of the module replaces "try everything" with definitions you can reason about and short evidence: a set of routers or cables whose removal visibly splits the network.

Two numbers, defined carefully

Let G be a graph with n vertices.

Two words are easy to blur, so this course keeps them apart: a disconnecting set is minimum if no disconnecting set has fewer edges, and minimal if no proper subset of it disconnects.

Predict: what are κ(K5) and κ′(K5)?

Both are 4. κ(K5)=4 is the convention. For κ′, isolating one vertex takes its 4 edges, and no 3 edges can split K5: Whitney's inequality below gives 4=κ≤κ′≤δ=4.

Edge cuts are enough

An edge cut always disconnects: in G−[S,S¯] no edge joins S to S¯, and both are nonempty. The converse is the useful direction.

Lemma. In every graph, every disconnecting set F contains an edge cut. If F is a minimal disconnecting set, it is an edge cut.

Proof. G−F is disconnected; let S be the vertex set of one of its components. Then S is nonempty, and S¯ is nonempty because G−F has another component. An edge of G from S to S¯ cannot survive in G−F, or its end in S¯ would belong to the component S. So [S,S¯]⊆F. If F is minimal, then [S,S¯], being itself a disconnecting subset of F, must equal F. ◻

So κ′(G) is the smallest |[S,S¯]| over nonempty proper subsets S: a search over sets of vertices instead of sets of edges. In N the smallest edge cut is [S,S¯] with S={0,1,2,3}, the two cables 3–4 and 3–5.

Cut edges are the edges on no cycle

Proposition. An edge e=uv of G is a cut edge if and only if e lies on no cycle of G.

Proof. First, e is a cut edge exactly when G−e has no u,v-path. If G−e has a u,v-path, every walk that used e can detour along it, so no two vertices are separated and the number of components stays the same. If it has none, u and v, which were in one component of G, lie in different components of G−e, so the number of components grows. If e lies on a cycle, the rest of the cycle is a u,v-path in G−e, so e is not a cut edge. Conversely, if G−e has a u,v-path P, then P together with e is a cycle through e. ◻

In N every cable lies on a triangle, including 3–4 (on the triangle 3,4,5), so N has no cut edge, even though router 3 is a cut vertex:

assert [e for e in edges_of(N) if not connected(N, (), [e])] == []
assert [v for v in N if not connected(N, [v])] == [3]

Whitney's inequality, traced on N

Whitney's inequality (1932)

For every graph G, κ(G)≤κ′(G)≤δ(G), where δ(G) is the minimum degree.

The right half is one line: the edges at a vertex of minimum degree form a disconnecting set (when G has another vertex), so κ′≤δ. The left half needs an idea. Here it is on N.

Start from the minimum edge cut F=[X,Y] with X={0,1,2,3} and Y={4,5,6,7}. Pick x∈X and y∈Y that are not adjacent: x=0, y=4. Now collect a set T of vertices:

So T={3}, and deleting it separates 0 from 4:

0 1 2 3 4 5 6 7 current rejected target The edge cut F = [X, Y] in purple. With x = 0 and y = 4, the set T = {3} is a separating set no larger than F.
X, Y = {0, 1, 2, 3}, {4, 5, 6, 7}
F = [(u, v) for u in sorted(X) for v in sorted(N[u]) if v in Y]
T = {3}                                    # the two rules above, applied by hand
assert F == [(3, 4), (3, 5)] and 4 not in N[0]
assert not connected(N, T) and len(T) <= len(F)

Proof of κ(G)≤κ′(G). If G has one vertex, both sides are 0 by the conventions. Otherwise let F be a minimum disconnecting set; by the lemma it is an edge cut [X,Y], with |F|=κ′(G).

Case 1: every vertex of X is adjacent to every vertex of Y. Then

|F|=|X||Y|≥|X|+|Y|−1=n−1≥κ(G).

(The middle inequality is (|X|−1)(|Y|−1)≥0. And κ(G)≤n−1 for every graph: for Kn by the convention, and otherwise deleting all vertices but two non-adjacent ones separates them.)

Case 2: some x∈X and y∈Y are not adjacent. Let T consist of the neighbors of x in Y together with the vertices of X−{x} that have a neighbor in Y.

  1. T separates x from y. Neither x nor y is in T: x∉X−{x} and x∉Y, and y is not a neighbor of x. An x,y-path must use an edge of F to leave X. If that first such edge leaves from x itself, its other end is a neighbor of x in Y, which is in T. Otherwise it leaves from some x′∈X−{x} with a neighbor in Y, and x′∈T. Either way the path meets T.
  2. |T|≤|F|. Charge each vertex of T to an edge of F: a neighbor y′ of x in Y to the edge xy′, and a vertex x′∈X−{x} to one of its edges into Y. Different vertices get different edges: an edge charged by the first rule has its X end equal to x, an edge charged by the second has its X end equal to some x′≠x, and within each rule the charged edge determines the vertex.

So T is a separating set with |T|≤|F|, and κ(G)≤|T|≤κ′(G). ◻

Proof moves used here. The same moves recur all semester:

When the inequalities are strict

Both inequalities can be strict, separately or together. Computed with the brute-force helpers above:

graph κ κ′ δ
two K4's sharing one vertex 1 3 3
two K4's joined by one edge 1 1 3
N: two K4's joined by two edges at one vertex 1 2 3
Petersen graph 3 3 3
shared = network(K4_left + [(a + 3, b + 3) for a, b in K4_left])   # both contain vertex 3
bridge = network(K4_left + K4_right + [(3, 4)])
petersen = network([(i, (i + 1) % 5) for i in range(5)] + [(i, i + 5) for i in range(5)]
                   + [(5, 7), (7, 9), (9, 6), (6, 8), (8, 5)])
def delta(g):
    return min(len(g[v]) for v in g)
rows = [(kappa(g), kappa_edges(g), delta(g)) for g in (shared, bridge, N, petersen)]
assert rows == [(1, 3, 3), (1, 1, 3), (1, 2, 3), (3, 3, 3)]

For 3-regular graphs the first inequality is always an equality: if G is 3-regular, then κ(G)=κ′(G) (West, Theorem 4.1.11). We state it without proof here. The Petersen graph is an instance: κ=κ′=3.

What a certificate costs

A separating set of size k proves κ(G)≤k, and anyone can check it with one search over the remaining graph, in O(n+m) time. An edge cut proves κ′(G)≤k the same way. The lemma above means a search for κ′ needs only the 2n−1−1 splits of the vertices, not the 2m sets of edges. For N that is 127 splits against 16,384 edge sets:

assert 2 ** (8 - 1) - 1 == 127 and 2 ** 14 == 16_384

Proving the lower bound, that no smaller cut exists, is a different matter. Short evidence for it exists too: for every two non-adjacent vertices, k paths between them that share no internal vertex (κ(G)≥k holds exactly when such paths exist for every non-adjacent pair, in a graph that is not complete). That is Menger's theorem, two modules from now.

A problem that looks different

A town wants to make every street one-way, and still let every resident drive from any corner to any other. For which street maps is that possible? If one street is the only link between two halves of town, it clearly fails. Is that the only obstacle? Nothing in the question mentions cuts. The lab's last exercise is a different problem that also hides its structure.

Practise

The lab runs in your browser. Your own code turns an edge cut into a separating set, one charged edge per frame, the way the proof does. Then you compute κ′ by searching splits of the vertices, and watch a tempting shortcut fail. Half of the lab is proofs. You assemble a proof about the ends of a cut edge, with decoys among the steps. You find the false step in a convincing argument and build a counterexample in code. And you finish with a growing network that does not say what it is, where you write the proof yourself and check it against explicit criteria.

Recap

Check yourself

After the lab, the tutor will ask you to defend your work out loud:

  1. Where does the proof of κ≤κ′ use that x and y are not adjacent, and how is the complete bipartite case handled instead?
  2. Why does a disconnecting set of a connected graph contain an edge cut, and why does that let a search for κ′ range over splits of the vertices?
  3. Two K4's sharing one vertex have κ=1<κ′=3. Which vertex is the cut vertex, and why does no set of two edges disconnect the graph?

Topic list modeled on the public syllabus of UIUC Math 412 (Graph Theory), which follows D. B. West, Introduction to Graph Theory, 2nd ed., Chapters 1–7. All lessons, proofs, examples, code and exercises here are original. This course is independent and not affiliated with or endorsed by the University of Illinois.