Maze Interview Question

How would I test the algorithm of finding 2 closest nodes in a graph