{"id":453,"date":"2007-06-26T15:48:04","date_gmt":"2007-06-26T15:48:04","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2007\/06\/26\/get-out-your-crayons-its-graph-coloring-time\/"},"modified":"2007-06-26T15:48:04","modified_gmt":"2007-06-26T15:48:04","slug":"get-out-your-crayons-its-graph-coloring-time","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2007\/06\/26\/get-out-your-crayons-its-graph-coloring-time\/","title":{"rendered":"Get out your crayons: it&#039;s graph coloring time!"},"content":{"rendered":"<p>One kind of graph problem that&#8217;s extremely widely used in computer science is called <em>graph coloring<\/em>. There&#8217;s two versions of it, *vertex coloring*, and *face coloring*.<br \/>\nVertex coloring is the one that&#8217;s more widely used. Edge coloring problems are all variations on the following: given a graph *G=(V,E)*, find a mapping of colors to vertices, such than if two vertices are adjacent, they&#8217;re assigned different colors?<br \/>\nThe variants of the vertex coloring problem are things like:<br \/>\n* What&#8217;s the *minimum* number of colors (aka the *chromatic number* of the graph)<br \/>\nthat can be used to color a graph?<br \/>\n* Given an integer N, can you find an N-coloring of the graph?<br \/>\nThe face coloring problem is more complicated to describe. Suppose you have a *planar* graph. (Remember that that means a graph which can be drawn on a plane with no edges crossing.) Suppose further that the graph has the property that from any vertex v, there is a path through the graph from v to v. Then that graph is called a *map*. For a map drawn on a plane, every edge is part of at least one cycle. The smallest possible cycles &#8211; that is, the cycles which are not bisected by any other edges of the graph &#8211; are called *countries* or *faces* of the graph. The face coloring problem assigns colors to the *faces* of a graph, so that no two faces that share an edge are the same color. There&#8217;s an extremely fascinating proof that any planar map can be face-colored with no more than four colors. We&#8217;ll talk about later &#8211; it&#8217;s the first computer assisted proof that I&#8217;m aware of.<\/p>\n<p><!--more--><br \/>\nBut for now, back to vertex coloring. How can we find the chromatic number of an arbitrary graph, G (also written &chi;(G))?<br \/>\n<img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"2color.jpg\" src=\"https:\/\/i0.wp.com\/scientopia.org\/img-archive\/goodmath\/img_164.jpg?resize=144%2C114\" width=\"144\" height=\"114\" class=\"inset right\" \/><br \/>\nThe one that students often come up with as a first guess &#8211; is to find the vertex with highest degree, and that the degree of that vertex will be one smaller than the chromatic number. Alas, it&#8217;s not so easy. Take a look at the graph to the right: the maximum degree of a vertex is 4, but it can be 2-colored.<br \/>\n<img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"notmaxdegree.jpg\" src=\"https:\/\/i0.wp.com\/scientopia.org\/img-archive\/goodmath\/img_165.jpg?resize=167%2C134\" width=\"167\" height=\"134\" class=\"inset right\" \/><br \/>\nAnother common idea is that the chromatic number should be the size of the smallest clique in the graph. Again, no dice &#8211; look at the example to the right: the largest clique has degree four, but the graph needs 5 colors. But the largest clique *is* a lower bound.<br \/>\nWhat we end up with isn&#8217;t particularly pretty. There&#8217;s no simple way of finding the minimum coloring of a graph. What there *is* is a method of figuring it out from pieces using the lowering bound provided by the the largest clique. It&#8217;s based on the idea of a *critical subgraph*.<br \/>\nA critical subgraph C of a graph G  is a *proper* subgraph of G &#8211; that is, a subgraph of G where C&ne;G &#8211; such that for every proper subgraph B of C, &chi;(B)&lt;&amp;chi(C). So we can *reduce* G to its largest critical subgraph &#8211; and the chromatic number of that subgraph is the same as the chromatic number of G.<br \/>\nSo we&#8217;ve reduced the problem to identifying the largest critical subgraph. There are a couple of useful properties that can help us:<br \/>\n1. Critical subgraphs are always connected. This should be pretty obvious &#8211; if the graph<br \/>\nisn&#8217;t connected, then you can color the disconnected subgraphs separately, which<br \/>\nwould mean that it&#8217;s not critical.<br \/>\n2. In a critical subgraph C with chromatic number &chi;(C), every node<br \/>\nwill have minimum degree &chi;(C)-1.<br \/>\nBut aside from those, we&#8217;re mostly on our own. And just to be spiteful, graph colorings also have a nasty property.<br \/>\nSuppose you have a graph G. The number of edges in the smallest cycle in G is called the *girth* of G.<br \/>\nFor any x,y&ge;2, there is a graph with girth x, and chromatic number y. What that means is that you can&#8217;t do things like rely on cliques, even as an approximation. Because, for example, a graph with chromatic number 300 isn&#8217;t even guaranteed to contain any cliques of size three! Because a 3-clique is a triangle, which is a cycle of size 3&#8230; But there are graphs with chromatic number 300, and girth 50.<br \/>\n<img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"groltzsch.jpg\" src=\"https:\/\/i0.wp.com\/scientopia.org\/img-archive\/goodmath\/img_166.jpg?resize=144%2C146\" width=\"144\" height=\"146\" class=\"inset right\" \/><br \/>\nJust for an example of a graph with this kind of property: the figure to the right is called the Gr&ouml;tzcsh graph. It&#8217;s got girth four, but it contains no triangles at all. Try and figure out how many colors it needs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One kind of graph problem that&#8217;s extremely widely used in computer science is called graph coloring. There&#8217;s two versions of it, *vertex coloring*, and *face coloring*. Vertex coloring is the one that&#8217;s more widely used. Edge coloring problems are all variations on the following: given a graph *G=(V,E)*, find a mapping of colors to vertices, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[25],"tags":[],"class_list":["post-453","post","type-post","status-publish","format-standard","hentry","category-graph-theory"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-7j","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=453"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/453\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=453"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}