Directed and Weighted Networks from Tables and Maps
Theory
A directed network uses arrows to show one-way connections, and a weighted network puts a distance, time or cost on each edge. This Year 11 Mathematics Standard page shows how to read directed networks, count the edges into and out of a vertex, change between a network and a table (row = from, column = to), draw a network from a map or description, and find route lengths and return trips.
In a directed network the edges have arrows. A directed edge can only be travelled in the direction of its arrow, like a one-way street. Directed networks also model water flowing through pipes, a team beating another team, emails sent from one person to another, or one person following another on social media. A connection that works both ways is drawn as an edge with no arrow, or as two arrows, one in each direction.
At each vertex, count the edges leading out (arrows that start there) and the edges pointing in (arrows that finish there). The number pointing in is the in-degree; the number leading out is the out-degree.
In a weighted network each edge has a number: a distance, time, cost or count. In a directed weighted network the weight can be different in each direction, for example riding uphill takes longer than riding downhill, or a flight costs more one way than the other.
Networks are often given as a table. For an ordinary (undirected) network, the entry in row \(A\), column \(B\) is the same as row \(B\), column \(A\), so the table is symmetric. For a directed network, the row is where the edge comes from and the column is where it goes to. A 1 or a weight means there is an edge; a 0 or a dash means there is not.
To draw a network from a map or a description, make each place a vertex and each road or street an edge. Put an arrow on a one-way street. A two-way street can be drawn as two edges, one in each direction.
| From \ To | \(A\) | \(B\) | \(C\) | \(D\) |
|---|---|---|---|---|
| \(A\) | – | 1 | 0 | 1 |
| \(B\) | 0 | – | 1 | 0 |
| \(C\) | 1 | 0 | – | 0 |
| \(D\) | 0 | 0 | 1 | – |
In a directed network every edge points into exactly one vertex and out of exactly one vertex, so:
| Network table | Number of edges | Reading it |
|---|---|---|
| Directed | number of 1s (or weights) | row = from, column = to |
| Undirected | number of 1s (or weights) \(\div 2\) | each edge appears twice: row \(A\) column \(B\) and row \(B\) column \(A\) |
For a route in a weighted directed network, follow the arrows and add the weights:
Reading a directed network
- Edges out of a vertex: count the arrows that start there. Edges into a vertex: count the arrows that finish there.
- Can you get from one place to another? Follow the arrows from the start. A vertex with no arrows pointing in can never be reached; a vertex with no arrows leading out can never be left.
- Route length: add the weights along the route, always in the arrow direction.
Tables
- Directed table: row = from, column = to. Each 1 is a different edge, so do not halve.
- Undirected table: it is symmetric, and each edge is listed twice.
- Return trips: read each leg from its own row and column; the way back can cost a different amount or need a different route.
From a map or description
- Draw a vertex for each place.
- Draw an edge for each road, with an arrow if it is one-way. A two-way street becomes two edges, one each way.
- Label each edge with its weight if one is given, then answer the question from the drawing.
(ii) How many lead into \(D\)?
(iii) The network is written as a table with the “from” vertex in the row and the “to” vertex in the column. What is the entry in row \(D\), column \(C\), and in row \(C\), column \(D\)?
(i) Count the arrows that start at \(C\): \(C\to A\) and \(C\to E\). So 2 streets lead out of \(C\). The arrows \(B\to C\) and \(D\to C\) lead into \(C\), so they do not count.
(ii) Count the arrows that finish at \(D\): \(A\to D\) and \(E\to D\). So 2 streets lead into \(D\).
(iii) Row \(D\), column \(C\) asks: is there an edge \(D\to C\)? Yes, so the entry is 1.
Row \(C\), column \(D\) asks: is there an edge \(C\to D\)? No: the street between them only goes from \(D\) to \(C\). The entry is 0.
| From \ To | \(P\) | \(Q\) | \(R\) | \(S\) |
|---|---|---|---|---|
| \(P\) | – | 1 | 1 | 0 |
| \(Q\) | 0 | – | 1 | 1 |
| \(R\) | 1 | 0 | – | 0 |
| \(S\) | 0 | 0 | 0 | – |
(ii) How many edges point into \(R\)?
(iii) Which vertex, once reached, can never be left?
Draw the network: row \(P\) gives \(P\to Q\) and \(P\to R\); row \(Q\) gives \(Q\to R\) and \(Q\to S\); row \(R\) gives \(R\to P\).
(i) In a directed table every 1 is a different edge, so do not halve:
| \(2+2+1+0\) | \(=\) | \(5\) |
The network has 5 directed edges. (\(P\to R\) and \(R\to P\) are two separate edges.)
(ii) Edges into \(R\) are the 1s in column \(R\): \(P\to R\) and \(Q\to R\), so 2.
(iii) Row \(S\) has no 1s, so no edge leads out of \(S\). Once you reach \(S\) you can never leave: the answer is \(\boldsymbol{S}\).
Check: the in-degrees are \(P\): 1, \(Q\): 1, \(R\): 2, \(S\): 1, and \(1+1+2+1=5\) edges.
Ash St runs one way from home (\(H\)) to the school (\(S\)).
Bell Rd is two-way between \(S\) and the shops (\(M\)).
Cook St runs one way from \(M\) to \(H\).
Dune Rd runs one way from \(H\) to the pool (\(P\)).
Elm St runs one way from \(P\) to \(M\).
Draw a directed network, showing each two-way street as two edges, one in each direction.
(i) How many edges does the network have?
(ii) How many edges lead out of \(H\)?
(iii) Find a route by car from the school to the pool.
Make each place a vertex. List the directed edges:
\(H\to S\), \(S\to M\), \(M\to S\), \(M\to H\), \(H\to P\), \(P\to M\)
(i) There are 5 streets, but Bell Rd is two-way and counts twice:
| \(5+1\) | \(=\) | \(6\) |
The network has 6 edges.
(ii) Out of \(H\): \(H\to S\) and \(H\to P\), so 2.
(iii) There is no edge \(S\to H\) or \(S\to P\). Follow the arrows: \(S\to M\to H\to P\) (Bell Rd, Cook St, Dune Rd).
| From \ To | \(W\) | \(X\) | \(Y\) | \(Z\) |
|---|---|---|---|---|
| \(W\) | – | 90 | 150 | – |
| \(X\) | 110 | – | 50 | 140 |
| \(Y\) | – | 60 | – | 70 |
| \(Z\) | 130 | – | 80 | – |
Draw the directed network, then find each cheapest route, following the arrows.
\(W\) to \(Z\) (there is no direct flight):
| \(W\to X\to Z\) | \(=\) | \(90+140=230\) |
| \(W\to Y\to Z\) | \(=\) | \(150+70=220\) |
| \(W\to X\to Y\to Z\) | \(=\) | \(90+50+70=210\) |
| \(W\to Y\to X\to Z\) | \(=\) | \(150+60+140=350\) |
Cheapest: \(\$210\).
\(Z\) to \(W\):
| \(Z\to W\) | \(=\) | \(130\) |
| \(Z\to Y\to X\to W\) | \(=\) | \(80+60+110=250\) |
Cheapest: \(\$130\).
| \(210+130\) | \(=\) | \(340\) |
The cheapest return trip costs \(\mathbf{\$340}\). The two legs use different routes because the flights only go one way.
Common pitfalls
Frequently asked questions
What is a directed network?
A network whose edges have arrows. Each arrow shows the one direction you can travel along that edge, like a one-way street.
How do you read a directed network table?
The row is the vertex the edge comes from and the column is the vertex it goes to. A 1 or a weight in row A, column B means there is an edge from A to B.
How do you count the edges from a table?
For a directed network, count every 1 (or weight). For an undirected network, each edge appears twice, so halve the count.
What is the in-degree of a vertex?
The number of edges pointing into it. The number of edges leading out is the out-degree. The in-degrees of all the vertices add up to the number of edges.
How do you turn a map into a network?
Draw a vertex for each place and an edge for each road. Put an arrow on one-way roads, draw a two-way road as an edge each way (or with no arrow), and write the distance, time or cost on each edge.