Added some optimizations to graph coloring algo