dijkstra seems to be computing different results from bfs. need tests to check if it is correct