Added SF coloring algorithm and refactored functions for switching algorithms and graphs.