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…

Slides:



Advertisements
Similar presentations
Heuristic Search techniques
Advertisements

Jecho and Donatus Depth First and Breadth First Search.
Reactive and Potential Field Planners
Introduction to Algorithms Lecture 12 Prof. Constantinos Daskalakis CLRS
CSE 390B: Graph Algorithms Based on CSE 373 slides by Jessica Miller, Ruth Anderson 1.
Review Binary Search Trees Operations on Binary Search Tree
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
1 Graphs Traversals In many graph problems, we need to traverse the vertices of the graph in some order Analogy: Binary tree traversals –Pre-order Traversal.
CS 206 Introduction to Computer Science II 03 / 27 / 2009 Instructor: Michael Eckmann.
Breadth-First Search Seminar – Networking Algorithms CS and EE Dept. Lulea University of Technology 27 Jan Mohammad Reza Akhavan.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 excerpts Graphs (breadth-first-search)
CS 206 Introduction to Computer Science II 11 / 07 / 2008 Instructor: Michael Eckmann.
Graphs Graphs are the most general data structures we will study in this course. A graph is a more general version of connected nodes than the tree. Both.
Data Structure and Algorithms (BCS 1223) GRAPH. Introduction of Graph A graph G consists of two things: 1.A set V of elements called nodes(or points or.
Breadth-First Search David Johnson. Today Look at one version of Breadth-first search on a grid Develop Matlab version of BFS.
CS171 Introduction to Computer Science II Graphs Strike Back.
Graphs By JJ Shepherd. Introduction Graphs are simply trees with looser restrictions – You can have cycles Historically hard to deal with in computers.
Graph II MST, Shortest Path. Graph Terminology Node (vertex) Edge (arc) Directed graph, undirected graph Degree, in-degree, out-degree Subgraph Simple.
Graphs CS-240/341. Graphs Used for representing many-to-many relationships –can take two forms directed (digraph) - a finite set of elements called vertices.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
Graphs CS-240/341. Uses for Graphs computer networks and routing airline flights geographic maps course prerequisite structures tasks for completing a.
1 Data Structures and Algorithms Graphs I: Representation and Search Gal A. Kaminka Computer Science Department.
Spring 2010CS 2251 Graphs Chapter 10. Spring 2010CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs.
Graphs. Graphs Many interesting situations can be modeled by a graph. Many interesting situations can be modeled by a graph. Ex. Mass transportation system,
Breadth First Search (BFS) Part 2 COMP171. Graph / Slide 2 Shortest Path Recording * BFS we saw only tells us whether a path exists from source s, to.
Fall 2007CS 2251 Graphs Chapter 12. Fall 2007CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs To.
Graphs & Graph Algorithms Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
CS 206 Introduction to Computer Science II 03 / 30 / 2009 Instructor: Michael Eckmann.
CISC220 Fall 2009 James Atlas Nov 13: Graphs, Line Intersections.
Introduction to Mobile Robots Motion Planning Prof.: S. Shiry Pooyan Fazli M.Sc Computer Science Department of Computer Eng. and IT Amirkabir Univ. of.
Spanning Trees. Spanning trees Suppose you have a connected undirected graph –Connected: every node is reachable from every other node –Undirected: edges.
Search  Exhaustive/Blind Search Methods Depth First Search Breadth First Search  Heuristic Methods Hill Climbing Beam Search Best First Search…
Motion Planning Howie CHoset.
Introduction to Routing. The Routing Problem Apply after placement Input: –Netlist –Timing budget for, typically, critical nets –Locations of blocks and.
Dijkstra’s Algorithm and Heuristic Graph Search David Johnson.
3.0 State Space Representation of Problems 3.1 Graphs 3.2 Formulating Search Problems 3.3 The 8-Puzzle as an example 3.4 State Space Representation using.
Lab 3 How’d it go?.
Lecture 12-2: Introduction to Computer Algorithms beyond Search & Sort.
COSC 2007 Data Structures II Chapter 14 Graphs III.
How are things going? Core AI Problem Mobile robot path planning: identifying a trajectory that, when executed, will enable the robot to reach the goal.
Today’s Topics FREE Code that will Write Your PhD Thesis, a Best-Selling Novel, or Your Next Methods for Intelligently/Efficiently Searching a Space.
1 Spanning Trees Longin Jan Latecki Temple University based on slides by David Matuszek, UPenn, Rose Hoberman, CMU, Bing Liu, U. of Illinois, Boting Yang,
Data Structures and Algorithms Ver. 1.0 Session 17 Objectives In this session, you will learn to: Implement a graph Apply graphs to solve programming problems.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
Graphs. Definitions A graph is two sets. A graph is two sets. –A set of nodes or vertices V –A set of edges E Edges connect nodes. Edges connect nodes.
10 Copyright © William C. Cheng Data Structures - CSCI 102 Graph Terminology A graph consists of a set of Vertices and a set of Edges C A B D a c b d e.
Graphs A graphs is an abstract representation of a set of objects, called vertices or nodes, where some pairs of the objects are connected by links, called.
1 Spanning Trees Longin Jan Latecki Temple University based on slides by David Matuszek, UPenn, Rose Hoberman, CMU, Bing Liu, U. of Illinois, Boting Yang,
1 Directed Graphs Chapter 8. 2 Objectives You will be able to: Say what a directed graph is. Describe two ways to represent a directed graph: Adjacency.
Graphs Slide credits:  K. Wayne, Princeton U.  C. E. Leiserson and E. Demaine, MIT  K. Birman, Cornell U.
Lecture 5: Grid-based Navigation for Mobile Robots.
Motion Planning Howie CHoset. Assign HW Algorithms –Start-Goal Methods –Map-Based Approaches –Cellular Decompositions.
Graphs + Shortest Paths David Kauchak cs302 Spring 2013.
Graph Representations And Traversals. Graphs Graph : – Set of Vertices (Nodes) – Set of Edges connecting vertices (u, v) : edge connecting Origin: u Destination:
Graph Searching CSIT 402 Data Structures II. 2 Graph Searching Methodology Depth-First Search (DFS) Depth-First Search (DFS) ›Searches down one path as.
Graph Theory Def: A graph is a set of vertices and edges G={V,E} Ex. V = {a,b,c,d,e} E = {ab,bd,ad,ed,ce,cd} Note: above is a purely mathematical definition.
1 3/21/2016 MATH 224 – Discrete Mathematics First we determine if a graph is connected.
Lecture #13. Topics 1.The Graph Abstract Data Type. 2.Graph Representations. 3.Elementary Graph Operations.
CSE 326: Data Structures Lecture #17 Heuristic Graph Search Henry Kautz Winter Quarter 2002.
Graphs. What is a graph? In simple words, A graph is a set of vertices and edges which connect them. A node (or vertex) is a discrete position in the.
Code: BCA302 Data Structures with C Prof. (Dr.) Monalisa Banerjee By.
Graphs – Part III CS 367 – Introduction to Data Structures.
Spanning Trees Longin Jan Latecki Temple University based on slides by
Path Planning in Discrete Sampled Space
Graphs Part 2 Adjacency Matrix
CO Games Development 1 Week 8 Depth-first search, Combinatorial Explosion, Heuristics, Hill-Climbing Gareth Bellaby.
Path Planning in Discrete Sampled Space
GRAPHS G=<V,E> Adjacent vertices Undirected graph
Spanning Trees Longin Jan Latecki Temple University based on slides by
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Presentation transcript:

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…

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

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

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 E2E

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 E2E

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

Representing a graph in Matlab Demo

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

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

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

The Wavefront Planner: Setup

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

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

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

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

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

The Wavefront in Action (Done) You’re done

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