Raw

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 χ\chi (vertices) and the chromatic index χ\chi' (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 aija_{ij} is the number of edges (undirected) or arcs (directed) between viv_i and vjv_j; a diagonal entry aiia_{ii} is the number of loops at viv_i. (Some texts, including L10, instead count each loop as 22 on the diagonal; this worksheet counts loops once, matching its data.)
  • Notation is fixed and self-contained. deg(v)\deg(v) is the degree; Δ(G)\Delta(G) the maximum degree; ω(G)\omega(G) the largest clique; χ(G)\chi(G) the chromatic number and χ(G)\chi'(G) 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 11). The second theme is colouring: paint the vertices so neighbours differ (the fewest colours is the chromatic number χ\chi), or the edges so those meeting at a vertex differ (the fewest is the chromatic index χ\chi'). 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.

Practical/Practical5/main.md · 3.0 KB · updated 2026-07-31 21:51