DA5 - Complete and bipartite graphs

DA5 - Complete and bipartite graphs

How many connections does a graph need when everyone can meet everyone, or when connections are allowed only between two groups? Learn to recognise complete and bipartite graphs, encode their edges in adjacency matrices, and find the connections missing from a graph. Matrix entries will also reveal routes that are less obvious in a drawing.

Complete and bipartite graphs

Five people each shake hands once with every other person. How many handshakes take place? A graph with one vertex per person and one edge per handshake prevents us counting the same handshake twice.

The complete graph KnK_n is the simple graph on nn vertices in which every pair is adjacent. Each vertex has degree n−1n-1. Counting all degrees gives n(n−1)n(n-1), but each edge occurs at both endpoints, so

E(Kn)=n(n−1)2E(K_n)=\frac{n(n-1)}2

This formula is not printed in the exam formula booklet. It counts unordered pairs of distinct vertices. No self-handshakes or repeated handshakes are included.

[DIAGRAM: asset_name: Complete and complete bipartite graphs; asset_slug: aqa7367-complete-bipartite; caption: K5 joins every pair while K2,3 joins every pair across its two groups; description: Left is K5 on labelled vertices A B C D E with ten edges. Right is K2,3 with left group A B and right group X Y Z, all six cross-group edges and no within-group edge. Edge crossings have no vertex dots and are not vertices.]
K5 joins every pair while K2,3 joins every pair across its two groups

A graph is bipartite if its vertices can be divided into two disjoint sets so that every edge goes from one set to the other. Edges within either set are forbidden; some cross-group pairs may be missing. The complete bipartite graph Kr,sK_{r,s} includes every cross-group pair, giving r+sr+s vertices and rsrs edges. The rr vertices in the first set each have degree ss; those in the second each have degree rr.

A square A–B–C–D–A is bipartite with groups {A,C}\{A,C\} and {B,D}\{B,D\}, even if drawn without two visible columns. A triangle is not: once A is in one group, both B and C must be in the other, contradicting their edge BC. More generally, following a cycle alternates groups, so a bipartite graph cannot contain an odd-length cycle. The converse holds too: attempt to place vertices by even or odd distance from a starting vertex in each component; a conflict would produce an odd cycle. Thus bipartite graphs are exactly the graphs with no odd cycle.

Worked example 1: all pairs

Question. Find the number of edges and the degree of each vertex in K5K_5.

Plan. Count four neighbours per vertex, then halve the degree sum.

deg⁡(v)=4,E=5×42=10\deg(v)=4,\qquad E=\frac{5\times4}{2}=10

Answer. Ten edges, with degree 4 at every vertex.

Check. List pairs beginning with A, then B, C and D: 4+3+2+1=104+3+2+1=10, with no repeated pair.

Keep five vertices but change the allowed connections to two groups of sizes two and three.

Worked example 2: only cross-group pairs

Question. Find the edge count and degrees in K2,3K_{2,3}.

Plan. Join each of the two vertices in the first set to all three in the second.

E=2×3=6,degrees 3,3,2,2,2E=2\times3=6,\qquad \text{degrees }3,3,2,2,2

Answer. Six edges; the size-2 group has degree 3 at each vertex and the size-3 group degree 2.

Check. The degree sum is 3+3+2+2+2=12=2E3+3+2+2+2=12=2E.

The word complete in these two names has a different set of allowed pairs: K2,3K_{2,3} is complete bipartite, but is not the complete graph K5K_5.

Watch out

A bipartite graph need not contain every possible cross-group edge. To justify bipartiteness, give the two vertex sets and verify that no edge joins vertices within either set.

Use fresh group sizes for the count.

Adjacency matrices

An adjacency matrix stores connections using a fixed order of vertices, so it gives an exact description even when a drawing is crowded.

For a simple undirected graph with vertices in the order A, B, C, D, use the same order for rows and columns. The entry aija_{ij} is 1 when row vertex ii is adjacent to column vertex jj, and 0 otherwise. Every diagonal entry is zero because there are no loops. The matrix is symmetric because AB and BA describe the same undirected edge. A row sum is the degree of that vertex, and the sum of all entries is 2E2E.

Worked example 3: encoding a path

Question. Write the adjacency matrix of the graph with edges AB, BC, CD, using order A, B, C, D.

Plan. Write a row for each vertex's neighbours and mirror each edge across the diagonal.

A joins only B; B joins A and C; C joins B and D; D joins only C. Thus

A=(0100101001010010)\mathbf A=\begin{pmatrix} 0&1&0&0\\ 1&0&1&0\\ 0&1&0&1\\ 0&0&1&0 \end{pmatrix}

Answer. The displayed matrix, with the stated row and column order.

Check. Row sums 1,2,2,11,2,2,1 total 6, twice the three edges; symmetry and zero diagonal also hold.

Add only the edge DA. Exactly two matrix entries change, since each undirected edge has two positions.

Worked example 4: closing the path

Question. Find the adjacency matrix after DA is added to the previous graph.

Plan. Replace the AD and DA zero entries by ones, leaving all others fixed.

B=(0101101001011010)\mathbf B=\begin{pmatrix} 0&1&0&1\\ 1&0&1&0\\ 0&1&0&1\\ 1&0&1&0 \end{pmatrix}

Answer. The matrix describes cycle A–B–C–D–A, which is K2,2K_{2,2} with groups {A,C}\{A,C\}, {B,D}\{B,D\}.

Check. Every row has sum 2, so there are 8/2=48/2=4 edges. The only new adjacent pair is AD.

For a directed graph the row-to-column convention records direction: aij=1a_{ij}=1 represents an arrow from ii to jj, so symmetry need not hold. Row sums count out-degrees and column sums in-degrees. Multiple edges and loops require an explicitly stated counting convention; do not silently assume that a 0–1 matrix encodes them. Here our calculations use simple undirected graphs.

Changing the vertex order permutes rows and columns together; it changes the displayed matrix without changing the graph. If a bipartite graph is ordered with one group first and the other second, the two within-group diagonal blocks are zero.

Watch out

A matrix is meaningful only with its vertex order. An undirected edge appears twice in the matrix, so count its edges by halving the total, rather than counting every 1 as a different edge.

Decode this new matrix directly.

The complement of a graph

The complement keeps all the vertices and replaces the edge set by exactly the pairs that were missing.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account