Skip to main content
Mathematics LibreTexts

12.5: Navigating Graphs

  • Page ID
    129672
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)
    People walking through a maze of hedges.
    Figure 12.77: Visitors navigate a garden maze. (credit: “Longleat Maze” by Niki Odolphie/Wikimedia, CC BY 2.0)
    Learning Objectives
    1. Describe and identify walks, trails, paths, and circuits.
    2. Solve application problems using walks, trails, paths, and circuits.
    3. Identify the chromatic number of a graph.
    4. Describe the Four-Color Problem.
    5. Solve applications using graph colorings.

    Now that we know the basic parts of graphs and we can distinguish one graph from another, it is time to really put our graphs to work for us. Many applications of graph theory involve navigating through a graph very much like you would navigate through a maze. Imagine that you are at the entrance to a maze. Your goal is to get from one point to another as efficiently as possible. Maybe there are treasures hidden along the way that make straying from the shortest path worthwhile, or maybe you just need to get to the end fast. Either way, you definitely want to avoid any wrong turns that would cause unnecessary backtracking. Luckily, graph theory is here to help!

    Walks

    Suppose Figure 12.78 is a maze you want to solve. You want to get from the start to the end.

    A maze with its start and end labeled.
    Figure 12.78: Your Maze

    You can approach this task any way you want. The only rule is that you can’t climb over the wall. To put this in the context of graph theory, let’s imagine that at every intersection and every turn, there is a vertex. The edges that join the vertices must stay within the walls. The graph within the maze would look like Figure 12.79.

    A maze with its start and end labeled. Vertices are marked at each corner of the maze. A path connects all the vertices of the maze.
    Figure 12.79: The Graph in Your Maze

    One approach to solving a maze is to just start walking. It is not the most efficient approach. You might cross through the same intersection twice. You might backtrack a bit. It’s okay. We are just out for a walk. It might look something like the black sequence of vertices and edges in Figure 12.80.

    A maze with its start and end labeled. Vertices are marked at each corner of the maze. A path connects all the vertices of the maze. The path from start to end is highlighted.
    Figure 12.80: The Walk Through the Graph in Your Maze

    This type of sequence of adjacent vertices and edges is actually called a walk (or directed walk) in graph theory too!

    A walk can be identified by naming the sequence of its vertices (or by naming the sequence of its edges if those are labeled). Let’s take the graph out of the context of the maze and give each vertex a name and each edge of the walk a direction as in Figure 12.81.

    A graph with 19 vertices and 19 edges. The vertices are a, l, e, h, m, p, r, q, s, o, n, i, j, k, g, c, d, f, and b. The edges connect l a, a b, b f, e f, e h, h m, r s, p q, c d c j, g k, i j, j k, i n, n o, o q, and k s. The following path is highlighted p, q, o, n, i, j, k, s, and r. p is labeled start and q is labeled end. The edges from j to c and c to d are connected via double-headed arrows.
    Figure 12.81: The Graph without Your Maze

    The name of this walk from p to r is pqonijcdcjksr. When a particular edge on our graph was traveled in both directions, it had arrows in both directions and the letters of vertices that were visited more than once had to be repeated in the name of the walk.

    Checkpoint

    Not every list of vertices or list of edges makes a path. The order must take into account the way in which the edges and vertices are connected. The list must be a sequence, which means they are in order. No edges or vertices can be skipped and you cannot go off the graph.

    Two graphs are labeled graph X and graph Y. Graph X has six vertices: a, b, c, d, e, and f. The vertices a, b, and e are connected by three edges and it resembles a triangle. The vertices, c, d, and f are connected by three edges and it resembles a triangle. These two triangles overlap and the point where they overlap has no vertex. The edges from b to d and d to f are highlighted. Graph Y is the same as that of graph X. The point where they overlap has a vertex, g.
    Figure 12.82: A Walk or Not a Walk?

    The highlighted edges Graph Y in Figure 12.82 represent a walk between f and b. The highlighted edges in Graph X do not represent a walk between f and b, because there is a turn at a point that is not a vertex. This is like climbing over a wall when you are walking through a maze. Another way of saying this is that bdf is not a walk, because there is no edge between b and d.

    Checkpoint

    A point on a graph where two edges cross is not a vertex.

    Example 12.19: Naming a Walk Through A House

    Figure 12.83 shows the floor plan of a house. Use the floor plan to answer each question.

    A floor plan of a house includes the master bedroom, bedroom, kitchen, living room, hallway, garage, and restroom.
    Figure 12.83 Floor Plan of a House
    1. Draw a graph to represent the floor plan in which each vertex represents a different room (or hallway) and edges represent doorways between rooms.
    2. Name a walk through the house that begins in the living room, ends in the garage and visits each room (or hallway) at least once.
    Answer
    1. Step 1: We will need a vertex for each room and it is convenient to label them according to the names of the rooms. Visualize the scenario in your head as shown in Figure 12.84. You don’t have to write this step on your paper.
      A floor plan of a house includes the master bedroom, bedroom, kitchen, living room, hallway, garage, and restroom. The following vertices are assigned to rooms: master bedroom, M; bedroom, B; kitchen, K; living room, L; hallway, H; garage, G; and restroom, R. Edges from H lead to M, B, L, and G. Edges from L lead to K and R.
      Figure 12.84 Assigning Vertices to Rooms
      Step 2: Draw a graph to represent the scenario. Start with the vertices. Then connect those vertices that share a doorway in the floorplan as shown in Figure 12.85.
      A graph of the floor plan. The graph has seven vertices: M, B, K, H, L, G, and R. Edges from H lead to M, B, and G. Edges from L lead to K and R. An edge connects H with L.
      Figure 12.85: Graph of the Floor plan
    2. Step 1: Draw a path that begins at vertex L, representing the living room, and ending at vertex G, representing the garage making sure to visit every room at least once. There are many ways this can be done. You may want to number the edges to keep track of their order. One example is shown in Figure 12.86.
      A graph of the floor plan. The graph has seven vertices: M, B, K, H, L, G, and R. Edge 1: L to R. Edge 2: R to L. Edge 3: L to K. Edge 4: K to L. Edge 5: L to H. Edge 6: H to B. Edge 7: B to H. Edge 8: H to M. Edge 9: M to H. Edge 10: H to G.
      Figure 12.86: Draw the Path from L to G

      Step 2: Name the path that you followed by listing the vertices in the order you visited them.

      LRLKLHBHMHG

    Your Turn 12.19
    1.
    Recall from the Graph Basics section that a graph in which there are multiple edges between the same pair of vertices is called a multigraph. The figure shows a map of the four bridges that link Staten Island to Brooklyn and New Jersey and a multigraph representing the map. In the multigraph, the edges are labeled instead of the vertices. The edges represent the bridges, G (Goethals Bridge), B (Bayonne Bridge), C (Outerbridge Crossing), and V (Verrazzano-Narrows Bridge). The vertices represent New Jersey, Staten Island, and Brooklyn.
    A map and a graph of Staten Island Bridges. The map of Staten Island shows the following bridges: Bayonne Bridge, Verrazano Bridge, Goethals Bridge, and Outer bridge Crossing. The graph shows three vertices. Three edges from the first vertex lead to B, G, and C. Edges from B, G, and C lead to the second vertex. An edge from the second vertex leads to V. An edge from V leads to the third vertex.
    Figure 12.87: Map and Multigraph of Staten Island Bridges

    A path can be named by a sequences of edges instead of a sequence of vertices. Determine which of the following sequence of edges is a walk.

    1. BVCGC
    2. VCBGC
    3. CVGBB
    4. GVBVC

    Paths and Trails

    A walk is the most basic way of navigating a graph because it has no restrictions except staying on the graph. When there are restrictions on which vertices or edges we can visit, we will call the walk by a different name. For example, if we want to find a walk that avoids travelling the same edge twice, we will say we want to find a trail (or directed trail). If we want to find a walk that avoids visiting the same vertex twice, we will say, we want to find a path (or directed path).

    Walks, trails, and paths are all related.

    1. All paths are trails, but trails that visit the same vertex twice are not paths.
    2. All trails are walks, but walks in which an edge is visited twice would not be trails.

    We can visualize the relationship as in Figure 12.88.

    Three concentric ovals represent paths, trails, and walks. The first (inner) oval labeled paths reads, no repeated edges or vertices. The second oval labeled trails reads, no repeated edges. The third oval is labeled walks.
    Figure 12.88: Walks, Trails, and Paths

    Let’s practice identifying walks, trails, and paths using the graphs in Figure 12.89.

    Two graphs are labeled graph A and graph K. Graph A has five vertices: b, c, d, e, and f. The edges connect b c, c f, b d, b e, d e, and e f. Graph K has five vertices: m, n, o, p, and q. The edges connect m n, n o, n q, q o, o p, n p, and m p.
    Figure 12.89: Graphs A and K
    Example 12.20: Identifying Walks, Paths, and Trails

    Consider each sequence of vertices from Graph A in Figure 12.89. Determine if it is only a walk, both a walk and a path, both a walk and a trail, all three, or none of these.

    1. bcdef
    2. cbdbe
    3. cfedbc
    4. befcbd
    Answer
    1. First, check to see if the sequence of vertices is a walk by making sure that the vertices are consecutive. As you can see in Figure 12.90, there is no edge between vertex c and vertex d.
      Graph A has five vertices: b, c, d, e, and f. The edges connect b c, c f, b d, b e, d e, and e f. A sequence of arrows flows from b to c, c to d, d to e, and e to f.
      Figure 12.90
       

    This means that the sequence is not a walk. If it is not a walk, then it can’t be a path and it cannot be a trail, so, it is none of these.

    • First, check to see if the sequence is a walk. As you can see in Figure 12.91, the vertices are consecutive.
      Graph A has five vertices: b, c, d, e, and f. The edges connect b c, c f, b d, b e, d e, and e f. An arrow labeled 1 flows from c to b. An arrow labeled 2 flows from b to d. An arrow labeled 3 flows from d to e. An arrow labeled 4 flows from b to e.
      Figure 12.91:

      This means that the sequence is a walk. Since the vertex b is visited twice, this walk is not a path. Since edge bdbd is traveled twice, this walk is not a trail. So, the sequence is only a walk.

    • First, check to see if the sequence is a walk. We can see in Figure 12.92 that the vertices are consecutive, which means it is a walk.
      Graph A has five vertices: b, c, d, e, and f. The edges connect b c, c f, b d, b e, d e, and e f. An arrow labeled 1 flows from c to f. An arrow labeled 2 flows from f to e. An arrow labeled 3 flows from e to d. An arrow labeled 4 flows from d to b. An arrow labeled 5 flows from b to c.
      Figure 12.92:

      Next, check to see if any vertex is visited twice. Remember, we do not consider beginning and ending at the same vertex to be visiting a vertex twice. So, no vertex was visited twice. This means we have a walk that is also a path. Next check to see if any edge was visited twice; none were. So, the sequence is a walk, a path, and a trail.

    • First, check to see if the sequence is a walk. We can see in Figure 12.93 that the vertices are consecutive, which means it is a walk.
      Graph A has five vertices: b, c, d, e, and f. The edges connect b c, c f, b d, b e, d e, and e f. An arrow labeled 1 flows from b to e. An arrow labeled 2 flows from e to f. An arrow labeled 3 flows from f to c. An arrow labeled 4 flows from c to b. An arrow labeled 5 flows from b to d.
      Figure 12.93:

      Next check to see if any vertex is visited twice. Since vertex b is visited twice, this is not a path. Finally, check to see if any edges are traveled twice. Since no edges are traveled twice, this is a trail. So, the sequence of vertices is a walk and a trail.

    Your Turn 12.20

    Consider each sequence of vertices from Graph K in Figure 12.106. Determine if it is only a walk, both a walk and a path, both a walk and a trail, all three, or none of these.

    nqop

    pnqonm

    mnopq

    Circuits

    In many applications of graph theory, such as creating efficient delivery routes, beginning and ending at the same location is a requirement. When a walk, path, or trail end at the same location or vertex they began, we call it closed. Otherwise, we call it open (does not begin and end at the same location or vertex). Some examples of closed walks, closed trails, and closed paths are given in in the following table.

    DESCRIPTION EXAMPLE CHARACTERISTICS
    A closed walk is a walk that begins and ends at the same vertex.
    A graph has five vertices: b, c, d, e, and f. All the vertices are interconnected. An arrow labeled 1 flows from d to f. An arrow labeled 2 flows from f to b. An arrow labeled 3 flows from b to c. An arrow labeled 4 flows from c to f. An arrow labeled 5 flows from f to d.

    dfbcfd

    Alternating sequence of vertices and edges

    Begins and ends at the same vertex

    A closed trail is a trail that begins and ends at the same vertex. It is commonly called a circuit.

    A graph has five vertices b, c, d, e, and f. All the vertices are interconnected. An arrow labeled 1 flows from d to f. An arrow labeled 2 flows from f to b. An arrow labeled 3 flows from b to c. An arrow labeled 4 flows from c to f. An arrow labeled 5 flows from f to e. An arrow labeled 6 flows from e to d.

    dfbcfed

    No repeated edges

    Begins and ends at the same vertex

    A closed path is a path that begins and ends at the same vertex. It is also referred to as a directed cycle because it travels through a cyclic subgraph.

    A graph has five vertices b, c, d, e, and f. All the vertices are interconnected. An arrow labeled 1 flows from d to f. An arrow labeled 2 flows from f to b. An arrow labeled 3 flows from b to c. An arrow labeled 4 flows from c to d.

    dfbcd

    No repeated edges or vertices

    Begins and ends at the same vertex

    Table 12.4 Closed Walks, Trails, and Paths

    Since walks, trails, and paths are all related, closed walks, circuits, and directed cycles are related too.

    1. All circuits are closed walks, but closed walks that visit the same edge twice are not circuits.
    2. All directed cycles are circuits, but circuits in which a vertex is visited twice are not directed cycles.

    We can visualize the relationship as in Figure 12.94.

    Three concentric ovals represent directed cycles, circuits, and closed walks. The first (inner) oval labeled directed cycles (closed paths) reads, no repeated edges or vertices. The second oval labeled circuits (closed talks) reads, no repeated edges. The third oval is labeled closed walks.
    Figure 12.94: Closed Walks, Circuits, and Directed Cycles

    The same circuit can be named using any of its vertices as a starting point. For example, the circuit dfbcd can also be referred to in the following ways.

    abcda is the same as

    { bcdabcdabcdabcd{ bcdabcdabcdabcd

    Let’s practice working with closed walks, circuits (closed trails), and directed cycles (closed paths). In the graph in Figure 12.95, the vertices are major central and south Florida airports. The edges are direct flights between them.

    A graph represents the direct flights between Central and South Florida airports. The graph has six vertices: T P A, M C O, P B I, F L L, M I A, and E Y W. Edges from T P A lead to E Y W, M I A, F L L, and P B I. Edges from M C O lead to E Y W, M I A, and F L L. An edge from E Y W leads to F L L.
    Figure 12.95: Major Central and South Florida Airports
    Example 12.21: Determining a Closed Walk, Circuit, or Directed Cycle

    Suppose that you need to travel by air from Miami (MIA) to Orlando (MCO) and you were restricted to flights represented on the graph. For the trip to Orlando, you decide to purchase tickets with a layover in Key West (EYW) as shown in Figure 12.96, but you still have to decide on the return trip. Determine if your roundtrip itinerary is a closed walk, a circuit, and/or a directed cycle, based on the return trip described in each part.

    A graph represents the direct flights between Central and South Florida airports. The graph has six vertices: T P A, M C O, P B I, F L L, M I A, and E Y W. Edges from T P A lead to E Y W, M I A, F L L, and P B I. Edges from M C O lead to E Y W, M I A, and F L L. An edge from E Y W leads to F L L. An arrow from M I A points to E Y W. An arrow from E Y W points to M C O.
    Figure 12.96 MIA to EYW to MCO
    1. You returned to Miami (MIA) by reversing your route.
    2. Your direct flight back left Orlando (MCO) but was diverted to Fort Lauderdale (FLL)! From there you flew to Tampa (TPA) before returning to Miami (MIA).
    Answer
    1. The whole trip was MIAEYWMCOEYWMIA. This is a closed walk, because it is a walk that begins and ends at the same vertex. It is not a circuit, because it repeats edges. If it is not a circuit, then it cannot be a directed cycle.
    2. The whole trip was MIAEYWMCOFLLTPAMIA. This is a closed walk, because it is a walk that begins and ends at the same vertex. It is a circuit because no edges were repeated. It is also a directed cycle because no vertices were repeated either. So, it is all three!
    Your Turn 12.21

    Suppose that you want to travel from Palm Beach (PBI) to any other city listed in Figure 12.113 and then return to Palm Beach.

    Why is it impossible to find an itinerary that is a circuit?

    How is this related to the degree of the vertex PBI?

    Graph Colorings

    In this section so far, we have looked at how to navigate graphs by proceeding from one vertex to another in a sequence that does not skip any vertices, but in some applications we may want to skip vertices. Remember the camp Olympics at Camp Woebegone in Comparing Graphs? You were planning a camp Olympics with four events. The campers signed up for the events. You drew a graph to help you visualize which events have campers in common. The vertices of Graph E in Figure 12.97 represent the events and adjacent vertices indicate that there are campers who are participating in both.

    A graph with four vertices: a, b, c, and d. The edges connect a b, b d, d c, and c a.
    Figure 12.97: Graphs of Camp Olympics

    In this case, we do NOT want events represented by two adjacent vertices to occur in the same timeslot, because that would prevent the campers who wanted to participate in both from doing so. We can use the graph in Figure 12.97 to count the timeslots we need so there are no conflicts. Let’s assign each timeslot a different color. We could categorize events that happen at 1 pm as Red; 2 pm, Purple; 3 pm, Blue; and 4 pm, Green. Then assign different colors to any pair of adjacent vertices to ensure that the events they represent do not end up in the same timeslot. Figure 12.98 shows several of the ways to do this while obeying the rule that no pair of adjacent vertices can be the same color.

    Three graphs are labeled graph 1, graph 2, and graph 3. Graph 1 has four vertices: a, b, c, and d in blue, green, purple, and red, respectively. Graph 2 has four vertices: a, b, c, and d in blue, purple, purple, and red, respectively. Graph 3 has four vertices: a, b, c, and d in red, purple, purple, and red, respectively. In each graph, the edges connect a b, b d, d c, and c a.
    Figure 12.98: Graph Colorings

    In Figure 12.98, the graphs with vertices colored so that no adjacent vertices are the same color are called graph colorings. Notice that Graph 3 has the fewest colors, which means it shows us how to have the fewest number of timeslots. The events marked in red, a and d, can be held at the same time because they are not adjacent and do not have conflicts. Also, the events marked in purple, b and c, can be held at the same time. We would not need green or blue timeslots at all!

    A graph that uses nn colors is called an nn-coloring. The smallest number of colors needed to color a particular graph is called its chromatic number.

    Graph colorings can be used in many applications like the scheduling scenario at camp Woebegone. Let's look at how they work in more detail. Figure 12.99 shows two different colorings of a particular graph. Coloring A is called a four-coloring, because it uses four colors, red (R), green (G), blue (B), and purple (P). Coloring B is called a three-coloring because it uses three. The colors allow us to visually subdivide the graphs into groups. The only rule is that adjacent vertices are different colors so that they are in different groups.

    Two graphs are labeled coloring A and coloring B In the first graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: B, G, and R. Row 2: G, R, and P. Row 3: P, B, and G. The outer vertices are connected to form a square. A vertical line and a horizontal line at the center connect G R, R B, G R, and R P. Diagonal lines connect B R, R G, G B, and G P. In the second graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: B, G, and R. Row 2: G, R, and B. Row 3: R, B, and G. The outer vertices are connected to form a square. A vertical line and a horizontal line at the center connect G R, R B, G R, and R B. Diagonal lines connect B R, R G, G B, and G B.
    Figure 12.99: Two Colorings of the Same Graph

    It turns out that a three-coloring is the best we can do with the graph in Figure 12.99. No matter how many different patterns you try with only two colors, you will never find one in which the adjacent vertices are always different colors. In other words, the graph has a chromatic number of three. For large graphs, computer assistance is usually required to find the chromatic numbers. There is no formula for finding the chromatic number of a graph, but there are some facts that are helpful in Table 12.5.

    Fact Example
    Recall that planar graphs are untangled; that is, they can be drawn on a flat surface so that no two edges are crossing. If a graph is planar, it can be colored with four colors or possibly fewer.
    Three graphs. The first graph titled tangled has nine vertices labeled a to i. The edges connect a b, a d, a e, c e, e g, e i, g f, f i, and i h. The second graph titled untangled has nine vertices labeled a to i. The edges connect a b, a d, a e, e c, e g, e i, i h, i f, and g f. The third graph titled 4 or fewer colors has nine vertices a to i in red, green, green, green, blue, blue, green, blue, and red. The edges connect a b, a d, a e, e c, e g, e i, i h, i f, and g f.

    Each vertex in a complete graph is adjacent to every other vertex forcing us to color them all different colors.The chromatic number of a complete graph is the same as the number of vertices.

    Two graphs. The first graph has five vertices in red, blue, green, yellow, and purple. All vertices are interconnected. Text reads, 5 vertices and 5 colors. The second graph has four vertices in red, blue, green, and purple. All vertices are interconnected. Text reads, 4 vertices, and 4 colors.

    If a graph has a clique, a complete subgraph, then each vertex in the clique must have a different color and the vertices outside the clique may or may not have even more colors. The chromatic number of a graph is at least the number of vertices in its biggest clique.

    Two graphs. The first graph has five vertices in red, green, purple, green, and red. The edges connect R with G, R with P, G with P, P with second G, and second G with the second R. The three colors, R, G, and P are outlined. The second graph has six vertices in red, blue, green, purple, blue, and red. The first four vertices are interconnected and outlined. Purple is connected with the fifth vertex, blue. The fifth vertex is connected to the sixth vertex, red.
    Table 12.5 Facts about Graph Colorings

    Creating Colorings to Solve Problems

    Let’s see how these facts can help us color the graph in Figure 12.100.

    • Since the graph is planar, the chromatic number is no more than four.
    • The graph is not complete, but it has complete subgraphs of three vertices. In other words, it has triangles like the one shown with blue vertices in Figure 12.100. This means that the chromatic number is at least three.
    A graph has nine vertices arranged in 3 rows and 3 columns. The outer vertices are connected to form a square. A vertical line and a horizontal line at the center connect the vertices along the lines. Diagonal lines from top-left to bottom-right connect the vertices along the lines. The vertices at the top-left, left-center, and center are highlighted in grey.
    Figure 12.100: A Graph with Triangles

    We know we can color this graph in three or four colors. It is usually best to start by coloring the vertex of highest degree as shown in Figure 12.101. In this case, we used red (R). The color is not important.

    Two graphs are labeled degrees of vertices and degree 6 vertex colored first. In the first graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: 3, 4, and 2. Row 2: 4, 6, and 4. Row 3: 2, 4, and 3. In the second graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: 3, 4, and 2. Row 3: 4, R, and 4. Row 3: 2, 4, and 3. In each graph, the outer vertices are connected to form a square. A vertical line and a horizontal line at the center connect the vertices along the lines. Diagonal lines from top-left to bottom-right connect the vertices along the lines. An arrow from the first graph points to the second graph.
    Figure 12.101: Color Highest Degree Vertex First

    We want to color as many of the vertices the same color as possible; so, we look at all the vertices that are not adjacent to the red vertex and begin to color them, red starting with the one among them of highest degree. Since the only vertices that are not adjacent are both degree 2, choose either one and color it red as shown in Figure 12.102.

    Two graphs. In the first graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: 3, 4, and 2. Row 3: 4, R, and 4. Row 3: 2, 4, and 3. 2 in the top-right and bottom-left vertices are outlined. In the second graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: 3, 4, and R. Row 2: 4, R, and 4. Row 3: 2, 4, and 3. In each graph, the outer vertices are connected to form a square. A vertical line and a horizontal line at the center connect the vertices along the lines. Diagonal lines from top-left to bottom-right connect the vertices along the lines. An arrow from the first graph points to the second graph.
    Figure 12.102: Color More Red from Highest to Lowest Degree

    Now, there is only one vertex left that is not adjacent to a red; so, color it red. Of the remaining vertices, the highest degree is four; so, color one of the vertices of degree four in a different color. These two steps are shown in Figure 12.103.

    Two graphs. In the first graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: 3, 4, and R. Row 3: 4, R, and 4. Row 3: R, 4, and 3. In the second graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: 3, B, and R. Row 2: 4, R, and 4. Row 3: R, 4, and 3. In each graph, the outer vertices are connected to form a square. A vertical line and a horizontal line at the center connect the vertices along the lines. Diagonal lines from top-left to bottom-right connect the vertices along the lines. An arrow from the first graph points to the second graph.
    Figure 12.103: Complete the Reds and Start Another Color

    Repeat the same procedure. There are three remaining vertices that are not adjacent to a blue. Color as many blue as possible, with priority going to vertices of higher degree as shown in Figure 12.104.

    Three graphs. In the first graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: 3, B, and R. Row 3: 4, R, and 4. Row 3: R, 4, and 3. 4 in the left-center and bottom-center vertices are outlined. 3 in the bottom-right vertex is outlined. In the second graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: 3, B, and R. Row 2: B, R, and 4. Row 3: R, 4, and 3. 3 in the bottom-right vertex is outlined. In the third graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: 3, B, and R. Row 2: B, R, and 4. Row 3: R, 4, and B. In each graph, the outer vertices are connected to form a square. A vertical line and a horizontal line at the center connect the vertices along the lines. Diagonal lines from top-left to bottom-right connect the vertices along the lines. An arrow from the first graph points to the second graph. An arrow from the second graph points to the third graph.
    Figure 12.104: Repeat Procedure for Color Blue

    All the remaining vertices are adjacent to blue. So, it is time to repeat the procedure with another color as shown in Figure 12.105.

    Three graphs. In the first graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: 3, B, and R. Row 3: B, R, and P. Row 3: R, 4, and B. 3 in the top-left vertex is outlined. 4 in the bottom-center is outlined. In the second graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: 3, B, and R. Row 2: B, R, and P. Row 3: R, P, and B. 3 in the top-left vertex is outlined. In the third graph, nine vertices are present. The vertices are arranged in 3 rows and 3 columns. Row 1: P, B, and R. Row 2: B, R, and P. Row 3: R, P, and B. In each graph, the outer vertices are connected to form a square. A vertical line and a horizontal line at the center connect the vertices along the lines. Diagonal lines from top-left to bottom-right connect the vertices along the lines. An arrow from the first graph points to the second graph. An arrow from the second graph points to the third graph.
    Figure 12.105: Repeat Procedure for Color Purple

    All the vertices are now colored with a three-coloring so we know the chromatic number is at most three, but we knew the chromatic number was at least three because the graph has a triangle. So, we are now certain it is exactly three.

    Suppose the vertices of the graph in Figure 12.106 represented the nine events in the Camp Woebegone Olympics, and edges join any events that have campers in common, but nonadjacent vertices do not.

    A graph has nine vertices. The vertices are arranged in 3 rows and 3 columns. Row 1: P, B, and R. Row 2: B, R, and P. Row 3: R, P, and B. In each graph, the outer vertices are connected to form a square. A vertical line and a horizontal line at the center connect the vertices along the lines. Diagonal lines from top-left to bottom-right connect the vertices along the lines.
    Figure 12.106: Coloring for Nine Event Camp Woebegone Olympics

    Any vertices of the same color are nonadjacent; so, they have no conflicts. Since this graph is a three-coloring, all nine events could be scheduled in just three timeslots!

    Example 12.22: Understanding Chromatic Numbers

    In Example 12.17, we discussed a high school, which holds end-of-course exams in (E3) English 3, (E4) English 4, (M) Advanced Math, (C) Calculus, (W) World History, (U) U.S. History, (B) Biology, and (P) Physics. We were given a list of courses that had no students in common. We used that information to find the graph in Figure 12.71, which shows edges between exams with students in common. Use the graph we found in Example 12.17 to answer each question.

    A graph has eight vertices. The vertices are P, B, U, W, C, M, E 4, and E 3. Edges from P lead to E 3, B, U, W, and C. Edges from B lead to U, W, C, M, and E 4. Edges from U lead to E 3, M, and C. Edges from W lead to E 4, M, and C. An edge from C leads to E 3. An edge from M leads to E 3.
    Figure 12.107 Graph of Exams with Students in Common
    1. The graph contains a clique of size 4 formed by the vertices P, E3, C, and U. What does this tell you about the chromatic number?
    2. The graph is not planar, meaning that you cannot untangle it. What does this tell you about the chromatic number?
    3. Create a coloring by coloring vertex of highest degree first, coloring as many other vertices as possible each color from highest to lowest degree, then repeating this process for the remaining vertices.
    4. Do you know what the minimum number of timeslots is? If so, what is it and how do you know? If not, what are the possibilities?
    Answer
    A graph has eight vertices. The vertices are P, B, U, W, C, M, E 4, and E 3 and their corresponding degrees are 5, 6, 5, 5, 5, 4, 2, and 4. Edges from P lead to E 3, B, U, W, and C. Edges from B lead to U, W, C, M, and E 4. Edges from U lead to E 3, M, and C. Edges from W lead to E 4, M, and C. An edge from C leads to E 3. An edge from M leads to E 3. Vertex B is colored in red.
    A graph has eight vertices. The vertices are P, B, U, W, C, M, E 4, and E 3 and their corresponding degrees are 5, 6, 5, 5, 5, 4, 2, and 4. Edges from P lead to E 3, B, U, W, and C. Edges from B lead to U, W, C, M, and E 4. Edges from U lead to E 3, M, and C. Edges from W lead to E 4, M, and C. An edge from C leads to E 3. An edge from M leads to E 3. Vertices B and E 3 are colored in red.
    1. We would need four different colors just for the clique with four vertices; so, the chromatic number is at least four.
    2. It is possible for the chromatic number to be greater than four.
    3. The process is shown in Table 12.6.
      A graph has eight vertices. The vertices are P, B, U, W, C, M, E 4, and E 3 and their corresponding degrees are 5, 6, 5, 5, 5, 4, 2, and 4. Edges from P lead to E 3, B, U, W, and C. Edges from B lead to U, W, C, M, and E 4. Edges from U lead to E 3, M, and C. Edges from W lead to E 4, M, and C. An edge from C leads to E 3. An edge from M leads to E 3.
    4. This is the original graph. Vertex B has highest degree. Color vertex B. Vertex E3 is the only remaining vertex that is NOT adjacent to B. Color vertex E3 the same color. Vertices P, U, W, and C are the remaining vertices with highest degree. Pick one to color.
      A graph has eight vertices. The vertices are P, B, U, W, C, M, E 4, and E 3 and their corresponding degrees are 5, 6, 5, 5, 5, 4, 2, and 4. Edges from P lead to E 3, B, U, W, and C. Edges from B lead to U, W, C, M, and E4. Edges from U lead to E 3, M, and C. Edges from W lead to E 4, M, and C. An edge from C leads to E 3. An edge from M leads to E 3. The vertices, B and E 3 are in red. The vertex, P is in blue.
      A graph has eight vertices. The vertices are P, B, U, W, C, M, E 4, and E 3 and their corresponding degrees are 5, 6, 5, 5, 5, 4, 2, and 4. Edges from P lead to E 3, B, U, W, and C. Edges from B lead to U, W, C, M, and E4. Edges from U lead to E 3, M, and C. Edges from W lead to E 4, M, and C. An edge from C leads to E 3. An edge from M leads to E 3. The vertices, B and E 3 are in red. The vertices, P and B are in blue.
      A graph has eight vertices. The vertices are P, B, U, W, C, M, E 4, and E 3 and their corresponding degrees are 5, 6, 5, 5, 5, 4, 2, and 4. Edges from P lead to E 3, B, U, W, and C. Edges from B lead to U, W, C, M, and E4. Edges from U lead to E 3, M, and C. Edges from W lead to E 4, M, and C. An edge from C leads to E 3. An edge from M leads to E 3. The vertices, B and E 3 are in red. The vertices, P, E 4, and M are in blue.
      Color vertex P a new color. Vertices E4 and M are NOT adjacent to P, and M has higher degree. Color vertex M the same color. Vertex E4 is the only remaining vertex NOT adjacent to P or M. Color vertex E4 the same color. Vertices U, W, and C are the remaining vertices with highest degree. Pick one to color.
      A graph has eight vertices. The vertices are P, B, U, W, C, M, E 4, and E 3 and their corresponding degrees are 5, 6, 5, 5, 5, 4, 2, and 4. Edges from P lead to E 3, B, U, W, and C. Edges from B lead to U, W, C, M, and E 4. Edges from U lead to E 3, M, and C. Edges from W lead to E 4, M, and C. An edge from C leads to E 3. An edge from M leads to E 3. The vertices, B and E 3 are in red. The vertices, P, E 4, and M are in blue. The vertex, U is in purple.
      A graph has eight vertices. The first graph has eight vertices. The vertices are P, B, U, W, C, M, E 4, and E 3 and their corresponding degrees are 5, 6, 5, 5, 5, 4, 2, and 4. Edges from P lead to E 3, B, U, W, and C. Edges from B lead to U, W, C, M, and E 4. Edges from U lead to E 3, M, and C. Edges from W lead to E 4, M, and C. An edge from C leads to E 3. An edge from M leads to E 3. The vertices, B and E 3 are in red. The vertices, P, E 4, and M are in blue. The vertices, U and W are in purple.
      A graph has eight vertices. The first graph has eight vertices. The vertices are P, B, U, W, C, M, E 4, and E 3 and their corresponding degrees are 5, 6, 5, 5, 5, 4, 2, and 4. Edges from P lead to E 3, B, U, W, and C. Edges from B lead to U, W, C, M, and E 4. Edges from U lead to E 3, M, and C. Edges from W lead to E 4, M, and C. An edge from C leads to E 3. An edge from M leads to E 3. The vertices, B and E 3 are in red. The vertices, P, E 4, and M are in blue. The vertices, U and W are in purple. The vertex, C is in green.
      Color U a new color. Vertex W is the only remaining vertex NOT adjacent to U. Color vertex W the same color. Vertex C is the only remaining vertex that has NOT been colored. Color vertex C a new color. The coloring is final. We used four colors.
      Table 12.6 Coloring the Graph

      The last graph in Table 12.6 is the final coloring.

    5. Yes, the minimum number of times slots is the chromatic number. We knew the chromatic number had to be at least four because there was a clique with four vertices. Now we have found a four-coloring of the graph which tells us that the chromatic number is at most four. So, we know four must be the chromatic number.
    Checkpoint

    The procedure used in Example 22 to color the graph is not guaranteed to result in a graph that has the minimum number of colors possible, but it is usually results in a coloring that is close to the chromatic number.

    Your Turn 12.22
    The given figure shows the same graph colored in several ways. The largest clique of the graph has three vertices. Use this information to answer each question.
    Three graphs. Graph 1 has 2 vertices in red, 2 vertices in blue, 1 vertex in purple, and 2 vertices in green. Edges from the first red vertex lead to two blue vertices, one green vertex, and one purple vertex. An edge from the second blue vertex leads to the purple vertex. Edges from the purple vertex lead to the second red and second green vertices. Graph 2 has 1 vertex in red, 3 vertices in blue, 2 vertices in green, and 1 vertex in purple. Edges from the red vertex lead to the green vertices, one blue vertex, and one purple vertex. The two green vertices are connected by an edge. The first blue connects with the purple via an edge. The purple connects with the other two blue vertices via edges. The second and third blue vertices are connected by an edge. Graph 3 has 1 red vertex, 2 orange vertexes, 1 green vertex, 2 blue vertices, and 1 purple vertex. Edges from the red vertex lead to orange, green, purple, and blue vertices. The first orange vertex connects with the green. The first blue connects with the first purple. This purple connects with the second orange and second blue vertices via edges. The second orange and the second blue are connected via an edge.
    Figure 12.108: Possible Colorings of the Same Graph

    Is the graph planar? What does your answer tell you about the chromatic number?

    What is the lowest possible chromatic number of this graph based on the size of any cliques?

    What are the possible chromatic numbers?

    Which graph or graphs meet the definition of a valid graph coloring?

    Draw an \(n\)-coloring for the graph where \(n\) is the answer to Exercise 1.

    The Four Color Problem

    Two figures. The first figure shows a rectangle divided into several small blocks. The second figure is the same as that of the first figure with the addition that the blocks are shaded in 4 different colors.
    Figure 12.109: Using only four colors, no two adjacent regions have the same color.

    The idea of coloring graphs to solve problems was inspired by one of the most famous problems in mathematics, the “four color problem.” The idea was that, no matter how complicated a map might be, only four colors were needed to color the map so that no two regions that shared a boundary would be the same color. For many years, everyone suspected this to be true, because no one could create a map that needed more than four colors, but they couldn’t prove it was true in general. Finally, graphs were used to solve the problem!

    We saw how maps can be represented as graphs in Graph Basics. Figure 12.110 from Example 12.4 shows a map of the midwestern region of the United States.

    A partial map of the USA with midwestern states. The Midwestern states are North Dakota, South Dakota, Nebraska, Kansas, Minnesota, Iowa, Missouri, Wisconsin, Illinois, Indiana, Michigan, and Ohio.
    Figure 12.110: Map of Midwestern States

    Figure 12.111 shows how this map can be associated with a graph in which each vertex represents a state and each edge indicates the states that share a common boundary. Figure 12.112 shows the final graph.

    A partial map of the USA with midwestern states. The Midwestern states are North Dakota (N D), South Dakota (S D), Nebraska (N E), Kansas (K S), Minnesota (M N), Iowa (I A), Missouri (M O), Wisconsin (W I), Illinois (I L), Indiana (I N), Michigan (M I), and Ohio (O H). Edges from N D connect with S D and M N. Edges from S D connect with N E, I A, and M N. Edges from M N connect with I A and W I. Edges from N E connect with K S, M O, and I A. Edges from I A connect with M O and I L. Edges from W I connect with I A and I L. An edge from K S connects with M O. An edge from M O connects with I L. An edge from I L connects with I N. Edges from I N connect with M I and O H. An edge from M I connects with O H.
    Figure 12.111: Edge Assigned to Each Pair of Midwestern States with Common Border
    A graph represents common boundaries between midwestern states. The vertices are North Dakota (N D), South Dakota (S D), Nebraska (N E), Kansas (K S), Minnesota (M N), Iowa (I A), Missouri (M O), Wisconsin (W I), Illinois (I L), Indiana (I N), Michigan (M I), and Ohio (O H). Edges from M N connect with I A and W I. Edges from N E connect with K S, M O, and I A. Edges from I A connect with M O and I L. Edges from W I connect with I A and I L. An edge from K S connects with M O. An edge from M O connects with I L. An edge from I L connects with I N. Edges from I N connect with M I and O H. An edge from M I connects with O H.
    Figure 12.112: Final Graph Representing Common Boundaries between Midwestern States

    Notice that the graph representing the common boundaries between midwestern states is planar, meaning that it can be drawn on a flat surface without edges crossing. As we have seen, any planar graph has a chromatic number of four or less. This very well-known fact is called the Four-Color Theorem, or Four-Color Map Theorem.

    People in Mathematics: Four-Color Theorem

    In the 19th century, Francis Guthrie was coloring a map of British counties and noticed that he could color so that no two adjacent counties were the same color using only four colors. This seemed to be the case for other maps as well, but he could not figure out why. He shared this with his brother, Frederick, who subsequently took the problem to his professor, August De Morgan, one of the most famous mathematicians of all time. De Morgan never was able to solve the problem, but he shared it with his colleagues. The problem continued to intrigue and perplex mathematicians for over a hundred years, inspiring discoveries in several areas of mathematics. It was finally proven by Kenneth Appel and Wolfgang Haken from the University of Illinois in 1976 using a combination of computer-aided calculations and graph theory. This was the first time in history that a mathematical theorem was proven using a computer! (Jesus Najera, “The Four-Color Theorem,” Cantor’s Paradise, a Medium publication, October 22, 2019)

    Example 12.23: Using Four Colors or Fewer to Color a Graph

    Find a coloring of the graph in Figure 12.110, which uses four colors or fewer. Use the resulting coloring as a guide to recolor the map in Figure 12.112. How many colors did you use? Does this support the conclusion of the Four-Color Theorem? If so, how?

    Answer

    The steps to color the graph are shown in Table 12.7.

    A graph represents common boundaries between midwestern states. The vertices are North Dakota (N D), South Dakota (S D), Nebraska (N E), Kansas (K S), Minnesota (M N), Iowa (I A), Missouri (M O), Wisconsin (W I), Illinois (I L), Indiana (I N), Michigan (M I), and Ohio (O H). Edges from M N connect with I A and W I and their corresponding degrees are 2, 4, 4, 2, 4, 6, 4, 4, 4, 3, 3, and 2. Edges from N E connect with K S, M O, and I A. Edges from I A connect with M O and I L. Edges from W I connect with I A and I L. An edge from K S connects with M O. An edge from M O connects with I L. An edge from I L connects with I N. Edges from I N connect with M I and O H. An edge from M I connects with O H.
    A graph represents common boundaries between midwestern states. Each graph infers the following data. The vertices are North Dakota (N D), South Dakota (S D), Nebraska (N E), Kansas (K S), Minnesota (M N), Iowa (I A), Missouri (M O), Wisconsin (W I), Illinois (I L), Indiana (I N), Michigan (M I), and Ohio (O H). Edges from M N connect with I A and W I and their corresponding degrees are 2, 4, 4, 2, 4, 6, 4, 4, 4, 3, 3, and 2. Edges from N E connect with K S, M O, and I A. Edges from I A connect with M O and I L. Edges from W I connect with I A and I L. An edge from K S connects with M O. An edge from M O connects with I L. An edge from I L connects with I N. Edges from I N connect with M I and O H. An edge from M I connects with O H. I A is in red.
    A graph represents common boundaries between midwestern states. Each graph infers the following data. The vertices are North Dakota (N D), South Dakota (S D), Nebraska (N E), Kansas (K S), Minnesota (M N), Iowa (I A), Missouri (M O), Wisconsin (W I), Illinois (I L), Indiana (I N), Michigan (M I), and Ohio (O H). Edges from M N connect with I A and W I and their corresponding degrees are 2, 4, 4, 2, 4, 6, 4, 4, 4, 3, 3, and 2. Edges from N E connect with K S, M O, and I A. Edges from I A connect with M O and I L. Edges from W I connect with I A and I L. An edge from K S connects with M O. An edge from M O connects with I L. An edge from I L connects with I N. Edges from I N connect with M I and O H. An edge from M I connects with O H. I A and M I are in red.

    Step 1: Graph with degrees of vertices labeled.

    Vertex IA has highest degree.

    Step 2: Color vertex IA any color.

    Vertices ND, KS, MI, OH, and IN are NOT adjacent to IA.

    MI and IN have highest degree, 3.

    Step 3: Color either MI or IN the same color as IA.

    Vertex ND and KS are the only remaining vertices not adjacent to a red vertex.

    They both have degree 2.

    A graph represents common boundaries between midwestern states. The vertices are North Dakota (N D), South Dakota (S D), Nebraska (N E), Kansas (K S), Minnesota (M N), Iowa (I A), Missouri (M O), Wisconsin (W I), Illinois (I L), Indiana (I N), Michigan (M I), and Ohio (O H). Edges from M N connect with I A and W I and their corresponding degrees are 2, 4, 4, 2, 4, 6, 4, 4, 4, 3, 3, and 2. Edges from N E connect with K S, M O, and I A. Edges from I A connect with M O and I L. Edges from W I connect with I A and I L. An edge from K S connects with M O. An edge from M O connects with I L. An edge from I L connects with I N. Edges from I N connect with M I and O H. An edge from M I connects with O H. N D, I A, and K S are in red.
    A graph represents common boundaries between midwestern states. The vertices are North Dakota (N D), South Dakota (S D), Nebraska (N E), Kansas (K S), Minnesota (M N), Iowa (I A), Missouri (M O), Wisconsin (W I), Illinois (I L), Indiana (I N), Michigan (M I), and Ohio (O H). Edges from M N connect with I A and W I and their corresponding degrees are 2, 4, 4, 2, 4, 6, 4, 4, 4, 3, 3, and 2. Edges from N E connect with K S, M O, and I A. Edges from I A connect with M O and I L. Edges from W I connect with I A and I L. An edge from K S connects with M O. An edge from M O connects with I L. An edge from I L connects with I N. Edges from I N connect with M I and O H. An edge from M I connects with O H. N D, I A, K S, and M I are in red. S D is in blue.
    A graph represents common boundaries between midwestern states. The vertices are North Dakota (N D), South Dakota (S D), Nebraska (N E), Kansas (K S), Minnesota (M N), Iowa (I A), Missouri (M O), Wisconsin (W I), Illinois (I L), Indiana (I N), Michigan (M I), and Ohio (O H). Edges from M N connect with I A and W I and their corresponding degrees are 2, 4, 4, 2, 4, 6, 4, 4, 4, 3, 3, and 2. Edges from N E connect with K S, M O, and I A. Edges from I A connect with M O and I L. Edges from W I connect with I A and I L. An edge from K S connects with M O. An edge from M O connects with I L. An edge from I L connects with I N. Edges from I N connect with M I and O H. An edge from M I connects with O H. N D, K S, I A, and M I are in red. S D and W I are in blue.

    Step 4: Since KS and ND are not adjacent to each other, we can save a step and color both red. The highest degreeof remaining vertices is four.

    Step 5: Choose one of the vertices of degree 4, SD, to color with a new color, blue. The vertices WI, IL, MO, IN,and OH are NOT adjacent to blue.

    WI, IL, and MO have the highest degree.

    Step 6: Choose one of WI, IL, or MO to color.

    We color WI blue.

    MO, IN and OH are NOT adjacent to blue.

    MO has the highest degree of these.

    A graph represents common boundaries between midwestern states. The vertices are North Dakota (N D), South Dakota (S D), Nebraska (N E), Kansas (K S), Minnesota (M N), Iowa (I A), Missouri (M O), Wisconsin (W I), Illinois (I L), Indiana (I N), Michigan (M I), and Ohio (O H). Edges from M N connect with I A and W I and their corresponding degrees are 2, 4, 4, 2, 4, 6, 4, 4, 4, 3, 3, and 2. Edges from N E connect with K S, M O, and I A. Edges from I A connect with M O and I L. Edges from W I connect with I A and I L. An edge from K S connects with M O. An edge from M O connects with I L. An edge from I L connects with I N. Edges from I N connect with M I and O H. An edge from M I connects with O H. N D, K S, I A, and M I are in red. S D, W I, M O, and I N are in blue.
    A graph represents common boundaries between midwestern states. The vertices are North Dakota (N D), South Dakota (S D), Nebraska (N E), Kansas (K S), Minnesota (M N), Iowa (I A), Missouri (M O), Wisconsin (W I), Illinois (I L), Indiana (I N), Michigan (M I), and Ohio (O H). Edges from M N connect with I A and W I and their corresponding degrees are 2, 4, 4, 2, 4, 6, 4, 4, 4, 3, 3, and 2. Edges from N E connect with K S, M O, and I A. Edges from I A connect with M O and I L. Edges from W I connect with I A and I L. An edge from K S connects with M O. An edge from M O connects with I L. An edge from I L connects with I N. Edges from I N connect with M I and O H. An edge from M I connects with O H. N D, K S, I A, and M I are in red. S D, W I, M O, and I N are in blue. N E, M, and I L are in purple.
    A graph represents common boundaries between midwestern states. Each graph infers the following data. The vertices are North Dakota (N D), South Dakota (S D), Nebraska (N E), Kansas (K S), Minnesota (M N), Iowa (I A), Missouri (M O), Wisconsin (W I), Illinois (I L), Indiana (I N), Michigan (M I), and Ohio (O H). Edges from M N connect with I A and W I and their corresponding degrees are 2, 4, 4, 2, 4, 6, 4, 4, 4, 3, 3, and 2. Edges from N E connect with K S, M O, and I A. Edges from I A connect with M O and I L. Edges from W I connect with I A and I L. An edge from K S connects with M O. An edge from M O connects with I L. An edge from I L connects with I N. Edges from I N connect with M I and O H. An edge from M I connects with O H. N D, K S, I A, and M I are in red. S D, W I, M O, and I N are in blue. N E, M, I L, and O H are in purple.

    Step 7: Color MO blue. All remaining vertices are adjacent to blue.

    Choose a new color. Four vertices remain, MN, NE, IL, and OH. MN, NE, and IL have the highest degree.

    Step 8: Since MN, IL, and NE are not adjacent, save steps and color all three the new color, purple.

    Vertex OH is the only remaining vertex that has NOT been colored.

    Step 9: Since vertex OH is not adjacent to purple, color it purple.

    This is the final graph.

    We used three colors.

    Table 12.7 Steps to Color Graph of Midwestern States

    The final graph in Table 12.7 shows how we would color the map. In Figure 12.113 we have colored the map to correspond to the colors on the graph.

    A partial map of the USA with midwestern states. The Midwestern states are North Dakota, South Dakota, Nebraska, Kansas, Minnesota, Iowa, Missouri, Wisconsin, Illinois, Indiana, Michigan, and Ohio. North Dakota, Kansas, Iowa, and Michigan are in red. South Dakota, Missouri, Wisconsin, and Indiana are in blue. Nebraska, Minnesota, Illinois, and Ohio are in purple.
    Figure 12.113: Midwestern States in Three Colors

    We used three colors to color the graph. This supports the Four-Color Theorem, because the graph is planar and its chromatic number is less than four.

    Your Turn 12.23
    The first figure shows a map of the Island of Oahu in the State of Hawaii divided into regions, and the second figure shows a graph of the map. What is the chromatic number? Find a graph coloring that reflects the chromatic number of the graph.
    A map shows the regions of Oahu. The regions are North Shore, Leeward Coast, Central, Windward Coast, and South.
    Figure 12.114: Map of Oahu
    A graph represents common boundaries between regions of Oahu. The five vertices are L, N, W, C, and S. Edges from L connect with N and C. Edges from N connect with W and C. Edges from W connect with C and S. An edge from S connects with S.
    Figure 12.115: Graph Representing Common Boundaries between Regions of Oahu
    Who Knew?: Coloring A Möbius Strip

    Have you ever heard of a möbius strip? It is a flat object with only one side. This might sound theoretical, but you can make one for yourself. Take a narrow strip of paper, make a half twist in it, and tape the ends together. To prove to yourself that it has only one side, pick a point anywhere on the paper and start drawing a line. You can draw the line continuously without lifting your pen from the paper and eventually, you will get back to the point at which you started. Since you never had to flip over the paper, you have just proved it has one side!

    Now, you might be wondering what this has to do with Graph Theory. It turns out that a map drawn on a möbius strip cannot necessarily be drawn using four colors. This doesn’t contradict the Four-Color Theorem, which only applies to graphs that are planar. A möbius strip does not live on a “plane,” or flat surface, which means the maps are not always planar like those drawn on a flat piece of paper. In the case of a möbius strip, it is the Six-Color Map Theorem! Figure 12.116 is an example of a möbius strip with a map that requires five colors.

    A Mobius strip is shaded in five different colors.
    Figure 12.116: A Five-Coloring on a Möbius Strip

    Check Your Understanding

    For the following exercises, determine whether each statement is always true or sometimes true.

    A trail is a path.

    A trail is a walk.

    A walk is a path.

    A circuit is a trail.

    A directed cycle is a path.

    A circuit is a directed cycle.

    A directed cycle is a circuit.

    If a graph has an \(n\)-coloring, then its chromatic number is \(n\).

    If the chromatic number of a graph is \(n\), then it has an \(n\)-coloring.

    If a graph is planar, then it has a chromatic number of at most four.

    For the following exercise, fill in the blanks to make the statement true.

    A walk that ____________ is a trail.

    A trail that ____________ is a circuit.

    A circuit that ___________ is a directed cycle.

    A closed walk that ____________ is a circuit.

    A complete graph with \(n\) vertices has a chromatic number of_____.

    A graph with a clique with \(n\)-vertices has a chromatic number of _________ \(n\).

     

    This page titled 12.5: Navigating Graphs is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by OpenStax via source content that was edited to the style and standards of the LibreTexts platform.

    • Was this article helpful?