Math Circle Bobby Hanson Motivational Problems Let’s start with the following problems. Exercise 1 Suppose the Math Department is creating its schedule of classes, and has asked us to help. We need to schedule Algebra, Topology, Complex Analysis, Differential Equations, Math Biology, Applied Mathematics, and Numerical Methods with the following constraints: • Algebra and Topology cannot be at the same time. • Differential Equations, Math Biology, Applied Mathematics, and Numerical Methods must all be at different times. • Complex Analysis cannot be at the same time as any of the other classes, except Math Biology. How many different class periods do we require? How should the classes be scheduled? Exercise 2 We are building habitats for a zoo. We need housing for each of the following animals: Antelope, Beaver, Coatimundi, Elephant, Flamingo, Giraffe, Koala, Lion, Snake, and Monkey. Furthermore: • Monkeys cannot be with Elephants or Koalas. • Elephants, Giraffes, and Antelope all need separate habitats. • Lions can share their homes only with snakes. • Beavers and Flamingos don’t get along; neither do Elephants and Flamingos. • Snakes scare Monkeys, Coatimundi, Koalas, and Beavers. • Elephants and Giraffes both have trouble seeing snakes, and might step on them. How many habitats should we build? 1 Introduction to Graphs The above problems have something in common: they can be solved in the realm of mathematics known as Graph Theory. In particular, they can each be solved by coloring a graph. First we need to know what a graph is, then we can figure out how to color it. The graphs that we will be talking about are not the graphs of functions, but are something entirely different. Roughly speaking, a graph is a collection of dots connected by line segments. The dots are called vertices and the line segments are called edges. Here is an example of a graph. If two vertices have an edge joining them, we call them adjacent. Notice that some of the adjacent vertices in the above graph have more than one edge between them. That’s okay, we call those multiple edges. One of the vertices is even adjacent to itself! That edge is called a loop. If a graph does not contain any loops or multiple edges then we call it a simple graph. We will mostly be talking about simple graphs. Notice also that one of the edges in the above graph crosses another edge. That is okay as well. There is not a vertex where they cross, we just have to imagine one edge crossing above the other. If we have two graphs G and H, and we can bend one of the graphs around so that it looks like the other graph, we say they are isomorphic. This is just a fancy way of saying that they are the same graph. If it helps, just think of the edges in the graph as pieces of a rubber band. Exercise 3 Which of the following graphs are isomorphic to one another? $ % ! X Y R S V W V W R S P Q T U T U N O N O . / , - , - @ A & ' 0 1 0 1 * + * + 8 9 8 9 : ; : ; < = @ A < = J K J K H I H I B C B C L M L M F G F G D E D E Z [ \ ] & ' . / ! Z [ \ ] $ % X Y #" #" ( ) ( ) f g f g d e d e b c b c 2 3 2 3 h i h i j k j k l m l m z { z { x y x y v w v w t u t u p q p q n o n o | } | } ~ ~ r s r s 4 5 4 5 6 7 > ? 6 7 > ? P Q ^ ` a ` a _^ _^ One tool we can use to decide whether or not two graphs are the same is by looking at the number of edges attached to a particular vertex. This is called the degree of the vertex. There are of course special types of graphs. First, there’s the graph that has n vertices but no edges (it’s only dots). This is called the null graph and is denoted Nn . An important point here is that there is nothing in our definition of graph to suggest that a vertex need be adjacent to another vertex. A related graph is the complete graph on n vertices, denoted Kn . The null graph Nn has no edges, but the complete graph Kn has all possible edges, in that every vertex is adjacent to every other vertex. Here is a picture of K5 . Coloring Graphs Now that we know what a graph is, let’s try to figure out what it means to color one. When we color a graph what we are really coloring are the vertices. But we want to color the vertices so that if two vertices share an edge, they have different colors. As mathematicians, we are less interested in what colors we use as we are the number of colors we use. If we can color a graph G (as prescribed above) using k colors, then we say that G is k-colorable. Note that we don’t necessarily have to use all k of the colors, but we do need to color all of the vertices. For instance, if G has n vertices, then certainly G is n-colorable. We just color every vertex a different color. But this is not very interesting. We might have very big graphs, but a very small box of crayons. Therefore, we are more interested in the least number of colors we need. If k is the smallest number of colors we need to color G, then we say that the chromatic number of G is k, and we write this as χ(G) = k. Exercise 4 What is χ(Kn )? Exercise 5 Which graphs have chromatic number 1? 2? 3? 4? Exercise 6 Draw some graphs where the largest vertex degree is 2, 3, 4. What do you notice about the chromatic numbers for those graphs? Is there an upper limit as to how large χ(G) can be? We already know that it must be less than or equal to the number of vertices. Can we get a better estimate? Back to Scheduling and Zoos Look back on Exercises 1 and 2. Notice that we can use Graph Coloring to solve these problems. Draw a graph with a vertex for each course we have to schedule, and connect two courses with an edge if they must be at different times. Then if we color the vertices, that gives us a schedule with one class hour for each color we use. Similarly, we can arrange habitats in the zoo. Exercise 7 Draw the graphs for Exercises 1 and 2. Color these graphs. How many colors did you use? What does this tell us? Exercise 8 Find the chromatic number for each of the following graphs and compare with the estimate from Exercise 6 ¸ ¹ ¤ ¥ ¤ ¥ ¢ £ ¦ § ¡ ¨ © ¨ © ¸ ¹ ¶ · ¬ ­ ª « ¶ · Â Ã Â Ã Ä Å Ä Å Æ Ç Æ Ç ¼ ½ ¼ ½ ¾ ¿ ¾ ¿ À Á À Á ª « ¡ ° ± ´ µ ¢ £ ¬ ­ ¦ § ´ µ º » º » ° ± ® ¯ ® ¯ ² ³ ² ³ Exercise 9 In the following table of graphs, which have chromatic number 2? chromatic number 3? chromatic number 4? Ê Ê Ê Ì Ì Ì È É È É È É Ë Ê Ë Ê Ë Ê Ì Í Ì Í Ì Í È É È É È É Ë Ë Ë Í Í Í Ð Ð Ñ Ð Ñ Ð Ñ Ð Ð Ñ Ð Ñ Ð Ñ Î Î Î Î Î Î Ï Ï Ï Ò Ó Ò Ó Ò Ó Ï Ï Ï Ò Ó Ò Ó Ò Ó Ô à à à è è è ð ð ð ø ø ø Þ ß Þ ß Þ ß áà áà áà æ ç æ ç æ ç éè éè éè î ï î ï î ï ð ñ ð ñ ð ñ ö ÷ ö ÷ ö ÷ ø ù ø ù ø ù þ ÿ þ ÿ þ ÿ Þ ß Þ ß Þ ß á á á æ ç æ ç æ ç é é é î ï î ï î ï ñ ñ ñ ö ÷ ö ÷ ö ÷ ù ù ù þ ÿ þ ÿ þ ÿ Ü Ü Ü ä ä ä ì ì ì ô ô ô ü ü ü Ú Û Ú Û Ú Û ÝÜ ÝÜ ÝÜ â ã â ã â ã åä åä åä ê ë ê ë ê ë ì í ì í ì í ò ó ò ó ò ó ô õ ô õ ô õ ú û ú û ú û ü ý ü ý ü ý Ú Û Ú Û Ú Û Ý Ý Ý â ã â ã â ã å å å ê ë ê ë ê ë í í í ò ó ò ó ò ó õ õ õ ú û ú û ú û ý ý ý " # " # " # . / . / . / 6 6 7 6 7 6 7 " # " # " # . / . / . / 6 6 7 6 7 6 7 : : ; : ; : ; : : ; : ; : ; , & ' & ' & ' $ $ % $ % $ % * + * + * + , - , - , - & ' & ' & ' $ $ % $ % $ % * + * + * + - - - 8 8 9 8 9 8 9 8 8 9 8 9 8 9 2 ! ! ! ! ! ! X Y X Y X Y X Y X Y X Y b c b c b c b c b c b c ( ) ( ) ( ) 0 1 0 1 0 1 ( ) ( ) ( ) 0 1 0 1 0 1 N N N L M L M L M ON ON ON f g f g f g j k j k j k L M L M L M O O O f g f g f g j k j k j k J K J K J K J K J K J K H H H F G F G F G IH IH IH F G F G F G I I I Æ Ç Æ Ç Æ Ç Æ Ç Æ Ç Æ Ç R S R S R S V W V W V W R S R S R S V W V W V W P Q P Q P Q T U T U T U P Q P Q P Q T U T U T U ¾ ¿ ¾ ¿ Ä Å Ä Å Ä Å ¾ ¿ ¾ ¿ ¾ ¿ Ä Å Ä Å Ä Å Ê Ë Ê Ë Ê Ë Ê Ë Ê Ë Ê Ë Ì Í À Á À Á À Á  ^ _ l m l m l m \ ] \ ] \ ] _ _ _ l m l m l m Z [ Z [ Z [ ` a ` a Z [ Z [ Z [ ` a ` a àà à à à à 2 3 4 5 4 5 4 5 3 3 5 5 5 r p q p q p q s s s ` a n o n o n o v w v w v w ` a n o n o n o v w v w v w Ì Í Ì Í Ð Ñ Ð Ñ Ð Ñ Î Ï Î Ï Î Ï Î Ï Î Ï Î Ï Ð Ñ Ð Ñ Ð Ñ Ò È É È É Ó Ú Û Ú Û Ú Û Ú Û Ú Û Ú Û Ó Ò Ò Ò Ó Ó Ó Ò Ò Ò È É Ì Í Ì Í È É È É È É Ô Õ Ô Õ Ô Õ Ô Õ Ô Õ Ô Õ t u r s t u t u r t u t u r s t u r h i h i d e d e d e h i h i h i d e d e d e ¢ £ ¢ £ ¢ £ ¢ £ ¢ £ ¢ £ Ö Ö Ö Ö Ö Ö × Ö × Ö × × × × Ø Ù Ø Ù Ø Ù Ø Ù Ø Ù Ø Ù Ô Õ Ô Ô Õ Õ Õ Ö × Ö × Ö × @ @ A @ A @ A @ @ A @ A @ A Ø Ù Ø Ù Ø Ù Ø Ù Ø Ù Ø Ù ¡ ¡ ¡ ¦ § ¦ § ¦ § ¡ ¡ ¡ ¦ § ¦ § ¦ § ¬ ­ ¬ ­ ¬ ­ ¬ ­ ¬ ­ ¬ ­ ¤ ¥ ¤ ¥ ¤ ¥ ¨ © ¨ © ¨ © ¤ ¥ ¤ ¥ ¤ ¥ ¨ © ¨ © ¨ © ® ¯ ® ¯ ® ¯ ® ¯ ® ¯ ² ³ ² ³ ² ³ ² ³ ² ³ ² ³ D E D E D E B B C B C B C D E D E D E B B C B C B C > > > < < = < = < = > ? > ? > ? < < = < = < = ? ? ? | | } | } | } | | } | } | } 4 2 3 r s h i 4 3 p q 4 p q 2 p q Â Ì Í À Á À Á ^ _ Ò À Á ^ _ Ó ¾ ¿  ^ \ ] ¾  ^ \ ] 2 2 3 ® ¯ ¾  ^ \ ] Ô Õ Ô Ö × Ö × , , Ô Õ Ô Ö × ° ± ° ± ° ± ° ± ° ± ° ± « « « ª ª ª « « « ª ª ª ~ ~ ~ ~ ~ ~ z z z x x y x y x y z { z { z { x x y x y x y { { { µ µ µ ¼ ½ ¼ ½ ¼ ½ ¼ ½ ¼ ½ ¼ ½ ¸ ¹ ¸ ¹ ¸ ¹ ¸ ¹ ¸ ¹ ¸ ¹ ´ ´ ´ µ µ µ ´ ´ ´ ¶ · ¶ · ¶ · º » º » º » ¶ · ¶ · ¶ · º » º » º » Chromatic Polynomials Now we will associate to each graph a function that helps us to solve these coloring problems. This function will also help us to tell when two graphs are different. For this section, we will restrict our attention to simple graphs. Let’s start with a simple graph G. Then we define the function PG (x) associated to G by declaring that PG (x) is the number of different ways we can color G with x colors (so that adjacent vertices have different colors). We will see shortly that PG (x) is a polynomial and we will call it the chromatic polynomial for G. First notice that if G and H are two graphs with different chromatic polynomials, then they must be different graphs. However, we will also see later that it is possible to have two different graphs with the same polynomial. Exercise 10 What is PG (x) for each of the following graphs? 1. à á à á Þ ß æ ç 2. ä å ä å Þ ß Ý Ý Ü Ü æ ç ã ã â â Exercise 11 What is the chromatic polynomial PNn (x) of the null graph Nn ? Exercise 12 What is the chromatic polynomial PKn (x) of the complete graph Kn ? Exercise 13 If k < χ(G) what is PG (k) equal to? Look at the following portion of the graph G with the edge e adjoining vertices v and w. e v ì í ì í ì í ì í w ì í ì í î ï î ï î ï ê ë ê ë ê ë î ï î ï î ï ê ë ê ë ê ë ð ñ ð ñ ð ñ è é è é è é ð ñ ð ñ ð ñ è é è é è é There are two operations that we can do to G to get a new graph. We could simply delete the edge e. The new graph, which we denote G − e, looks just like G, except it is missing the edge e. The second operation is called contracting e and yields a graph G \ e, which we get by shrinking the edge e until the two vertices v and w become the same vertex. If doing this gives us multiple edges, we just simplify by deleting all but one of them. Here are the graphs G − e and G \ e: v ö ÷ ö ÷ ö ÷ ö ÷ w vw ö ÷ ö ÷ þ ÿ þ ÿ þ ÿ þ ÿ þ ÿ þ ÿ ô õ ô õ ô õ ø ù ø ù ø ù ô õ ô õ ô õ ø ù ø ù ø ù ü ü ü ò ó ò ó ò ó ú û ú û ú û ü ý ü ý ü ý ò ó ò ó ò ó ú û ú û ú û ý ý ý Exercise 14 Consider the graph G − e. 1. How many ways can we color G − e with x colors so that v and w have different colors? Hint: What happens if we put e back in? How is it related to PG (x)? 2. How many ways can we color G − e with x colors so that v and w have the same color? 3. How many ways can we color G − e with x colors; i.e., what is PG−e (x)? Notice that if we continue to delete and contract edges and use the formula from Exercise 14, then eventually we will end up with null graphs. We know from Exercise 11 that PNn (x) is xn . Therefore, we are adding up monomials. This shows that PG (x) is a polynomial! Here is an example of how we might compute PG (x) by reducing to smaller graphs whose polynomial we know already. The edges which we remove and contract at each stage are dashed. = − = − − = Therefore, if G = h i h i h i h i h i h i g f g f g f g f g f g f k k k k k k j j j j j j n o n o n o n o n o n o ! ! ! ! ! ! " # " # " # " # " # " # & & ' & ' & ' & & ' & ' & ' ( ( ) ( ) ( ) ( ( ) ( ) ( ) * + 0 0 1 0 1 0 1 * + * + * + 0 0 1 0 1 0 1 $ $ %$ %$ , - , - , - % % , - , - , - . . . . . /. /. /. / / / D E D E D E J K J K J K P P Q P Q P Q D D E D E D E J K J K J K P P Q P Q P Q H H I H I H I H H I H I H I − 2 2 2 2 2 2 3 3 3 3 3 3 4 5 4 5 4 5 4 5 4 5 4 5 R D @ A l m * + % @ A l m * + %$ @ A l m $ @ A l m $ @ A l m $ @ A l m B C B C B C F F G F G F G L M L M L M B C B C B C F F G F G F G L M L M L M N N N N N ON ON ON O O O −2 R 8 8 9 8 9 8 9 > ? > ? > ? 8 8 9 8 9 8 9 > ? > ? > ? 6 6 6 6 6 76 76 76 7 7 7 − ; ; ; : : : ; ; ; : : : < < < < < =< =< =< = = = R R R R S S S S S S T U T U T U T U T U T U X X Y X Y X Y ^ ^ _ ^ _ ^ _ X X Y X Y X Y ^ ^ _ ^ _ ^ _ V V V V V WV WV WV W W W − [ [ [ Z Z Z [ [ [ Z Z Z \ \ \ \ \ ]\ ]\ ]\ ] ] ] + a ` ` a a ` ` ` a a a ` ` ` d d e d e d e d d e d e d e b b b b b cb cb cb c c c , then PG (x) = x(x − 1)4 − 3x(x − 1)3 + 2x(x − 1)2 + x(x − 1)(x − 2) = x5 − 7x4 + 18x3 − 20x2 + 8x. Exercise 15 Find the chromatic polynomials for each of the graphs from Exercise 7. What do these polynomials tell us about scheduling and zoos? Exercise 16 1. Find the chromatic polynomials of the six connected simple graphs on four vertices. 2. What do you notice about the coefficients of these polynomials? 3. What do you notice about the degree of the polynomial? Exercise 17 1. Find PG (x) if G = r s r s r s r s r s r s q p q p q p q p q p q p u u u u u u t t t t t t x y x y x y x y x y x y v w v w v w v w v w v w . (This graph is called the 5-cycle and is denoted C5 ). 2. Show that the chromatic polynomial PCn (x) of the n-cycle is (x − 1)n + (−1)n (x − 1). Exercise 18 Find three different graphs with the chromatic polynomial x5 − 4x4 + 6x3 − 4x2 + x. A graph G is said to be connected if you can get from every vertex v to every other vertex w by following a sequence of edges. We say that H is a component of G if H is a connected graph and there are not any larger connected graphs which contain H in G. Here is an example of a graph with three components. (What are they?) ~ ~ | } | } z { z { Exercise 19 If the graph G has two components H and K, and we know their chromatic polynomials PH (x) and PK (x), how can we quickly calculate PG (x)? What if G has many components? Exercise 20 In light of Exercise 19, what is the degree of the smallest-degree term in PG (x)?