1 / 11

Breadth-First Search and Shortest Path

Breadth-First Search and Shortest Path. Kevin Schaffer. Chapter 15.4 from “Distributed Algorithms” by Nancy A. Lynch. Outline. Breadth-First Search AsynchBFS LayeredBFS HybridBFS Shortest Path AsynchBellmanFord. AsynchBFS. Similar to AsynchSpanningTree

xexilia
Télécharger la présentation

Breadth-First Search and Shortest Path

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Breadth-First Search and Shortest Path Kevin Schaffer Chapter 15.4 from “Distributed Algorithms” by Nancy A. Lynch

  2. Outline • Breadth-First Search • AsynchBFS • LayeredBFS • HybridBFS • Shortest Path • AsynchBellmanFord

  3. AsynchBFS • Similar to AsynchSpanningTree • AsynchSpanningTree algorithm does not always generate a breadth-first spanning tree • AsynchBFS detects incorrect parent assignments and corrects them

  4. Safety and Liveness • Safety • For every process ii0, disti is the length of some path p from i0 to i in G in which the predecessor of i is parenti. • For every message m in channel Ci,j, m is the length of some path p from i0 to i. • Liveness • For every pair of neighbors i and j, either distjdisti + 1, or else either send(j)i or Ci,j contains the value disti.

  5. Complexity of AsynchBFS • Message complexity: O(n|E|) • A node can receive at most n estimates, each of which generates |E| messages • Time complexity: O(diamn(l + d)) • Length of the shortest path from i0 to any node is diam and at most n messages are ever in any channel

  6. Termination in AsynchBFS • Problem with AsynchBFS: Processes do not know when to terminate • Solution: Modify algorithm to perform a convergecast/broadcast at the end • Not as straight-forward as AsynchBcastAck since processes may participate multiple times

  7. LayeredBFS • Constructs the BFS tree in phases • Each phase adds one layer to the tree; layer k contains the nodes at depth k in the tree • Upon completion of phase k, all processes with depth at most k know their parent and those at depth at most k – 1 know their children • Acknowledgements let i0 know when each phase is complete

  8. Complexity of LayeredBFS • Message complexity: O(|E| + ndiam) • At most |E| search and acknowledgements • At most diam + 1 phases • At most n newphase/convergecast messages • Time complexity: O(diam2(l + d)) • Each phase takes diam(l + d)

  9. HybridBFS • HybridBFS performs an AsynchBFS multiple times, completing m layers during each phase • If m = 1 then HybridBFS is similar to LayeredBFS and if m = diam then HybridBFS is similar to AsynchBFS

  10. AsynchBellmanFord • Generates a shortest path tree rooted at i0 • Similar to AsynchBFS but sends weighted distances • Same problem with termination as AsynchBFS

  11. Complexity of ABF • Worst-case is exponential • Message complexity: O(nn|E|) • Maximum number of distinct simple paths • Time complexity: O(nn + 1(l + d))

More Related