CSUN, Prof. Law 16-cells by 16-cells Maze Starting Position Center Squares.

Slides:



Advertisements
Similar presentations
and 6.855J Modified Label Correcting Algorithm.
Advertisements

Data Structures and Algorithms (60-254)
Implementation and Evaluation of Search Methods. Use a stack data structure. 1. Push root node of tree on the stack. 2. Pop the top node off the stack.
The N-Queens Problem lab01.
Lecture 5: Floodfill. Floodfill Overview First assume that there are no walls Give each cell a distance from the goal. The goal has distance 0. Repeat.
Design Presentation The Prodigy. Introduction Group Members: Dale Balsis Tyson Seto-Mook Calvin Umeda Keoni Wasano.
Stacks & Queues Infix Calculator CSC 172 SPRING 2002 LECTURE 5.
Spanning Trees.
Infix, Postfix, Prefix.
Spanning Trees. 2 Spanning trees Suppose you have a connected undirected graph Connected: every node is reachable from every other node Undirected: edges.
Stacks (Revised and expanded from CIT 591). What is a stack? A stack is a Last In, First Out (LIFO) data structure Anything added to the stack goes on.
Stacks. 2 What is a stack? A stack is a Last In, First Out (LIFO) data structure Anything added to the stack goes on the “top” of the stack Anything removed.
Stacks. What is a stack? A stack is a Last In, First Out (LIFO) data structure Anything added to the stack goes on the “top” of the stack Anything removed.
1 CSCD 326 Data Structures I Infix Expressions. 2 Infix Expressions Binary operators appear between operands: W - X / Y - Z Order of evaluation is determined.
Navigation, Path finding, and Maze Encoding MICROMOUSE ALGORITHMS.
Spanning Trees. Spanning trees Suppose you have a connected undirected graph –Connected: every node is reachable from every other node –Undirected: edges.
Preorder Traversal with a Stack Push the root onto the stack. While the stack is not empty n pop the stack and visit it.
Lecture 5CSE Intro to Cognitive Science1 Algorithmic Thinking III.
CHAPTER 71 TREE. Binary Tree A binary tree T is a finite set of one or more nodes such that: (a) T is empty or (b) There is a specially designated node.
Shortest Path Algorithm This is called “Dijkstra’s Algorithm” …pronounced “Dirk-stra”
Shortest Path. Dijkstra’s Algorithm finds the shortest path from the start vertex to every other vertex in the network. We will find the shortest path.
Dijkstras Algorithm Named after its discoverer, Dutch computer scientist Edsger Dijkstra, is an algorithm that solves the single-source shortest path problem.
Micromouse Jeff Bouchard Qian Wang Karla Ananias.
OPERATOR PRECEDENCE PARSING
Distance. Euclidean Distance Minimum distance from a source (Value NoData) Input grid must have at least one source cell with the rest of the grid.
CS 6825: Binary Image Processing – binary blob metrics
Graphs. Made up of vertices and arcs Digraph (directed graph) –All arcs have arrows that give direction –You can only traverse the graph in the direction.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Applications of Stacks and Queues Stacks Linear list. One end is called top. Other end is called bottom. Additions to and removals from the top end only.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
Starting in Battery Park, begin to replace necessary subway grates with elevated grates. Seal up grates that prove to be unnecessary. Repeat this process.
A* Path Finding Ref: A-star tutorial.
Lecture 5: Grid-based Navigation for Mobile Robots.
Lecture 4: Floodfill. Floodfill Overview First assume that there are no walls Give each cell a distance from the goal. The goal has distance 0. Repeat.
CHP-3 STACKS.
Kruse/Ryba ch051 Object Oriented Data Structures Recursion Introduction to Recursion Principles of Recursion Backtracking: Postponing the Work Tree-Structured.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
- draw a diameter - make a radius - join diameter and radius -join other end of diameter and radius - put in any angle for one of the angles formed - fill.
ENGM 631 Maximum Flow Solutions. Maximum Flow Models (Flow, Capacity) (0,3) (2,2) (5,7) (0,8) (3,6) (6,8) (3,3) (4,4) (4,10)
6/12/2016© 2010 Raymond P. Jefferis IIILect The Network Layer.
 Chapter 7 introduces the stack data type.  Several example applications of stacks are given in that chapter.  This presentation shows another use called.
1 1 Slide © 2005 Thomson/South-Western Chapter 9 Network Models n Shortest-Route Problem n Minimal Spanning Tree Problem n Maximal Flow Problem.
CMSC201 Computer Science I for Majors Lecture 19 – Recursion
Articulation Points 2 of 2 (Algorithm)
Flood fill algorithm Also called seed fill, is an algorithm that determines the area connected to a given node in a multi-dimensional array, When applied.
St. Edward’s University
Infix to postfix conversion
Polygons.
CMSC201 Computer Science I for Majors Lecture 18 – Recursion
Computer Graphics Filled Area Primitives II Lecture 09 Taqdees A
Pushdown Automata.
Constraint Satisfaction Problems vs. Finite State Problems
More Recursion.
Loops and Switches Pre-Quiz
Comp 245 Data Structures Graphs.
Graph Search Applications
CMSC 341 Lecture 24 Max Flow Prof. Neary
Enumerating Distances Using Spanners of Bounded Degree
Shortest Path.
Shortest Path.
A* Path Finding Ref: A-star tutorial.
Spanning Trees.
TRANSPORTATION PROBLEM
Queues.
Location A. A. Elimam This presentation covers the quantitative material in Chapter 8. This slide can be used to introduce the material and basic concepts.
Stacks.
Advanced Computer Networks
Shortest Path.
Min Global Cut Animation
OPERATOR GRAMMAR No Ɛ-transition. No two adjacent non-terminals. Eg.
Presentation transcript:

CSUN, Prof. Law 16-cells by 16-cells Maze Starting Position Center Squares

CSUN, Prof. Law Applies concept of water always flowing from a higher elevation to a lower one Assigns each cell in the maze a value that represents how far the cell is from the center. The center cells value is zero; the farther from the center the higher the values. Higher values represent higher elevation. The center cells have lowest elevation.

CSUN, Prof. Law Cells labeling (X,Y) Starting Position Cell (0,0) Micromouse Cell (2,0) Cell (5,0) Cell (5,5) Cell (0,5) Center Cells (3,2) (3,3) (2,2) (2,3) Y X543210X

CSUN, Prof. Law Initially, no walls have been detected. Flooding of Maze with distances from center Starting Position Cell (0,0) Micromouse

CSUN, Prof. Law Micromouse is placed at the starting position It moves north, the only opening Starting Position Cell (0,0) East wall always exists

CSUN, Prof. Law Micromouse sees north wall Each time micromouse reaches a new cell, flooding occurs Starting Position Cell (0,0)

CSUN, Prof. Law Micromouse sees north wall Each time micromouse reaches a new cell, flooding occurs Starting Position Cell (0,0)

CSUN, Prof. Law After flooding, micromouse moves eastwards, the only opening & lower distance. Micromouse sees the east wall

CSUN, Prof. Law Micromouse sees the east wall. Each time micromouse reaches a new cell, flooding occurs

CSUN, Prof. Law After flooding, micromouse moves northwards to lower distance cell. Micromouse sees the east wall and the north wall

CSUN, Prof. Law Micromouse sees the east wall and the north wall. Each time micromouse reaches a new cell, flooding occurs

CSUN, Prof. Law After flooding, micromouse moves westwards to lower distance cell. Each time micromouse reaches a new cell, flooding occurs. Since no new wall is found, flooding will not change distances

CSUN, Prof. Law After flooding, micromouse moves northwards to lower distance cell. Micromouse sees east wall

CSUN, Prof. Law Micromouse sees east wall. Each time micromouse reaches a new cell, flooding occurs

CSUN, Prof. Law After flooding, micromouse moves northwards to lower distance cell. Micromouse sees east wall

CSUN, Prof. Law Micromouse sees east wall. Each time micromouse reaches a new cell, flooding occurs

CSUN, Prof. Law The same process continues until micromouse reaches the center. Final distances and paths to center are shown. Total squares traversed (not counting starting square) = 23 Total number of cell distance updates = 23 * 36 =

CSUN, Prof. Law The modified flood fill algorithm differs from Floodfill algorithm in that it does not flood the maze each time a new cell is reached. Instead it updates only the relevant neighboring cells using the following revised recursive steps:  Push the current cell location (x,y) onto the stack.  Repeat the following steps while the stack is not empty.  a. Pull the cell location (x,y) from the stack. b. If the minimum distance of the neighboring open cells, md, is not equal to the present cell’s distance - 1, replace the present cell’s distance with md + 1, and push all neighbor locations onto the stack.

CSUN, Prof. Law Initially, no walls have been detected. Flooding of Maze with distances from center Starting Position Cell (0,0) Micromouse

CSUN, Prof. Law Micromouse is placed at the starting position It moves north, the only opening Starting Position Cell (0,0) East wall always exists

CSUN, Prof. Law Micromouse sees north wall Each time micromouse reaches a new cell, recursive updating steps are evaluated. The minimum distance of the neighboring open cells, md is 2 = ; hence no update is necessary. Starting Position Cell (0,0)

CSUN, Prof. Law Micromouse moves eastwards, the only opening & lower distance. It sees the east wall. Each time micromouse reaches a new cell, recursive updating steps are evaluated. The minimum distance of the neighboring open cells, md is 1 = ; hence no update is necessary

CSUN, Prof. Law Micromouse moves northwards to lower distance cell and sees the east wall and the north wall. The minimum distance of the neighboring open cells, md is 2 ≠ ; hence update is necessary

CSUN, Prof. Law Recursive distance update steps 1. Push the current cell location (2,1) onto the stack. 2a. Pull the cell location (2,1) from the stack. 2b. Since the distance at (2,1) – 1 = 0 is not equal to md = 2, the minimum of its open neighbors (2,0) and (1,1), update the distance at (2,1) to md + 1 = = 3. Push all neighbor locations (3,1), (2,0) and (1,1), except the center location (2,2), onto the stack. Cell (2,0) Cell (1,1) Cell (3,1) Stack Top (3,1) (2,0) (3,1) (1,1) (2,0) (3,1)

CSUN, Prof. Law Recursive distance update steps Since the stack is not empty, 2a. Pull the cell location (1,1) from the stack. 2b. Since the distance at (1,1) – 1 = 1 is not equal to md = 3, the minimum of its open neighbors (2,1), (0,1) and (1,0), update the distance at (1,1) to md + 1 = = 4. Push all neighbor locations (2,1), (0,1), (1,0), and (1,2) onto the stack Cell (1,1) (2,0) (3,1) Stack Top (1,1) (2,0) (3,1)

CSUN, Prof. Law After the distance update, push all neighbor locations (2,1), (0,1), (1,0), and (1,2) onto the stack. Cell (1,0) Cell (0,1) Cell (2,1) (2,0) (3,1) Stack Top (2,1) (2,0) (3,1) (0,1) (2,1) (2,0) (3,1) (1,0) (0,1) (2,1) (2,0) (3,1) (1,2) (1,0) (0,1) (2,1) (2,0) (3,1) Cell (1,2)

CSUN, Prof. Law Recursive distance update steps Since the stack is not empty, 2a. Pull the cell location (1,2) from the stack. 2b. Since the distance at (1,2) – 1 = 0 is equal to md = 0, no update is necessary. Cell (1,0) Cell (0,1) Cell (2,1) (2,0) (3,1) Stack Top (2,1) (2,0) (3,1) (0,1) (2,1) (2,0) (3,1) (1,0) (0,1) (2,1) (2,0) (3,1) (1,2) (1,0) (0,1) (2,1) (2,0) (3,1) Cell (1,2)

CSUN, Prof. Law Recursive distance update steps Since the stack is not empty, 2a. Pull the cell location (1,0) from the stack. 2b. Since the distance at (1,0) – 1 = 2 is not equal to md = 4, Its distance is updated to md + 1 = 5. Push all neighbors (0,0) and (1,1) onto stack. Cell (1,0) Cell (0,1) Cell (2,1) (2,0) (3,1) Stack Top (2,1) (2,0) (3,1) (0,1) (2,1) (2,0) (3,1) (1,0) (0,1) (2,1) (2,0) (3,1)

CSUN, Prof. Law After the distance update at (1,0) Push all neighbors (0,0) and (1,1) onto stack Cell (0,0) Cell (1,1) (0,1) (2,1) (2,0) (3,1) Stack Top Cell (1,0) (0,0) (0,1) (2,1) (2,0) (3,1) (1,1) (0,0) (0,1) (2,1) (2,0) (3,1)

CSUN, Prof. Law Recursive distance update steps Since the stack is not empty, 2a. Pull the cell location (1,1) from the stack. 2b. Since the distance at (1,1) – 1 = 3 is equal to md = 3, no update is necessary Cell (0,0) Cell (1,1) (0,1) (2,1) (2,0) (3,1) Stack Top Cell (1,0) (0,0) (0,1) (2,1) (2,0) (3,1) (1,1) (0,0) (0,1) (2,1) (2,0) (3,1)

CSUN, Prof. Law Recursive distance update steps Since the stack is not empty, 2a. Pull the cell location (0,0) from the stack. 2b. Since the distance at (0,0) – 1 = 4 is equal not to md = 5, its distance updated to md + 1 = Cell (0,0) (0,1) (2,1) (2,0) (3,1) Stack Top Cell (1,0) (0,0) (0,1) (2,1) (2,0) (3,1)

CSUN, Prof. Law The same process continues and it will not be shown here. When the stack is empty, the distances are as shown Stack Top