Graph coloring algorithm implimentation in django