changed to graph coloring
added JavaDoc