added solution for "Determining if a graph has a solution"