Solved a graph problem