Graphs, digraphs and networks
Learn the language of graphs, digraphs and networks in Year 12 VCE General Mathematics. A graph is simply dots and lines: towns linked by highways, players who have met on court, or train stations joined by track. Drawing only the connections strips a problem back to what matters, whether you are mapping one-way laneways in the Melbourne CBD or the roads between Gippsland towns.
You will practise finding the degree of a vertex, spotting loops, multiple edges, isolated vertices and bridges, and telling simple, complete and connected graphs apart. You will turn tables into directed graphs, read in-degrees and out-degrees, and add weights to make networks, ready to describe the same graphs with matrices and to test whether they can be drawn flat.
Theory
A graph is a set of vertices joined by edges. This Year 12 General Mathematics guide for students in Victoria explains degree, loops, simple and complete graphs, connected graphs and bridges, directed graphs with in-degree and out-degree, and networks with weighted edges.
A graph is a set of points called vertices joined by lines called edges. Only the connections matter: an edge may be straight or curved, and its length on the page means nothing. An edge that starts and finishes at the same vertex is a loop, and two or more edges joining the same pair of vertices are multiple edges. The degree of a vertex, \(\deg(A)\), is the number of edge ends at that vertex, so a loop adds \(2\). A vertex of degree \(0\) is an isolated vertex.
A simple graph has no loops and no multiple edges. A complete graph joins every pair of vertices by exactly one edge. A subgraph is part of a graph: some of its vertices and some of the edges between them. A graph is connected if you can travel along edges from any vertex to any other. A bridge is an edge which, if removed, would leave a connected graph in two pieces. A bipartite graph has its vertices split into two groups, with every edge joining a vertex in one group to a vertex in the other (never two vertices in the same group).
In a directed graph (a digraph) every edge has an arrow and can only be travelled one way; a directed edge is also called an arc. The in-degree of a vertex is the number of arcs arriving at it, and the out-degree is the number leaving it. When each edge carries a number (a distance, time or cost), the graph is a weighted graph or network.
Each edge adds \(2\) to the total of the degrees (one for each end), so for any graph:
For one vertex, count every edge end that touches it:
A complete graph on \(n\) vertices joins every pair once, so each vertex has degree \(n - 1\) and:
In a digraph:
How to draw a graph or network for a real situation
- Choose the vertices. Each place, person or object becomes one vertex, labelled with a letter.
- Draw the edges. Join two vertices only when there is a direct link (a road, a cable, a game played). Use an arrow if the link only works one way: that makes a digraph.
- Add the weights. Write the distance, time or cost on each edge, with units stated once.
- Check. Count the edges against the information given and check the degrees add to twice the number of edges.
How to find a bridge
- Cover one edge at a time.
- Ask: can every vertex still be reached from every other? If not, that edge is a bridge.
- An edge that lies on a closed loop of edges is never a bridge, and an edge to a vertex of degree \(1\) always is.
Count edge ends at each vertex. The loop at \(P\) counts \(2\).
| \(\deg(P)\) | \(=\) | \(2 + 1 + 1\) |
| \(\) | \(=\) | \(4\) |
| \(\deg(Q)\) | \(=\) | \(1 + 1 + 1\) |
| \(\) | \(=\) | \(3\) |
| \(\deg(R)\) | \(=\) | \(1 + 1 + 1 + 1\) |
| \(\) | \(=\) | \(4\) |
| \(\deg(S)\) | \(=\) | \(1 + 1 + 1\) |
| \(\) | \(=\) | \(3\) |
| \(\text{sum of degrees}\) | \(=\) | \(4 + 3 + 4 + 3\) |
| \(\) | \(=\) | \(14\) |
| \(\text{number of edges}\) | \(=\) | \(14 \div 2\) |
| \(\) | \(=\) | \(7\) |
Check by counting directly: the loop, \(PQ\), \(PR\), \(QR\), \(QS\) and two edges \(RS\) make \(7\). The graph is not simple: it has a loop and a multiple edge.
Each team is a vertex and each game is an edge. Every pair of teams is joined once.
| \(\text{degree of each vertex}\) | \(=\) | \(8 - 1\) |
| \(\) | \(=\) | \(7\) |
| \(\text{number of edges}\) | \(=\) | \(\dfrac{8 \times 7}{2}\) |
| \(\) | \(=\) | \(28\) |
(i) A complete graph on \(8\) vertices. (ii) Each team plays \(7\) games, so every vertex has degree \(7\). (iii) \(28\) games. Check: \(8 \times 7 = 56\) edge ends, and \(56 \div 2 = 28\).
Each stop is a vertex. Each trip is an arrow from its start to its finish, labelled with its time.
| \(\text{in-degree}(C)\) | \(=\) | \(1 + 1\) |
| \(\) | \(=\) | \(2\) |
| \(\text{out-degree}(C)\) | \(=\) | \(1 + 1\) |
| \(\) | \(=\) | \(2\) |
| \(\text{total arcs}\) | \(=\) | \(7\) |
(ii) Arcs arrive at \(C\) from \(R\) and \(I\); arcs leave \(C\) to \(Q\) and \(S\). (iii) No arc arrives at \(I\), so \(I\) has in-degree \(0\) (its out-degree is \(1\)). (iv) No. There is an arc \(C \to Q\) but none from \(Q\) to \(C\); a rider goes \(Q \to R \to C\) instead. \(S \to R\) and \(R \to S\) are two different arcs.
Check that every town can be reached, add the weights, then remove one road at a time.
| \(\text{total}\) | \(=\) | \(8 + 18 + 15 + 52 + 47 + 68 + 35\) |
| \(\) | \(=\) | \(243 \text{ km}\) |
(i) Yes: every town can be reached from \(T\). (ii) \(243\) km. (iii) \(SB\) and \(BL\). Removing \(SB\) cuts \(B\) and \(L\) off from the rest, and removing \(BL\) cuts off \(L\). Every other road lies on a closed loop (\(T\)β\(M\)β\(R\) or \(M\)β\(S\)β\(R\)), so removing it leaves another way round.
Common pitfalls
Frequently asked questions
What is the degree of a vertex?
The degree is the number of edge ends at the vertex. Count each edge joined to it once, and count a loop twice because both of its ends are at that vertex.
What is the difference between in-degree and out-degree?
They are used in a directed graph. The in-degree of a vertex is the number of arcs pointing into it, and the out-degree is the number of arcs pointing away from it.
What is a bridge in a graph?
A bridge is an edge of a connected graph which, if it were removed, would split the graph into two separate pieces. An edge that is part of a closed loop of edges is never a bridge.
What is an isolated vertex?
An isolated vertex has no edges at all, so its degree is 0. A graph with an isolated vertex (and at least one other vertex) is not connected.
How many edges does a complete graph have?
A complete graph with n vertices has n(n - 1)/2 edges. For example, a complete graph on 5 vertices has 5 times 4 divided by 2, which is 10 edges.
What is the difference between a graph and a network?
A network is a graph with a number, such as a distance, time or cost, on each edge. It is used to model a real situation like roads between towns.