Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Finding an Exit from a Maze #87

Closed
hamidgasmi opened this issue Mar 11, 2020 · 1 comment
Closed

Finding an Exit from a Maze #87

hamidgasmi opened this issue Mar 11, 2020 · 1 comment

Comments

@hamidgasmi
Copy link
Owner

The problem statement is available here

@hamidgasmi
Copy link
Owner Author

hamidgasmi commented Mar 14, 2020

This issue is implemented with different technique in order to compare them.
The different implementations are:

  • Graph with adjacency list + DFS traversal:
    • Running time: O(|V| + |E|)
  • Graph with adjacency list + simple BFS traversal:
    • Running time: O(|V| + |E|)
  • Graph with adjacency list + Bi directional BFS traversal
    • It consists of 2 parallel (2 threads) BFS traversals starting from the 2 different vertices
    • Running time is: O(|V| + |E|)
  • Disjoint set + Rank heuristic:
    • Running time: O(log |V|)
  • Disjoint set + Path compression heuristic:
    • Amortized running time: O(log*|V|)

I tested this different solutions with a graph of 100 vertices.
I was expecting to notice a difference in term of efficiency. I was particularly expecting to the lastest solution to be the fastest.
I didn't notice any different between them.

To do:

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant