practice dijkstra to get shortest path between words