Search through nodes to find an optimal path to another node