 A colouring of a graph is an assignment of colours to each vertex so that no adjacent vertices have the same colour. Of course it has no applications in the real world. Or does it? So because I missed a meeting during the pandemic I became department chair and scheduling is my personal nightmare. Scheduling constraints include not all instructors can teach all classes, no person can be scheduled to teach two classes at the same time, and no person can be scheduled to teach more than a set number of classes. Since a graph consists of relationships between objects it is an ideal tool for solving scheduling problems. And I wish I knew that before I became chair. Now there's a lot of different scheduling problems we'll focus on one aspect known as the timetabling problem. Imagine a train schedule where trains have to be run at certain times. How many crews are needed to run all the trains? Since a crew can't run two trains simultaneously we need to make sure that there are enough crews. So one way of looking at the colouring problem is that the colour of a vertex represents metadata about the vertex itself. In this case we might consider a vertex to represent a particular train. We can then make the vertex colour correspond to the crew needed to operate it. So the timetable problem is a graph colouring problem. If each vertex represents a train and the colour of the vertex the crew required to run it what do the edges represent? In graph colouring problems adjacent vertices must have different colours so if two trains must have different crews it must be because their times overlap. And this gives us a way to construct our graph, trains are vertices, and edges connect trains whose times overlap. For example suppose the schedule for a commuter rail system is shown below, let's draw a graph representing the schedule. So we'll start out with our set of vertices a through h and these represent the trains and it doesn't matter how they're located spatially but it might be convenient to have them arranged left to right in order of say departure time. So the earliest train a will put over on the left and the latest train h will put over on the right and the other trains will be someplace in between. Now we'll want an edge to connect two trains whose times overlap so we can check each train with all the later trains so train a runs from 640 to 715 so its schedule will overlap with trains b and c. So we'll represent this by putting an edge from a to b and from a to c. Train b also overlaps with c so we'll join b and c. Train c overlaps with d so we'll join those two vertices. Train d overlaps with e and mathematically the crew of d can finish at 815 and then immediately go to train f but this isn't actually possible there's a finite amount of time it'll take to go from one train to the other so we'll put an edge between these two vertices. So again e overlaps with f g and h f overlaps with g and h and again while a crew g could instantly switch to h in practice we'll assume they can't overlap. We can solve the timetable problem by assigning colors to each vertex where adjacent vertices have different colors. Note that e has degree 4 which is the greatest in the graph so we need no more than 5 colors. So we'll choose our favorite coloring algorithm it really doesn't matter which. A will be assigned color 1. D is adjacent to a so it can't be assigned 1 so we'll assign it color 2. C is adjacent to nodes colored 1 and 2 so we'll assign it color 3. D is only adjacent to a node colored 3 so we can assign it color 1 again. E is adjacent to a node colored 1 so we can assign it color 2. F is adjacent to nodes colored 1 and 2 so we assign it color 3. is adjacent to nodes colored 2 and 3, so we assign it color 1. H is adjacent to nodes colored 1, 2, and 3, so we need to assign it a fourth color, and we've achieved a four coloring of the graph, so we need four train crews. Crew 1 to operate trains A, D, and G. Crew 2 to operate trains B and E. Crew 3 to operate trains C and F, and Crew 4 to operate train H. Now, while a four coloring exists, it is conceivable that we might need fewer colors, so we note that K4 is a subgraph of G, so three coloring is in fact impossible, so it's not possible to operate all trains with fewer than four crews.