Counting Edges of a Complete Simple Graph

A complete simple undirected graph connects every pair of distinct vertices with one edge.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Count a four-vertex example
  2. Derive the general count
  3. Count each unordered pair once
  4. State conventions before applying the formula

Count a four-vertex example

Each of four vertices has degree three, so the sum of degrees is twelve. Dividing by two gives six edges. The degree counting rule covers why every edge contributes twice.

Derive the general count

Choosing two distinct endpoints from \(n\) without order gives \(\binom n2=n(n-1)/2\). If the graph includes both directed orientations for each pair, it has \(n(n-1)\) directed edges instead. See unordered combinations.[1]

Count each unordered pair once

For a simple complete undirected graph on four vertices, every distinct pair contributes an edge. Four vertices each have degree three, giving twelve incidences. Each edge appears at two endpoints, so the count is six. See unordered choices.

Vertices A,B,C,D
Edges AB,AC,AD,BC,BD,CD
Undirected count: 6
With both directed arrows for each pair: 12

State conventions before applying the formula

The formula \(n(n-1)/2\) assumes an undirected simple graph with no loops. If loops are included, add their count. Test zero and one vertices to catch formulas that assume at least one edge.

References

  1. Eric Lehman, F. Thomson Leighton and Albert R. Meyer, Mathematics for Computer Science ↩