Network terminology and graph representations for HSC Maths Standard 2
“Use network terminology including vertex, edge, weight, degree, path, cycle and directed graph to describe and analyse networks”
A network is vertices joined by edges, possibly with weights or directions; the degrees always sum to twice the number of edges (so the total is even). Learn the ladder walk, trail, path, cycle, know that a tree on vertices has edges, and test traversability by the odd-degree count: a connected graph can be drawn in one stroke exactly when it has odd vertices (an Eulerian circuit) or (an Eulerian trail between them).
What this dot point is asking
NESA wants you to use the standard graph-theory vocabulary (vertex, edge, weight, degree, path, cycle, directed, connected). You should be able to read a network diagram, build a network from a table or a map, and answer questions about its structure. Everything else in this module, minimum spanning trees, shortest paths and critical path analysis, is built on this language. So getting the terms exactly right here pays off in every later question.
The answer
Basic terminology
A network (or graph) is just a set of points joined by lines. The points and lines have precise names, and NESA expects you to use them.
A vertex (plural vertices), also called a node, is a point in the network, usually drawn as a labelled circle. An edge (also called an arc) is a line joining two vertices. Edges may be undirected (a two-way connection) or directed (a one-way connection drawn with an arrow). Two vertices joined by an edge are adjacent, and that edge is incident with each of them.
The other core terms:
- Weight. A number written on an edge giving a distance, time, cost or capacity. A graph carrying weights is a weighted graph (or network in the everyday sense).
- Degree of a vertex. The number of edge-ends meeting at that vertex. A vertex with no edges has degree (it is isolated); a vertex of degree sits at the end of a single edge.
- Loop. An edge from a vertex back to itself. A loop adds to that vertex's degree, because both of its ends meet the same vertex.
- In-degree and out-degree (directed graphs only). The number of edges pointing in to, and out from, the vertex.
Types of graphs
- Undirected graph. Edges have no direction, for example a road that can be driven both ways.
- Directed graph (digraph). Edges have direction, drawn as arrows. A one-way street, or a task that must finish before another starts.
- Weighted graph. Each edge has a number attached (distance, time, cost, capacity).
- Simple graph. No loops and no two edges joining the same pair of vertices (no multiple edges). Almost every HSC network is simple.
- Connected graph. Every pair of vertices is joined by at least one path (see below). If not, the graph is disconnected and splits into separate components.
Degree and the handshake result
The single most tested structural fact in this dot point is the relationship between the degrees and the number of edges.
For any graph (directed or undirected), the sum of the degrees of all vertices equals twice the number of edges:
Every edge has two ends, so it contributes exactly to the degree of each of its two endpoints, that is to the running total. Two consequences worth a mark: the sum of degrees is always even, and the number of odd-degree vertices is always even. For a directed graph there is a matching pair of results, .
This result is often called the handshake result. Think of a party: if everyone shakes some hands, the total number of "hand-ends" is twice the number of handshakes, so it cannot be odd. Use it as a free self-check. If you count the degrees and the total is odd, you have miscounted, every time.
Here is the rule in action on a graph drawn from a table of road lengths.
The accent boxes are the degrees: and and have degree , while and have degree (each is on the outer cycle plus the central chord ). The total is , which is exactly for the six edges. Notice there are two odd-degree vertices, and , an even number, as the handshake result guarantees.
Walks, paths and cycles
Three terms describe a journey through a graph, and the HSC distinguishes them carefully.
A walk is any sequence of vertices in which consecutive vertices are joined by an edge; a walk may reuse vertices and edges freely. A path is a walk in which no vertex is repeated (so no edge repeats either). A cycle (or circuit) is a path that returns to its starting vertex, using at least one intermediate vertex and no repeats in between.
The length of a walk, path or cycle is the sum of the weights of its edges. If the graph has no weights, the length is just the number of edges. So in the first figure on this page, is a path of length , while is a cycle of length . One more term you will meet shortly is a trail: a walk that may repeat vertices but never repeats an edge. It sits between a walk and a path, and it is exactly what "traversing" a network means.
Connectedness and components
- Connected graph. Every pair of vertices is joined by at least one path. You can get from anywhere to anywhere.
- Disconnected graph. At least one pair of vertices has no path between them.
- Component. A maximal connected piece of the graph. A connected graph has one component; a disconnected graph has two or more.
Connectedness matters because the optimisation methods later in the module (the methods that find the best, cheapest or shortest network) assume it. For instance, you cannot build a spanning tree of a disconnected graph, because no single tree can reach every vertex.
Trees and the n minus 1 edges fact
A particular kind of connected graph turns up constantly in this module.
A tree is a connected graph with no cycles. Equivalently, it is a connected graph in which there is exactly one path between every pair of vertices. A spanning tree of a connected graph is a tree that uses all of the graph's vertices.
A tree on vertices has exactly edges. Each new vertex past the first is joined on by precisely one edge (any second edge to the existing tree would close a cycle), so vertices need edges. Turn this into a fast check: a connected graph with vertices and edges is a tree, and a connected graph with vertices and or more edges must contain a cycle.
This is the fact behind every minimum-spanning-tree question. The cheapest cable or pipe network joining towns always uses links, so it is worth memorising now.
Traversability: can you draw it in one stroke?
A classic network question asks whether you can travel along every edge exactly once without lifting your pen. This problem was first solved by Euler, for the bridges of Konigsberg. A walk that uses every edge exactly once is a traversal, and a connected graph that has one is traversable.
A connected graph is traversable exactly when the number of odd-degree vertices is or .
- Zero odd vertices (every vertex even): there is an Eulerian circuit. The traversal can start at any vertex and returns to where it began.
- Exactly two odd vertices: there is an Eulerian trail but no circuit. The traversal must start at one odd vertex and finishes at the other.
- Four or more odd vertices: the graph is not traversable; no single trail covers every edge once.
(There can never be exactly one odd vertex, because the number of odd-degree vertices is always even.)
The reason is simple. Every time a traversal passes through a vertex, it uses one edge to arrive and one to leave, so it uses up edges in pairs. That means a "pass-through" vertex needs an even degree. The only vertices allowed an odd degree are the two ends of the trail: the start, where you leave without arriving, and the finish, where you arrive without leaving. If the trail closes into a circuit, even those two must be even.
Tracing an Eulerian trail, stage by stage
The cleanest way to see the rule is to trace one. Below is a small network, a square with the diagonal , built up one edge at a time. First check the degrees, then follow the numbered edges.
Stage 1, check the degrees and pick a start. The degrees are : (edges , , ), : , : (edges , , ), : . Exactly two vertices are odd, and (ringed in accent), so a trail exists but not a circuit, and it must begin at one odd vertex and end at the other. Start at .
Stage 2, take the first two edges. Travel (edge ), then (edge ). Each edge is heavied in accent and numbered as it is used. So far no edge has been repeated, and from there are still untraced edges to leave by, so keep going.
Stage 3, continue around the square. From , take (edge ) and then (edge ). You are back at the start vertex , but the trail is not finished: the diagonal is still untraced.
Stage 4, finish along the diagonal. Take (edge ). All five edges are now used exactly once, and the trail ends at , the second odd vertex, exactly as the rule predicted. The completed trail is .
Had every vertex been even, the same tracing would have returned to its starting vertex (an Eulerian circuit). Had there been four odd vertices, you would have got stuck with edges left untraced no matter where you began.
Representing a graph: diagram, table and matrix
The same network can be written three ways, and the HSC moves between them.
- Vertex-edge diagram. Circles joined by lines, with weights on the edges if any. This is what is usually drawn for you.
- Adjacency table. A grid with a where two vertices share an edge and a where they do not (the diagonal is left blank, since a simple graph has no loops).
- Weighted (network) matrix. The same grid, but each cell holds the weight of the edge instead of a , and a dash where no edge exists.
The two table forms make degree-counting mechanical: in an undirected graph the table is symmetric, and each row total is the degree of that vertex (count weighted-matrix entries, not the weights, for the degree).
Building a network from a table or a map
Questions often hand you a distance table or a street map and ask you to draw the network, or the reverse. The recipe is short:
- One vertex per place. List the locations (stations, towns, intersections) and draw a labelled circle for each. Spread them out so edges will not cross more than necessary.
- One edge per direct connection. Read the table or map. Wherever two places are directly joined, draw an edge between their vertices. Write the distance, time or cost on the edge as its weight.
- Add arrows only if direction matters. One-way streets and task-precedence relations are directed; ordinary roads and rail sections are not.
- Check with the handshake result. Add the degrees; the total must be twice the number of edges. If it is odd, recount.
Going the other way (network to table) is the same steps in reverse: one row and column per vertex, a weight wherever an edge exists.
How exam questions are phrased
Network-terminology questions rarely say "find the degree" in those words. Learn to translate the wording:
- "How many edges meet at vertex ?" or "State the degree of ." Count the edge-ends at (a loop counts as ).
- "Find the sum of the degrees" or "... and explain why it is even." Use , then say each edge is counted at both ends.
- "Is the network connected?" Check that some path joins every pair of vertices; if not, name the components.
- "Can the network be traversed / drawn without lifting the pen / travelled using each road exactly once?" Count the odd-degree vertices: traversable when there are or . If , name a starting vertex (an odd one).
- "Where must such a route start and finish?" At the two odd-degree vertices, if there are two; anywhere (returning to start) if there are none.
- "Complete the adjacency / network matrix" or "Draw the network represented by this table." Convert between the diagram and the grid using the recipe above.
- "List the vertices with in-degree greater than out-degree." A directed-graph counting task; tabulate in- and out-degree for each vertex, then read off.
Before counting anything, label every vertex and lightly tick each edge-end as you count it; this stops the most common error, missing or double-counting an edge at a busy vertex. Always finish a degree question with the handshake check (): if the total is odd you have made a mistake, full stop. For a "can it be traversed" question, the only thing the marker wants is the count of odd-degree vertices and the rule ( or ), so state both explicitly rather than just drawing a route, and if exactly two are odd, name an odd vertex as the start.
Count and check a Sydney rail network
A simplified Sydney Trains network has stations (Wynyard), (Town Hall), (Central), (Redfern), (Granville), (Parramatta) as vertices. Edges are direct train sections with travel times (in minutes) as weights: , , , , .
Identify the graph type and count elements: The connections work in both directions (trains run both ways) and each edge carries a travel-time weight, so this is a connected, undirected, weighted graph. There are vertices and edges.
Find every degree and apply the handshake check: Count the edges meeting each station: has degree , has degree , has degree , has degree , has degree , has degree . The sum is , which equals edges. The check passes.
So there are vertices, edges, and the sum of degrees .
Decide whether the line can be traversed: There are exactly two odd-degree vertices, and (each degree ). Two odd vertices means the network has an Eulerian trail but no circuit: an inspection trip covering every section exactly once is possible only if it starts at one terminus and ends at the other. The route does exactly that. (This network is a single chain, so the trail is forced, but the odd-vertex rule is what tells you it can be done and where it must begin.)
Count degrees on a one-way road network
A small Australian town has one-way roads represented as a directed graph with vertices labelled to .
Count in-degrees and out-degrees: For each vertex, count the edges pointing in (in-degree) and pointing out (out-degree). A vertex where in-degree exceeds out-degree is sink-like (more traffic arrives than leaves); where out-degree exceeds in-degree it is source-like.
Use the directed sum rule as a check: In any directed graph the sum of all in-degrees equals the sum of all out-degrees, both equal to the total number of directed edges. Add each column; if the two totals disagree, you have miscounted a direction somewhere.
Read degrees from an adjacency table
For an undirected graph with vertices , , , and edges , , , :
Fill the table: Place a in row , column when edge exists, and otherwise. Leave the diagonal blank (no loops).
| A | B | C | D | |
|---|---|---|---|---|
| A | ||||
| B | ||||
| C | ||||
| D |
Read each degree from the row totals: The table is symmetric because the graph is undirected, and each row total is that vertex's degree: , , and each have degree . Total edges, and every vertex is even, so this graph has an Eulerian circuit (for example ).
Recognise a project schedule as a directed acyclic graph
A project has tasks , , , , where some tasks must finish before others begin.
Recognise the graph type: This is a directed graph (a precedence diagram): vertices are tasks and each directed edge points from a predecessor to a successor, so the arrows fix the order of work.
Note the acyclic requirement: A precedence network can have no cycle: a cycle would mean task depends on which depends back on , so neither could ever start. Project networks are therefore always directed acyclic graphs (DAGs), the structure behind critical path analysis.
- Confusing vertex and edge counts
- A graph with vertices and edges is not the same as one with vertices and edges. Read carefully.
- Mixing up directed and undirected
- In a directed graph, in-degree and out-degree may differ. In an undirected graph, every edge contributes to each endpoint's degree.
- Counting a loop once
- A loop (edge from a vertex to itself) contributes to that vertex's degree, not .
- Skipping the handshake check
- The sum of degrees must equal twice the number of edges. If your total is odd, recount.
- Confusing walk, trail and path
- A walk may repeat anything; a trail repeats no edge but may repeat a vertex; a path repeats no vertex. Traversing a network asks for a trail.
- Misreading the traversability rule
- Traversable means or odd-degree vertices. With two odd vertices the route must start and finish at those two; it cannot start anywhere you like.
A network is just a picture of things and the links between them. The dots stand for places like train stations or towns, and the lines stand for the connections, such as roads or tracks. Often a line has a number on it that tells you how far, how long or how much that link is. This topic is mostly about learning the right names for the parts of the picture and counting them carefully. Get the words and the counting right here, because every harder network question later builds straight on top of them.
Exam-style questions
Questions in the style of NESA exam questions on this dot point, each with a worked answer. They are written by ExamExplained unless tagged "Past paper"; the year shows the paper a question is modelled on.
2022 HSC-style2 marksA network has vertices and edges. Find the sum of the degrees of all vertices, and explain why this must be even.Show worked answer →
Sum of degrees = number of edges = .
The sum of the degrees of all vertices in any graph equals twice the number of edges, because every edge contributes to each of its two endpoints. So the sum is always even.
Markers reward the formula, the calculation, and the explanation that each edge is counted twice.
2023 HSC-style3 marksA directed graph represents a one-way road network in a small Australian town. List the vertices that have an in-degree greater than out-degree, given vertices labelled and a description of the directed edges.Show worked answer →
For each vertex, count edges pointing in (in-degree) and edges pointing out (out-degree). List the vertices for which in-degree exceeds out-degree.
Markers reward correct counting of in and out degrees for each vertex, identification of the vertices satisfying the condition, and clear notation distinguishing in and out degrees. Note that the sum of in-degrees over all vertices equals the sum of out-degrees, both equal to the number of directed edges.
2021 HSC-style2 marksDetermine whether the network drawn can be traversed (each edge used exactly once) and, if so, state a vertex at which such a trail can begin.Show worked answer →
Find the degree of every vertex and count how many are odd.
A network can be traversed using each edge exactly once when it is connected and has either zero or exactly two vertices of odd degree. If every vertex is even, the trail can start anywhere and returns to its start (an Eulerian circuit). If exactly two vertices are odd, the trail must start at one of those odd vertices and finishes at the other (an Eulerian trail). Any other number of odd vertices means it cannot be traversed.
Markers reward counting the odd-degree vertices, stating the even-degree condition, and naming a valid starting vertex.
Practice questions
Original practice questions graded from foundation to exam level, each with a full worked solution. Try them before revealing the solution.
foundation2 marksA small train line joins four stations in a row. The vertices are , , and , and the edges (direct track sections) are , and . State the degree of each station, and find the sum of the degrees.Show worked solution →
- List the degree of each vertex
- Count how many edge-ends meet at each station. sits at the end of section only, so its degree is . is on and , so its degree is . is on and , so its degree is . is on only, so its degree is .
- Add the degrees
- The sum is .
- Check with the handshake result
- There are edges, and . The total matches and is even, as it must be. Correct.
foundation2 marksA delivery depot is joined by a direct road to each of four shops , , and , and there are no other roads. The edges are therefore , , and . (a) State the degree of the depot . (b) State the degree of shop .Show worked solution →
- (a) Degree of the depot
- Every one of the four roads has one end at , so four edge-ends meet there. The degree of is .
- (b) Degree of a shop
- Shop touches only the single road , so just one edge-end meets it. The degree of is (and the same is true of , and ).
- Check with the handshake result
- The degrees are , , , , , which sum to . There are edges, and . The totals agree, so the counts are right.
foundation3 marksA graph has vertices , , , with edges , , and . (a) Write down the degree of every vertex. (b) State how many vertices have odd degree.Show worked solution →
- (a) Find each degree
- Tick off the edges at each vertex. is on and , so its degree is . is on and , so its degree is . is on , and , so its degree is . is on only, so its degree is .
- (b) Count the odd-degree vertices
- Odd degrees occur at (degree ) and (degree ). That is vertices of odd degree.
- Check with the handshake result
- The degrees sum to for the edges, and the number of odd-degree vertices () is even, exactly as the handshake result guarantees. Correct.
foundation2 marksA connected network has vertices and edges. (a) Find the sum of the degrees of all the vertices. (b) Four of the vertices have degree each. Find the degree of the fifth vertex.Show worked solution →
- (a) Use the handshake result
- The sum of the degrees equals twice the number of edges: .
- (b) Subtract the known degrees
- Four vertices contribute to the total of , so the fifth vertex has degree .
- Check
- The degrees are , , , , , which sum to . The total is even and matches twice the edge count. Correct.
core3 marksA cable company plans a network on six towns , , , , , . The proposed links are , , , and . (a) Explain whether this network is a tree. (b) State how many links a tree connecting these six towns must have.Show worked solution →
- (a) Test the tree definition
- A tree is a connected graph with no cycles. Starting at you can reach and directly, then and from , then from , so all six towns are reachable and the graph is connected. There are edges on vertices, and no edge closes a loop (each town past the first is joined on by exactly one new link), so there is no cycle. The network is a tree.
- (b) Apply the fact
- A tree on vertices has exactly edges, so a tree connecting towns must have links.
- Check
- The plan uses links for towns, which is exactly , consistent with it being a tree. The degrees also pass the handshake check. Correct.
core4 marksA network has vertices , , , and edges , , , and the diagonal . (a) Find the degree of each vertex. (b) Decide whether the network can be traversed (every edge used exactly once), and if so state a vertex where such a trail can begin. (c) Write down one trail that uses every edge exactly once.Show worked solution →
- (a) Find the degrees
- is on , and , so degree . is on and , so degree . is on , and , so degree . is on and , so degree .
- (b) Apply the traversability rule
- The graph is connected, and the odd-degree vertices are and ( of them). A connected graph with exactly odd-degree vertices has an Eulerian trail but no circuit, so it can be traversed and the trail must start at one odd vertex and finish at the other. Begin at (or at ).
- (c) Give a trail
- One valid trail is . It uses each of the edges once and ends at , the other odd vertex.
- Check
- Degrees sum to for the edges; exactly vertices are odd; and the listed trail uses all edges once. Correct.
core4 marksOne-way streets in a town are modelled by a directed graph on vertices , , , , with directed edges , , , , , and . (a) Tabulate the in-degree and out-degree of each vertex. (b) List the vertices whose in-degree is greater than their out-degree.Show worked solution →
(a) Count in and out at each vertex. For each arrow, add to the out-degree of its tail and to the in-degree of its head.
- : in (from ), out (to , ).
- : in (from , ), out (to ).
- : in (from , ), out (to ).
- : in (from ), out (to , ).
- : in (from ), out (to ).
(b) Compare the two columns. In-degree exceeds out-degree at () and ().
Check with the directed sum rule. The in-degrees sum to and the out-degrees sum to . Both equal the directed edges, so no direction was miscounted. Correct.
core3 marksAn undirected graph on vertices , , , , has the adjacency list of edges , , , , , . (a) State the degree of each vertex by counting its edges. (b) Decide whether the graph can be traversed using each edge exactly once, and name a suitable starting vertex if it can.Show worked solution →
- (a) Read each degree from the edge list
- Count the edges containing each vertex. : , , degree . : , , , degree . : , , degree . : , , degree . : , , , degree .
- (b) Apply the traversability rule
- The graph is connected, and the odd-degree vertices are and (degree each), which is exactly . A connected graph with odd-degree vertices has an Eulerian trail, so it can be traversed; the trail must start at one odd vertex and end at the other. Begin at (one trail is ).
- Check
- Degrees sum to for the edges, and exactly vertices are odd, so the rule applies and the count is consistent. Correct.
exam3 marksA graph is made of two triangles sharing a single vertex. The vertices are , , , , and the edges are , , , , , . (a) Find the degree of every vertex. (b) Explain why this network has an Eulerian circuit, and write one down starting at .Show worked solution →
- (a) Find the degrees
- : , , degree . : , , degree . : , , , , degree (it is the shared vertex). : , , degree . : , , degree .
- (b) Explain the Eulerian circuit
- Every vertex has even degree, so the number of odd-degree vertices is , and the graph is connected. A connected graph with no odd-degree vertices has an Eulerian circuit: a trail using every edge exactly once that returns to its starting vertex, and it may begin anywhere. One such circuit from is .
- Check
- Degrees sum to for the edges; there are odd-degree vertices; and the listed circuit uses all edges once and returns to . Correct.
exam4 marksA graph on seven vertices , , , , , , has edges , , , , , . (a) Explain whether the graph is connected, naming its components. (b) Hence explain whether the whole graph can be traversed using every edge exactly once.Show worked solution →
- (a) Trace the components
- Starting at you can reach and (edges , , ) but no further, since none of , , joins any of , , , . Starting at you reach , , along , , . So the graph is disconnected, with two components and .
- (b) Apply the traversability rule
- A single trail covering every edge exists only for a connected graph. Because the graph splits into two separate components, no one trail can cross from one component to the other, so the whole graph cannot be traversed using every edge exactly once. (Each component on its own is traversable, but that is two separate trails, not one.)
- Check
- Degrees are , , , , , , , summing to for the edges. The handshake check passes, but connectedness fails, so the no-traversal conclusion stands. Correct.
exam5 marksA connected network on six vertices , , , , , has edges , , , , . (a) State the number of edges and explain whether the network is a tree. (b) A planner now wants the network to contain a cycle. State the smallest number of extra edges that must be added to guarantee a cycle, and explain why.Show worked solution →
- (a) Count edges and test the tree definition
- There are edges joining the vertices in a single chain. The graph is connected, and a connected graph on vertices with exactly edges is a tree (it has no cycle). Here and , which matches, so the network is a tree.
- (b) Find the extra edges needed
- A tree has no cycle, and adding any one edge between two of its vertices creates a second path between them, which closes a cycle. So extra edge is enough, and since a tree starts with no cycle at all, at least is required. The smallest number of extra edges is therefore . (For example, adding closes the cycle .)
- Check
- Before the addition, edges on vertices gives , confirming a tree with no cycle. After adding edge there are edges on vertices; a connected graph with vertices and or more edges must contain a cycle, so edge does guarantee one. Correct.
exam6 marksA weighted road network has vertices , , , , , and edges with distances in km: , , , , , , , . (a) Find the degree of each vertex. (b) Use the handshake result to verify the number of edges. (c) Decide whether the network can be traversed using each road exactly once. (d) Find the length of the path and the path , and state which is shorter.Show worked solution →
- (a) Find the degrees
- Count edges at each vertex. : , , degree . : , , , degree . : , , , degree . : , , , degree . : , , , degree . : , , degree .
- (b) Verify the edge count
- The degrees sum to . By the handshake result , so the number of edges is , matching the eight roads listed.
- (c) Apply the traversability rule
- The odd-degree vertices are , , , , which is of them. A connected graph is traversable only when it has or odd-degree vertices, so with odd vertices this network cannot be traversed using each road exactly once.
- (d) Add the weights along each path
- For : km. For : km. Since , the path is shorter.
- Check
- Degrees sum to , so part (b) is consistent; there are odd vertices, confirming part (c); and the path lengths and each add three edge weights, with the smaller giving the shorter route. Correct.