Solving a Maze using Graph Algorithms

Slides:



Advertisements
Similar presentations
Heuristic Search techniques
Advertisements

Introduction to Algorithms Lecture 12 Prof. Constantinos Daskalakis CLRS
Depth-First Search1 Part-H2 Depth-First Search DB A C E.
Graphs Chapter 12. Chapter Objectives  To become familiar with graph terminology and the different types of graphs  To study a Graph ADT and different.
CS 206 Introduction to Computer Science II 11 / 07 / 2008 Instructor: Michael Eckmann.
Edited by Malak Abdullah Jordan University of Science and Technology Data Structures Using C++ 2E Chapter 12 Graphs.
Searching Algorithms Finding what you are looking for.
Graphs By JJ Shepherd. Introduction Graphs are simply trees with looser restrictions – You can have cycles Historically hard to deal with in computers.
ITEC200 – Week 12 Graphs. 2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study.
Graphs CS-240/341. Uses for Graphs computer networks and routing airline flights geographic maps course prerequisite structures tasks for completing a.
CS 206 Introduction to Computer Science II 11 / 10 / 2008 Instructor: Michael Eckmann.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Spring 2010CS 2251 Graphs Chapter 10. Spring 2010CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs.
CS 206 Introduction to Computer Science II 11 / 03 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 11 / 05 / 2008 Instructor: Michael Eckmann.
Fall 2007CS 2251 Graphs Chapter 12. Fall 2007CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs To.
CS 206 Introduction to Computer Science II 03 / 30 / 2009 Instructor: Michael Eckmann.
CISC220 Fall 2009 James Atlas Nov 13: Graphs, Line Intersections.
Graphs Chapter 28 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
CSC 213 – Large Scale Programming. Today’s Goals  Make Britney sad through my color choices  Revisit issue of graph terminology and usage  Subgraphs,
Graph Introduction, Searching Graph Theory Basics - Anil Kishore.
Depth-First Search1 DB A C E. 2 Depth-first search (DFS) is a general technique for traversing a graph A DFS traversal of a graph G – Visits all the vertices.
Depth-First Search Lecture 21: Graph Traversals
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Graphs. Introduction Graphs are a collection of vertices and edges Graphs are a collection of vertices and edges The solid circles are the vertices A,
Breadth First Search and Depth First Search. Greatest problem in Computer Science Has lead to a lot of new ideas and data structures Search engines before.
Graphs Chapter 28 © 2015 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures and Abstractions with Java, 4e Frank Carrano.
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
CSC 213 – Large Scale Programming Lecture 31: Graph Traversals.
Code: BCA302 Data Structures with C Prof. (Dr.) Monalisa Banerjee By.
Representing Graphs Depth First Search Breadth First Search Graph Searching Algorithms.
CSC 172 DATA STRUCTURES.
Data Structures & Algorithm Analysis lec(8):Graph T. Souad alonazi
Tracing An Algorithm for Strongly Connected Components that uses Depth First Search Graph obtained from Text, page a-al: Geetika Tewari.
Graphs Representation, BFS, DFS
Chapter 3. Decompositions of Graphs
Graph Traversals Some algorithms require that every vertex of a graph be visited exactly once. The order in which the vertices are visited may be important,
Source Code for Data Structures and Algorithm Analysis in C (Second Edition) – by Weiss
Graph Searching.
CSC 172 DATA STRUCTURES.
Refresh and Get Ready for More
CSE 421: Introduction to Algorithms
Depth-First Search D B A C E Depth-First Search Depth-First Search
Graphs Representation, BFS, DFS
Graphs.
Elementary Graph Algorithms
CSE 214 – Computer Science II Graph Walking
Depth-First Search D B A C E Depth-First Search Depth-First Search
Chapter 11 Graphs.
Graphs Part 2 Adjacency Matrix
Search Exercise Search Tree? Solution (Breadth First Search)?
Maze Design Presentation Questions
COMP171 Depth-First Search.
(1) Breadth-First Search  S Queue S
Algorithms Lecture # 29 Dr. Sohail Aslam.
Richard Anderson Winter 2009 Lecture 6
Algorithms: Design and Analysis
Breadth-First Search L0 L1 L2 C B A E D F Breadth-First Search
Graph Traversal Lecture 18 CS 2110 — Spring 2019.
GRAPHS G=<V,E> Adjacent vertices Undirected graph
Graphs.
Graphs.
Graphs.
Graphs.
Copyright ©2012 by Pearson Education, Inc. All rights reserved
Graphs.
Graph Search in C++ Andrew Lindsay.
For Friday Read chapter 9, sections 2-3 No homework
More Graphs Lecture 19 CS2110 – Fall 2009.
Presentation transcript:

Solving a Maze using Graph Algorithms By Clara Bryant

How a Human solves a Maze Greek Myth of the Minotaur Greek hero Theseus is given string to find his way through and back out of the maze String and chalk method to solve a maze Mark the places you’ve visited already

The Graph Representation What is a graph? A graph is a representation of connections between points Similar to graph representations of molecules The representation does not look like how the molecule looks in reality, but helps you understand the collections between the atoms “nodes” = circles; points of connection “vertices” = lines; connections themselves The Graph Representation of a Water Molecule

Converting a maze to a graph

Algorithm* for Converting a maze to a graph For every time you have a choice in path, you number that choice These are the nodes Starting from the entrance, draw one connection (one vertex) for every “hallway” Draw one node for every choice in path Make a new level of connections for every group of choices you encounter The graph will be in the shape of a tree: https://www.youtube.com/watch?v=k1tSK5V1pds *Algorithm = series of steps to follow

Depth-first search A graph algorithm Solves tree graphs branch-by-branch Similar to the string-and-chalk method, but follows the order of the nodes instead of making “random” choices What it looks like: https://www.cs.usfca.edu/~galles/visualization/ DFS.html

The Solution

More Complicated Example Some mazes take a really long time for a human to solve on their own We can use computers and coding to implement graph search algorithms http://stackoverflow.com/questions/12995434/repres enting-and-solving-a-maze-given-an-image?rq=1

Breadth-First search Solves tree graphs level-by-level Could be implemented in real life if you can multiple people in the maze What they look like: https://www.cs.usfca.edu/~galles/visualization/BFS.ht ml

Thank You.