Skip to content

Dijkstras computation time incorrect  #16

@HenryQuillin

Description

@HenryQuillin

While testing out this program, I think I found a bug in Dijkstra’s analytics (i.e 'Dijkstra’s visited _ nodes in: _ ms. Path length = _’). BFS is very similar to Dijkstra’s, so their computation time should also be similar. However, despite the nodes visited and path length being pretty much the same, Dijkstra's computation time is drastically different. See the screenshots below:
Screen Shot 2021-09-21 at 10 37 04 AM
Screen Shot 2021-09-21 at 10 38 37 AM
"
1] BFS visited 1356 nodes in: 19.00 ms. Path length = 69.
[2] Dijkstra's visited 1355 nodes in: 1135.00 ms. Path length = 69.

I ran this is Safari on a 2021 MacBook Air. Interestingly, when I ran it in google with the same default settings and node layout, Dijkstra's computation time was much smaller (though still seemingly incorrect):
Screen Shot 2021-09-21 at 10 43 08 AM

"
[1] BFS visited 1413 nodes in: 23.80 ms. Path length = 70.
[2] Dijkstra's visited 1412 nodes in: 196.6 ms. Path length = 70.

It does not make sense that Dijstras takes nearly 100x more time than BFS in Chrome and 500x in Safari.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions