implemented shortestPath algorithm in GUI