If I just want to find shortest between a single source and destination, can I do better Dijkstra (which finds from one source to all destinations)?
I am trying to answer a question in the EPI book. The question is as follows: Suppose you are given a N*N matrix in which some of the cells are greyed out and two non-grayed out cells(source and destination), find the shortest path between the two. Greyed out cell means -> A path cannot traverse through that cell.
The book recommends DFS or BFS but this takes O(V + E) which in this case is O(N^2) since both number of Edges and vertices are O(N^2). Same as Dijkstra. Wondering is we can do better.