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 is the simple graph on vertices in which every pair is adjacent. Each vertex has degree . Counting all degrees gives , but each edge occurs at both endpoints, so
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.]

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 includes every cross-group pair, giving vertices and edges. The vertices in the first set each have degree ; those in the second each have degree .
A square A–B–C–D–A is bipartite with groups and , 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 .
Plan. Count four neighbours per vertex, then halve the degree sum.
Answer. Ten edges, with degree 4 at every vertex.
Check. List pairs beginning with A, then B, C and D: , 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 .
Plan. Join each of the two vertices in the first set to all three in the second.
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 .
The word complete in these two names has a different set of allowed pairs: is complete bipartite, but is not the complete graph .
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 is 1 when row vertex is adjacent to column vertex , 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 .
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
Answer. The displayed matrix, with the stated row and column order.
Check. Row sums 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.
Answer. The matrix describes cycle A–B–C–D–A, which is with groups , .
Check. Every row has sum 2, so there are edges. The only new adjacent pair is AD.
For a directed graph the row-to-column convention records direction: represents an arrow from to , 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