dijkstra variants a and potentials
play

Dijkstra Variants: A* and Potentials Eric Price UT Austin CS 331, - PowerPoint PPT Presentation

Dijkstra Variants: A* and Potentials Eric Price UT Austin CS 331, Spring 2020 Coronavirus Edition CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16 Class Outline Bottleneck Shortest Paths 1 A* search 2


  1. Dijkstra Variants: A* and Potentials Eric Price UT Austin CS 331, Spring 2020 Coronavirus Edition CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  2. Class Outline Bottleneck Shortest Paths 1 A* search 2 Problems 3 CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  3. Logistics “Raise hand” will hopefully not crash my connection now. CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  4. Logistics “Raise hand” will hopefully not crash my connection now. ◮ So you can try that, as well as chat, for questions. CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  5. Logistics “Raise hand” will hopefully not crash my connection now. ◮ So you can try that, as well as chat, for questions. We’re going to try using Zoom breakout rooms for problems, later today. CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  6. Logistics “Raise hand” will hopefully not crash my connection now. ◮ So you can try that, as well as chat, for questions. We’re going to try using Zoom breakout rooms for problems, later today. ◮ Inside, you can “Ask for help” and it pops up a notification for me. CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  7. Logistics “Raise hand” will hopefully not crash my connection now. ◮ So you can try that, as well as chat, for questions. We’re going to try using Zoom breakout rooms for problems, later today. ◮ Inside, you can “Ask for help” and it pops up a notification for me. ◮ You stop being able to see my screen, so be sure to record the exercises before joining the breakout room. CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  8. Talk Outline Bottleneck Shortest Paths 1 A* search 2 Problems 3 CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  9. Bottleneck Shortest Paths Mentioned before spring break: network of roads, each has bridges of various heights on it. How high of a truck can go from s to t , or anywhere else? CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  10. Bottleneck Shortest Paths Mentioned before spring break: network of roads, each has bridges of various heights on it. How high of a truck can go from s to t , or anywhere else? ◮ Max bandwidth path from s to t CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  11. Bottleneck Shortest Paths Mentioned before spring break: network of roads, each has bridges of various heights on it. How high of a truck can go from s to t , or anywhere else? ◮ Max bandwidth path from s to t ◮ We’ll use it for network flows CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  12. Bottleneck Shortest Paths Mentioned before spring break: network of roads, each has bridges of various heights on it. How high of a truck can go from s to t , or anywhere else? ◮ Max bandwidth path from s to t ◮ We’ll use it for network flows On undirected graph: CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  13. Bottleneck Shortest Paths Mentioned before spring break: network of roads, each has bridges of various heights on it. How high of a truck can go from s to t , or anywhere else? ◮ Max bandwidth path from s to t ◮ We’ll use it for network flows On undirected graph: is maximum spanning tree CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  14. Bottleneck Shortest Paths Mentioned before spring break: network of roads, each has bridges of various heights on it. How high of a truck can go from s to t , or anywhere else? ◮ Max bandwidth path from s to t ◮ We’ll use it for network flows On undirected graph: is maximum spanning tree On directed graph: Dijkstra/Prim variant solves in O ( E + V log V ). CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  15. Dijkstra’s Algorithm 1: function Dijkstra ( s ) pred, dist ← {} , {} 2: q ← PriorityQueue ([(0, s , None)]) ⊲ dist, vertex, pred 3: while q do 4: d, u , parent ← q.pop min() 5: if u ∈ pred then 6: continue 7: pred[ u ] ← parent 8: dist[ u ] ← d 9: for u → v ∈ E do 10: q .push( (dist[u] + w ( u → v ), v , u ) ) 11: return dist, pred 12: CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  16. Dijkstra’s Prim’s Algorithm 1: function Prim ( s ) pred, dist ← {} , {} 2: q ← PriorityQueue ([( −∞ , s , None)]) ⊲ dist, vertex, pred 3: while q do 4: d, u , parent ← q.pop min() 5: if u ∈ pred then 6: continue 7: pred[ u ] ← parent 8: dist[ u ] ← d 9: for u → v ∈ E do 10: q .push( (dist[u] + w ( u → v ), v , u ) ) 11: return dist, pred 12: CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  17. Dijkstra’s Algorithm 1: function Dijkstra ( s ) pred, dist ← {} , {} 2: q ← PriorityQueue ([(0, s , None)]) ⊲ dist, vertex, pred 3: while q do 4: d, u , parent ← q.pop min() 5: if u ∈ pred then 6: continue 7: pred[ u ] ← parent 8: dist[ u ] ← d 9: for u → v ∈ E do 10: q .push( (dist[u] + w ( u → v ), v , u ) ) 11: return dist, pred 12: CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  18. Dijkstra’s Bottleneck shortest path Algorithm 1: function Bottleneck ( s ) pred, dist ← {} , {} 2: q ← PriorityQueue ([(0, s , None)]) ⊲ dist, vertex, pred 3: while q do 4: d, u , parent ← q.pop max() 5: if u ∈ pred then 6: continue 7: pred[ u ] ← parent 8: dist[ u ] ← d 9: for u → v ∈ E do 10: q .push( (min(dist[ u ] , w ( u → v )), v , u ) ) 11: return dist, pred 12: CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  19. Dijkstra’s Bottleneck shortest path Algorithm 1: function Bottleneck ( s ) pred, dist ← {} , {} 2: q ← PriorityQueue ([(0, s , None)]) ⊲ dist, vertex, pred 3: while q do 4: d, u , parent ← q.pop max() 5: if u ∈ pred then 6: continue 7: pred[ u ] ← parent 8: dist[ u ] ← d 9: for u → v ∈ E do 10: q .push( (min(dist[ u ] , w ( u → v )), v , u ) ) 11: return dist, pred 12: (min , +) → (max , min) CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  20. Talk Outline Bottleneck Shortest Paths 1 A* search 2 Problems 3 CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  21. Shortest s − t path with Dijkstra This is the wrong direction. Why waste our timing exploring it? CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  22. Shortest s − t path with Dijkstra This is the wrong direction. Why waste our timing exploring it? CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  23. Shortest s − t path with Dijkstra This is the wrong direction. Why waste our timing exploring it? CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  24. A ∗ search Dijkstra explores outward from s . CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  25. A ∗ search Dijkstra explores outward from s . ◮ Can stop if it reaches t , but doesn’t bias search toward t . CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  26. A ∗ search Dijkstra explores outward from s . ◮ Can stop if it reaches t , but doesn’t bias search toward t . Consider Dijkstra from Austin to San Francisco: CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  27. A ∗ search Dijkstra explores outward from s . ◮ Can stop if it reaches t , but doesn’t bias search toward t . Consider Dijkstra from Austin to San Francisco: ◮ Austin → New York = 1740 miles. CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  28. A ∗ search Dijkstra explores outward from s . ◮ Can stop if it reaches t , but doesn’t bias search toward t . Consider Dijkstra from Austin to San Francisco: ◮ Austin → New York = 1740 miles. ◮ Austin → San Francisco = 1760 miles. CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  29. A ∗ search Dijkstra explores outward from s . ◮ Can stop if it reaches t , but doesn’t bias search toward t . Consider Dijkstra from Austin to San Francisco: ◮ Austin → New York = 1740 miles. ◮ Austin → San Francisco = 1760 miles. Dijkstra will visit NYC before SF. CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

  30. A ∗ search Dijkstra explores outward from s . ◮ Can stop if it reaches t , but doesn’t bias search toward t . Consider Dijkstra from Austin to San Francisco: ◮ Austin → New York = 1740 miles. ◮ Austin → San Francisco = 1760 miles. Dijkstra will visit NYC before SF. ◮ Once it visits SF, it stops searching CS 331, Spring Eric Price (UT Austin) Dijkstra Variants: A* and Potentials / 16

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend