 An algorithm is a sequence of steps to follow to produce an answer, but a sequence of steps can be programmed into a computer, which will then follow the steps faster, cheaper, and more accurately than any human being. So once you have the algorithm, you don't really need the human being. And this is an important idea. Solving a problem using an algorithm is not problem solving. The actual solution to the problem occurs when the algorithm is created, not when it's used. So as a human, you should focus on learning how to create the algorithms. The good news is that you can be taught everything there is to know about being creative very quickly. The bad news is that's because you can't be taught anything about how to be creative, no one can teach you how to be original. Now while you can't be taught creativity, you might gain insight by seeing other people's creative processes at work. So let's see how we might create a coloring algorithm. So one common thing we do in mathematics and in life is if we're trying to solve a problem, we might change it into a different problem. To find the coloring of a graph, we want to assign colors to the vertices, so adjacent vertices have different colors. Remember that if we can find a K coloring, then the graph is K-partite, so coloring a graph also solves the problem of partitioning the graph. So what if we tried to solve the partition problem? So it goes without saying, but we'll say it anyway, that the more you know, the more you can find out. Remember that the partite sets of a K-partite graph form totally disconnected subgraphs. In other words, they're independent sets. So what if we tried to find independent sets? And at some point we just have to try it out. So let's think about this to form an independent set, we might select a vertex, mark all the adjacent vertices unavailable, select another vertex, and lather rinse repeat. So we'll begin with the vertex and give it a color, about this one. We'll mark the adjacent vertices to indicate they're unavailable for inclusion in the independent set. Maybe we'll white them out. Now we could pick any other vertex to be part of our independent set, about this one. We'll white out the neighbors, and lather rinse repeat. Now if we were programming a computer, it would follow the program. But since we're human, we might note that the last two points can be included in our independent set. And so this gives us one independent set. Now we can restore all the points we couldn't select and try it again. So we'll start by picking a point, marking the neighbors unavailable, picking another point, marking the neighbors unavailable, and again we can include the last few points to form a second independent set. Select the available points, pick a point, mark the neighbors unavailable, and again the remaining points can be included in our independent set. And the last two points are also an independent set. And this gives us a coloring of our graph. Now since the first thing we try is always the best solution, we're done! Wait, now it probably isn't the best, and so it's important to analyze and try to improve our algorithm. So while this gives us a partition, it may end up with a lot of partite sets at the end. So if we want to reduce the number of partite sets, we'd want to make the independent sets as large as possible. Since we eliminate all adjacent vertices as potential elements of an independent set, one tactic might be to choose the remaining vertex with the lowest degree. Let's see what happens. So we'll begin with a vertex of lowest degree. So how about one of these degree one vertices? We'll eliminate the adjacent vertices, then choose a vertex of least degree from those remaining, lather, rinse, repeat to form our independent set, which gives us our first independent set, restore the vertices that we couldn't pick, and lather, rinse, repeat. We'll pick a new starting vertex, mark the unavailable vertices, lather, rinse, repeat, and again the remaining vertices are also disconnected so we can color them a third color. So remember to be an algorithm, the process must terminate and always produce an answer. We'll prove this. They will let you prove it as part of the homework. Now while we should always prove that our algorithm is in fact an algorithm, in other words it always terminates and it always produces an answer, there are two more questions we'd like to ask. First, how efficient is the algorithm? This is a more complicated question and we won't answer it here because it's more of a computer science question. And the other question we'd like to ask is about optimality. So the chromatic number is the least number of colors required to color the graph. And if we know it exists, will our algorithm find it? Again this is a more complicated question we won't answer, in this case because it is in general very hard to answer. This is in fact the type of thing you would do full level research on.