The adjacency matrix of a simple undirected graph is shown. How many edges |E| does the graph have?
Find |E|
Show hints
- Entry (i, j) is 1 when vertices i and j are joined by an edge.
- Each edge {i, j} gives two 1s: one at (i, j) and one at (j, i).
- The matrix contains 8 ones.
Show the answer and the step-by-step solution
Degrees: the degree of a vertex is the number of edges that meet it. Every edge has two ends, so the degrees add up to twice the number of edges: Σ deg(v) = 2|E| (the handshake lemma). The number of vertices with odd degree is therefore even. Kn has n(n − 1)/2 edges, a k-regular graph on n vertices has nk/2, and a tree on n vertices has n − 1 edges.