# 5.1 Network

SPM Form 4 Mathematics (KSSM) · Chapter 5 Network in Graph Theory. Interactive version with diagrams: https://spmtuition.com/math/form-4/chapter-5-network-in-graph-theory/5-1-network/

## Vertices and edges

A graph represents objects as vertices and connections as edges. A network uses a graph to model real connections.

| Feature | Meaning |
| --- | --- |
| Vertex | An object or location |
| Edge | A connection |
| Degree | Number of edge ends at a vertex |
| Loop | An edge joining a vertex to itself |
| Multiple edges | More than one edge joins the same pair |
| Directed edge | An arrow restricts travel direction |
| Weight | A distance, cost, time or other value |

![A graph with vertices A, B, C, D and E. B and C are joined by two edges. E has a loop. The degrees are A 3, B 3, C 3, D 3 and E 4.](https://spmtuition.com/diagrams/network.svg)

*8 edges. Total degree = 3 + 3 + 3 + 3 + 4 = 16 = 2 × 8.*

A loop contributes 2 to degree. The total degree equals twice the number of edges.

### Practice questions: Vertices and edges

1. A graph has 7 edges. What is its total degree?
   A. 14
   B. 7
   C. 8
   D. 21
   **Answer:** A. 14. Each edge contributes two ends to the total degree.

2. What does an edge weight represent?
   A. Always the vertex degree
   B. Always the number of vertices
   C. A value such as travel time
   D. A new vertex
   **Answer:** C. A value such as travel time. Weights describe the quantity being optimised.

## Paths and connected graphs

![A spanning tree connects all vertices without a cycle](https://spmtuition.com/diagrams/required-spanning-tree.svg)

*A spanning tree connects all vertices without a cycle*

A connected graph has a path between every pair of vertices. A tree is connected and has no cycle.

| Tree property | Value |
| --- | --- |
| Vertices | n |
| Edges | n − 1 |

A subgraph uses some vertices and edges of the original graph. A spanning tree includes every vertex.

> **Exam tip:** A crossing of drawn edges is not a vertex unless the diagram marks a junction.

### Practice questions: Paths and connected graphs

1. How many edges does a tree with 6 vertices have?
   A. 6
   B. 5
   C. 7
   D. 12
   **Answer:** B. 5. A tree with n vertices has n − 1 edges.

## Optimise a network

![The minimum spanning tree uses edges of weight 2 and 3](https://spmtuition.com/diagrams/required-minimum-spanning-tree.svg)

*The minimum spanning tree uses edges of weight 2 and 3*

A shortest path minimises the total weight between two vertices. A minimum spanning tree connects all vertices with minimum total weight.

1. List edges in increasing weight
2. Choose the smallest available edge
3. Reject any edge that creates a cycle
4. Stop when all vertices connect

**Worked example:** A–B costs 2, B–C costs 3 and A–C costs 6. Find a minimum spanning tree.

1. Choose A–B with weight 2
2. Choose B–C with weight 3
3. All vertices connect; total weight = 2 + 3

**Answer:** Edges A–B and B–C; total weight 5

Compare route totals, not the number of edges. More edges can still give a shorter route.

### Practice questions: Optimise a network

1. What must a spanning tree include?
   A. Every edge
   B. A cycle
   C. Only two vertices
   D. Every vertex
   **Answer:** D. Every vertex. It connects all vertices without cycles.

2. Routes have weights 4 + 7 and 3 + 3 + 2. Which is shorter?
   A. The second route
   B. The first route
   C. They are equal
   D. Cannot compare
   **Answer:** A. The second route. The totals are 11 and 8. Count weight, not edges.

---

Online SPM tuition for Physics, Chemistry, Biology, Mathematics and Additional Mathematics, Form 4–5, in English or BM. Students who want tuition or extra help can request it at https://spmtuition.com/tuition/.
