title: How to color a graph
body: <p>I have a question described below:</p>
  
  <p>Write a prolog program that colors a graph. The colors are defined by the color/1 predicate and the graph by the clauses edge/2. You must write the predicate coloring(Coloring) that finds a coloring of the nodes node_1,..., node_n of the graph. A coloring is list
  [node_1/color_1,..., node_n/color_m] where color_1, ..., color_m are colors, that satisfies the property that the nodes of every edge have different colors.</p>
  
  <p>Let us look at an example. Let color and edge be the predicates below.</p>
  
  <pre><code>% 2 colors
  color(blue).
  color(red).
  % the edges
  edge(1,2).
  edge(1,3).
  edge(2,4).
  edge(5,2).
  </code></pre>
  
  <p>For this data,  coloring(C) is satisfied. One solution is</p>
  
  <pre><code>C = [ 1/blue, 2/red, 3/red, 4/blue, 5/blue].
  </code></pre>
  
  <p>Write the predicate color below.</p>
  
  <p>Actually, I just begin to do this practice. So I have no idea. I think four colors will be enough to color a graph. Maybe someone has asked the similar question. When I have some ideas I will post it quickly. </p>