Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is space for improvement because in unweighted graphs, you gain an additional attribute which does not hold for weighted graphs, namely:</p> <blockquote> <p>For any edge directly connecting A to C, you know for sure that there is no shorter path via a third node B.</p> </blockquote> <p>With this in mind, you should be able to simplify Dijkstra's Algorithm: As you may know, it works with three sets of nodes: </p> <ol> <li>Those of which the definitive shortest path is known, </li> <li>those of which a preliminary distance has been calculated and </li> <li>those which have not yet been explored. </li> </ol> <p>When following an edge <code>e</code> from <code>A</code> (1.) to <code>C</code> (3.), original Dijkstra would move node <code>C</code> from (3.) to (2.). Since the above attribute holds in all your graphs, you can however add it directly to the set (1.), which is more efficient.</p> <p>Here's the essential observation: The procedure outlined above is basically a BFS (breadth first search), i.e. you can find the distance from some fixed node <code>v</code> to any other node in <code>O(|V| + |E|)</code>.</p> <p>You did not mention in your original question that the graph was basically a grid with some holes in it. This is an even stronger requirement, and I am sure you can exploit it. Doing a quick search for "grid graph shortest path" yields <a href="http://onlinelibrary.wiley.com/doi/10.1002/net.3230070404/abstract" rel="nofollow">this paper</a> which promises <code>O(sqrt(n))</code> in the best case. As the problem you specify is fairly well-structured, I'm almost sure there are several more papers which you might want to look into.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload