Dijkstra Variants: A* and Potentials
Eric Price
UT Austin
CS 331, Spring 2020 Coronavirus Edition
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
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
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ So you can try that, as well as chat, for questions. Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ So you can try that, as well as chat, for questions.
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ So you can try that, as well as chat, for questions.
◮ Inside, you can “Ask for help” and it pops up a notification for me. Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ So you can try that, as well as chat, for questions.
◮ 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
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Max bandwidth path from s to t Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Max bandwidth path from s to t ◮ We’ll use it for network flows Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Max bandwidth path from s to t ◮ We’ll use it for network flows
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Max bandwidth path from s to t ◮ We’ll use it for network flows
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Max bandwidth path from s to t ◮ We’ll use it for network flows
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t. Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
◮ Austin→ New York = 1740 miles. Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
◮ Austin→ New York = 1740 miles. ◮ Austin→ San Francisco = 1760 miles. Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
◮ Austin→ New York = 1740 miles. ◮ Austin→ San Francisco = 1760 miles.
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
◮ Austin→ New York = 1740 miles. ◮ Austin→ San Francisco = 1760 miles.
◮ Once it visits SF, it stops searching Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
◮ Austin→ New York = 1740 miles. ◮ Austin→ San Francisco = 1760 miles.
◮ Once it visits SF, it stops searching ◮ So it needs to visit NYC, in case it can get from NYC to SF in 20 miles. Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
◮ Austin→ New York = 1740 miles. ◮ Austin→ San Francisco = 1760 miles.
◮ Once it visits SF, it stops searching ◮ So it needs to visit NYC, in case it can get from NYC to SF in 20 miles. ◮ ...with a portal or something? Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
◮ Austin→ New York = 1740 miles. ◮ Austin→ San Francisco = 1760 miles.
◮ Once it visits SF, it stops searching ◮ So it needs to visit NYC, in case it can get from NYC to SF in 20 miles. ◮ ...with a portal or something? ◮ Fact: you cannot get from NYC to SF in 20 miles. Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
◮ Austin→ New York = 1740 miles. ◮ Austin→ San Francisco = 1760 miles.
◮ Once it visits SF, it stops searching ◮ So it needs to visit NYC, in case it can get from NYC to SF in 20 miles. ◮ ...with a portal or something? ◮ Fact: you cannot get from NYC to SF in 20 miles.
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
◮ Austin→ New York = 1740 miles. ◮ Austin→ San Francisco = 1760 miles.
◮ Once it visits SF, it stops searching ◮ So it needs to visit NYC, in case it can get from NYC to SF in 20 miles. ◮ ...with a portal or something? ◮ Fact: you cannot get from NYC to SF in 20 miles.
◮ Dijkstra: visit node of smallest dist[u] Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
◮ Austin→ New York = 1740 miles. ◮ Austin→ San Francisco = 1760 miles.
◮ Once it visits SF, it stops searching ◮ So it needs to visit NYC, in case it can get from NYC to SF in 20 miles. ◮ ...with a portal or something? ◮ Fact: you cannot get from NYC to SF in 20 miles.
◮ Dijkstra: visit node of smallest dist[u] ◮ A∗: visit node of smallest dist[u] + h(u) Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
◮ Austin→ New York = 1740 miles. ◮ Austin→ San Francisco = 1760 miles.
◮ Once it visits SF, it stops searching ◮ So it needs to visit NYC, in case it can get from NYC to SF in 20 miles. ◮ ...with a portal or something? ◮ Fact: you cannot get from NYC to SF in 20 miles.
◮ Dijkstra: visit node of smallest dist[u] ◮ A∗: visit node of smallest dist[u] + h(u)
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ Can stop if it reaches t, but doesn’t bias search toward t.
◮ Austin→ New York = 1740 miles. ◮ Austin→ San Francisco = 1760 miles.
◮ Once it visits SF, it stops searching ◮ So it needs to visit NYC, in case it can get from NYC to SF in 20 miles. ◮ ...with a portal or something? ◮ Fact: you cannot get from NYC to SF in 20 miles.
◮ Dijkstra: visit node of smallest dist[u] ◮ A∗: visit node of smallest dist[u] + h(u)
◮ Any path through NYC will take at least 3700 miles. Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ A∗: visit node of smallest dist[u] + h(u) Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ A∗: visit node of smallest dist[u] + h(u) ◮ Paths equivalent to Dijkstra on a reweighted graph:
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ A∗: visit node of smallest dist[u] + h(u) ◮ Paths equivalent to Dijkstra on a reweighted graph:
◮ Every s t path P on w ′ has length
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ A∗: visit node of smallest dist[u] + h(u) ◮ Paths equivalent to Dijkstra on a reweighted graph:
◮ Every s t path P on w ′ has length
◮ So which path is shortest is same under w or w ′. Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ A∗: visit node of smallest dist[u] + h(u) ◮ Paths equivalent to Dijkstra on a reweighted graph:
◮ Every s t path P on w ′ has length
◮ So which path is shortest is same under w or w ′.
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ A∗: visit node of smallest dist[u] + h(u) ◮ Paths equivalent to Dijkstra on a reweighted graph:
◮ Every s t path P on w ′ has length
◮ So which path is shortest is same under w or w ′.
◮ Heuristic “admissible:” h(u) ≤ d(u, t) Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ A∗: visit node of smallest dist[u] + h(u) ◮ Paths equivalent to Dijkstra on a reweighted graph:
◮ Every s t path P on w ′ has length
◮ So which path is shortest is same under w or w ′.
◮ Heuristic “admissible:” h(u) ≤ d(u, t) ⋆ Admissible =
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ A∗: visit node of smallest dist[u] + h(u) ◮ Paths equivalent to Dijkstra on a reweighted graph:
◮ Every s t path P on w ′ has length
◮ So which path is shortest is same under w or w ′.
◮ Heuristic “admissible:” h(u) ≤ d(u, t) ⋆ Admissible =
◮ Heuristic “consistent:” h(t) = 0 and h(u) ≤ w(u, v) + h(v). Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ A∗: visit node of smallest dist[u] + h(u) ◮ Paths equivalent to Dijkstra on a reweighted graph:
◮ Every s t path P on w ′ has length
◮ So which path is shortest is same under w or w ′.
◮ Heuristic “admissible:” h(u) ≤ d(u, t) ⋆ Admissible =
◮ Heuristic “consistent:” h(t) = 0 and h(u) ≤ w(u, v) + h(v). ⋆ Equivalent: h(t) = 0 and w ′(u, v) ≥ 0 for all u, v. Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ A∗: visit node of smallest dist[u] + h(u) ◮ Paths equivalent to Dijkstra on a reweighted graph:
◮ Every s t path P on w ′ has length
◮ So which path is shortest is same under w or w ′.
◮ Heuristic “admissible:” h(u) ≤ d(u, t) ⋆ Admissible =
◮ Heuristic “consistent:” h(t) = 0 and h(u) ≤ w(u, v) + h(v). ⋆ Equivalent: h(t) = 0 and w ′(u, v) ≥ 0 for all u, v. ⋆ w ′ ≥ 0 =
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ A∗: visit node of smallest dist[u] + h(u) ◮ Paths equivalent to Dijkstra on a reweighted graph:
◮ Every s t path P on w ′ has length
◮ So which path is shortest is same under w or w ′.
◮ Heuristic “admissible:” h(u) ≤ d(u, t) ⋆ Admissible =
◮ Heuristic “consistent:” h(t) = 0 and h(u) ≤ w(u, v) + h(v). ⋆ Equivalent: h(t) = 0 and w ′(u, v) ≥ 0 for all u, v. ⋆ w ′ ≥ 0 =
⋆ And consistent =
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ How do they relate to MSTs? Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ How do they relate to MSTs?
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ How do they relate to MSTs?
◮ Can adjust the graph to have nonnegative weights Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ How do they relate to MSTs?
◮ Can adjust the graph to have nonnegative weights ◮ Can adjust the graph to bias toward goal t (A∗ search). Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ How do they relate to MSTs?
◮ Can adjust the graph to have nonnegative weights ◮ Can adjust the graph to bias toward goal t (A∗ search). ◮ Admissible =
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ How do they relate to MSTs?
◮ Can adjust the graph to have nonnegative weights ◮ Can adjust the graph to bias toward goal t (A∗ search). ◮ Admissible =
◮ Consistent =
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
◮ How do they relate to MSTs?
◮ Can adjust the graph to have nonnegative weights ◮ Can adjust the graph to bias toward goal t (A∗ search). ◮ Admissible =
◮ Consistent =
◮ Can be faster in many cases. Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16
Eric Price (UT Austin) Dijkstra Variants: A* and Potentials CS 331, Spring / 16