Shortest-path algorithms which use a space-time tradeoff? -


problem: finding shortest paths in unweighted, undirected graph.

breadth-first search can find shortest path between 2 nodes, can take o(|v| + |e|) time. precomputed lookup table allow requests answered in o(1) time, @ cost of o(|v|^2) space.

what i'm wondering: there algorithm offers space-time tradeoff that's more fine-grained? in other words, there algorithm which:

  1. finds shortest paths in more time o(1), faster bidirectional breadth-first search
  2. uses precomputed data takes less space o(|v|^2)?

on practical side: graph 800,000 nodes , believed small-world network. all-pairs shortest paths table on order of gigabytes -- that's not outrageous these days, doesn't suit our requirements.

however, asking question out of curiosity. what's keeping me @ night not "how can reduce cache misses all-pairs lookup table?", "is there different algorithm out there i've never heard of?"

the answer may no, , that's okay.

you should start looking @ dijkstra's algorithm finding shortest path. a* algorithm variant uses heuristic reduce time taken calculate optimal route between start , goal node (such euclidean distance). can modify heuristic performance or accuracy.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -