Practical Work 5 — Graphs: Representation and Colouring
Fifth practical class of Computer Discrete Mathematics. Working by hand, you move between a graph and its adjacency matrix (undirected and directed), and you colour graphs — finding the chromatic number (vertices) and the chromatic index (edges).
At a glance
| Topic | Adjacency matrix (undirected / directed, loops, multigraphs); drawing a graph from its matrix; proper vertex and edge colouring; chromatic number and index; Vizing class |
| Prerequisite lectures | L10 — Graph theory (basics) (representations §10.6, colouring §10.12) |
| Mode | In-class problem solving — pen and paper, no computer |
| Deliverable | Worked solutions to the tasks in 3classroom.md |
Contents
| # | Part | File |
|---|---|---|
| 1 | Objective | 1purpose.md |
| 2 | Methodical guidelines (self-contained theory) | 2method.md |
| 3 | Classroom tasks with solutions | 3classroom.md |
| 6 | Control questions | 6questions.md |
Conventions
- Language — all work is written in English.
- By hand. Read each matrix, draw the graph, and colour it directly; show the colour of every vertex (or edge) and the group each belongs to.
- Adjacency-matrix convention. The entry is the number of edges (undirected) or arcs (directed) between and ; a diagonal entry is the number of loops at . (Some texts, including L10, instead count each loop as on the diagonal; this worksheet counts loops once, matching its data.)
- Notation is fixed and self-contained. is the degree; the maximum degree; the largest clique; the chromatic number and the chromatic index. All are defined in 2method.md.
- Every task has a full solution. 3classroom.md gives each task together with a complete worked answer, including the drawn graph and its colouring.
Summary
A graph can be stored as a table of numbers — its adjacency matrix — and drawn back from that table; the two views are interchangeable, and the matrix instantly shows whether the graph is directed (asymmetric), has loops (non-zero diagonal), or parallel edges (entries above ). The second theme is colouring: paint the vertices so neighbours differ (the fewest colours is the chromatic number ), or the edges so those meeting at a vertex differ (the fewest is the chromatic index ). Colouring turns real conflict problems — timetabling, register allocation, frequency assignment — into a single question, how few colours are enough?, bounded below by the biggest clique and the maximum degree and, for edges, pinned by Vizing’s theorem to just two possible values.