Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graphs David Johnson. Describing the Environment How do you tell a person/robot how to get somewhere? –Tell me how to get to the student services building…

Similar presentations


Presentation on theme: "Graphs David Johnson. Describing the Environment How do you tell a person/robot how to get somewhere? –Tell me how to get to the student services building…"— Presentation transcript:

1 Graphs David Johnson

2 Describing the Environment How do you tell a person/robot how to get somewhere? –Tell me how to get to the student services building…

3 World Representation Landmarks Paths/Roads Map This is abstracted as a graph –Not in the sense of a plot

4 Graphs A graph is a set of landmarks and the paths between them A graph G has –Set of vertices (or nodes) V –Set of edges E A graph is a classic data structure in CS V1V1 V2V2 V3V3 E1E1 E2E2

5 Graphs A directed graph means –E(A,B) does not imply E(B,A) –What kind of robot would need a graph that is not bidirectional? Edges may have weights –Where would this be appropriate? V1V1 V2V2 V3V3 E1E1 E2E2 1.4 2.6

6 Paths A path is a sequence of vertices such that for V i and V i+1 E i,i+1 exists A graph is connected if there is a path between all V –For what kind of robot and environment would this not be true? V1V1 V2V2 V3V3 E1E1 E2E2 1.4 2.6

7 Imagine a simple robot What is the simplest kind of robot you can think of?

8 Point Robots A point robot can move along the infinitesimal width edges of a graph. Path planning for this simple case is just searching a graph for a path.

9 Finding Paths Given a start and end, how do we find a path between them? V1V1 V2V2 V1V1 V3V3 V4V4 V7V7 V6V6 V8V8 V5V5

10 Depth First Search (DFS) Always take the first option V1V1 V2V2 V1V1 V3V3 V4V4 V7V7 V6V6 V8V8 V5V5

11 Depth First Search (DFS) Always take the first option V1V1 V2V2 V1V1 V3V3 V4V4 V7V7 V6V6 V8V8 V5V5

12 Depth First Search (DFS) Always take the first option V1V1 V2V2 V1V1 V3V3 V4V4 V7V7 V6V6 V8V8 V5V5

13 Depth First Search (DFS) Always take the first option V1V1 V2V2 V1V1 V3V3 V4V4 V7V7 V6V6 V8V8 V5V5

14 Depth First Search (DFS) Always take the first option V1V1 V2V2 V1V1 V3V3 V4V4 V7V7 V6V6 V8V8 V5V5

15 Depth First Search (DFS) Always take the first option V1V1 V2V2 V1V1 V3V3 V4V4 V7V7 V6V6 V8V8 V5V5

16 Depth First Search (DFS) Always take the first option V1V1 V2V2 V1V1 V3V3 V4V4 V7V7 V6V6 V8V8 V5V5

17 Breadth First Search (BFS) Exhaust all possibilities at same level first V1V1 V2V2 V1V1 V3V3 V4V4 V7V7 V6V6 V8V8 V5V5

18 Breadth First Search (BFS) Exhaust all possibilities at same level first V1V1 V2V2 V1V1 V3V3 V4V4 V7V7 V6V6 V8V8 V5V5

19 Breadth First Search (BFS) Exhaust all possibilities at same level first V1V1 V2V2 V1V1 V3V3 V4V4 V7V7 V6V6 V8V8 V5V5

20 Breadth First Search (BFS) Exhaust all possibilities at same level first V1V1 V2V2 V1V1 V3V3 V4V4 V7V7 V6V6 V8V8 V5V5

21 Representing a graph in Matlab Demo

22 Wavefront planner Use BFS on a grid Label cells with values –Start with zero –Expand from start –Add +1 to neighbors of current wavefront –Use gradient descent to search from goal to start

23 Representations: A Grid Distance is reduced to discrete steps –For simplicity, we’ll assume distance is uniform Direction is now limited from one adjacent cell to another

24 Representations: Connectivity 8-Point Connectivity –(chessboard metric) 4-Point Connectivity –(Manhattan metric)

25 The Wavefront Planner: Setup

26 The Wavefront in Action (Part 1) Starting with the goal, set all adjacent cells with “0” to the current cell + 1 –4-Point Connectivity or 8-Point Connectivity? –Your Choice. We’ll use 8-Point Connectivity in our example

27 The Wavefront in Action (Part 2) Now repeat with the modified cells –This will be repeated until goal is reached 0’s will only remain when regions are unreachable

28 The Wavefront in Action (Part 3) Repeat again...

29 The Wavefront in Action (Part 4) And again...

30 The Wavefront in Action (Part 5) And again until...

31 The Wavefront in Action (Done) You’re done

32 The Wavefront To find the shortest path simply always move toward a cell with a lower number –The numbers generated by the Wavefront planner are roughly proportional to their distance from the goal Two possible shortest paths shown


Download ppt "Graphs David Johnson. Describing the Environment How do you tell a person/robot how to get somewhere? –Tell me how to get to the student services building…"

Similar presentations


Ads by Google