Graphical path finding algorithm