use Graph to check Maze