The Rock Boxers: Tabitha Greenwood Cameron Meade Noah Cahan

Slides:



Advertisements
Similar presentations
Problem solving with graph search
Advertisements

AI Pathfinding Representing the Search Space
CS 206 Introduction to Computer Science II 04 / 01 / 2009 Instructor: Michael Eckmann.
CSE 390B: Graph Algorithms Based on CSE 373 slides by Jessica Miller, Ruth Anderson 1.
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
Pathfinding. “PathEngine is a sophisticated middleware tool- kit for the implementation of intelligent agent movement, built around an advanced implementation.
CS 206 Introduction to Computer Science II 11 / 07 / 2008 Instructor: Michael Eckmann.
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.
CS 206 Introduction to Computer Science II 11 / 10 / 2008 Instructor: Michael Eckmann.
Pathfinding Algorithms Josh Palmer Rachael Beers.
CS 206 Introduction to Computer Science II 03 / 30 / 2009 Instructor: Michael Eckmann.
Dijkstra’s Algorithm Slide Courtesy: Uwash, UT 1.
1 Shortest Path Calculations in Graphs Prof. S. M. Lee Department of Computer Science.
Informed Search Idea: be smart about what paths to try.
Dijkstra’s Algorithm and Heuristic Graph Search David Johnson.
Busby, Dodge, Fleming, and Negrusa. Backtracking Algorithm Is used to solve problems for which a sequence of objects is to be selected from a set such.
1 Game AI Path Finding. A Common Situation of Game AI A Common Situation of Game AI Path Planning Path Planning –From a start position to a destination.
Dijkstras Algorithm Named after its discoverer, Dutch computer scientist Edsger Dijkstra, is an algorithm that solves the single-source shortest path problem.
P ROBLEM Write an algorithm that calculates the most efficient route between two points as quickly as possible.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
A* Path Finding Ref: A-star tutorial.
SPANNING TREES Lecture 21 CS2110 – Fall Nate Foster is out of town. NO 3-4pm office hours today!
1 CO Games Development 1 Week 8 A* Gareth Bellaby.
Decision Maths 1 Shortest path algorithm Dijkstra’s Algorithm A V Ali :
Honors Track: Competitive Programming & Problem Solving Finding your way with A*-algorithm Patrick Shaw.
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
CSE 373: Data Structures and Algorithms Lecture 21: Graphs V 1.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Lecture 3: Uninformed Search
Review: Tree search Initialize the frontier using the starting state
Chapter 5.4 Artificial Intelligence: Pathfinding
A vertex u is reachable from vertex v iff there is a path from v to u.
Department of Computer Science
Heuristic Search Introduction to Artificial Intelligence
Spanning Trees Lecture 21 CS2110 – Fall 2016.
Single-Source Shortest Paths
Discrete Optimization Lecture 1
Maze Implementation, Analysis and Design to find Shortest Paths
Tori Pruim, Simone Liu, Zach Parks
Finding Heuristics Using Abstraction
Short paths and spanning trees
Comp 245 Data Structures Graphs.
Graphs Representation, BFS, DFS
Decision Maths Dijkstra’s Algorithm.
Shortest Path.
A* Path Finding Ref: A-star tutorial.
CSE 373: Data Structures and Algorithms
Graphs.
Informed search algorithms
Team 17c ****** Pathfinding
Graphs Part 2 Adjacency Matrix
Slide Courtesy: Uwash, UT
CSE 373: Data Structures and Algorithms
CO Games Development 1 Week 8 Depth-first search, Combinatorial Explosion, Heuristics, Hill-Climbing Gareth Bellaby.
Troposphere (sic) Fliers
Shortest Path Algorithm for Weighted Non-negative Undirected Graphs
HW 1: Warmup Missionaries and Cannibals
CE 221 Data Structures and Algorithms
CSE 373 Data Structures and Algorithms
Slide Courtesy: Uwash, UT
Informed Search Idea: be smart about what paths to try.
Dijkstra's Shortest Path Algorithm
Spanning Trees Lecture 20 CS2110 – Spring 2015.
HW 1: Warmup Missionaries and Cannibals
Graphs: Shortest path and mst
Informed Search Idea: be smart about what paths to try.
Presentation transcript:

The Rock Boxers: Tabitha Greenwood Cameron Meade Noah Cahan Pathfinding The Rock Boxers: Tabitha Greenwood Cameron Meade Noah Cahan

Introduction Pathfinding uses designed algorithms to optimizes the fastest route to a set endpoint from a set start point based off of distance. Three of the most commonly used algorithms used when it comes to pathfinding is Breadth First Search, Dijktra’s, and A*. They use heuristics to navigate through the nodes of a graph and find the fastest path to the end point based off of a distance cost.

Stating the problem informally An object seeks to reach one point on a grid from another. This object will use three different algorithms to find pathways around various obstacles on a map. The size of the map will remain the same. The objective is to compare the ability of each algorithm to find the shortest path.

Formal statement Let K(V,E) be a graph with vertex set V={v_1,v_2,…,v_m} and edge set E={(v_i,v_j) | vi and v_j∈V, v_i != v_j}. M is the Map The gate set is the set that contains the starting point start and ending point finish within M. G = {start, finish} A path from start to finish is a sequence of distinct steps: {(d1, d2), (d2, d3), …, (dk-1, dk)} Where d1 = start and dk = finish. Our goal is to identify the shortest path (P_shortest) from start to finish within M(O, G). Where O is the obstructions Let P_all be the set of all possible path lengths within M from start to finish. P_all = {p1, p2, …, p_i}

Dijkstra’s Dijkstra’s algorithm begins at the starting point and checks every surrounding vertex. After checked the vertex is added to a set of checked vertices. This continues until it reaches the end point.

Dijkstra’s Continued At each step, the node in the unvisited set with the lowest distance from the start is examined. We calculate the tentative distances of all unvisited neighbors of the current node and compare them to the currently assigned value and use the smaller one. The algorithm selects the node with the shortest tentative distance and repeats the whole process again. U = Set of univisited nodes. V = Set of visited nodes. if U[ i ].dist < short{ //distance of current node. short = U[ i ].dist }

This algorithm starts at one node and repeatedly visits neighbors This algorithm starts at one node and repeatedly visits neighbors. A “frontier” is the boundary between the evaluated and the not evaluated nodes. The frontier expands out from the original node until the whole graph has been evaluated. Breadth-first

A* The A* algorithm uses the distance formula to calculate a cost of movement and find the shortest path possible in a graph. O(n^2) based on code and loops within

A* Continued To evaluate f(n) = g(n) +h(n) Where h(n) is the estimated cost from point to goal (distance from current node to end point) and g(n) is the cost from start to point(movement cost) To find h(n) Distance = √(dx²+dy²) Where x₂ = coordinate of the goal point, x₁ = coordinate of the current point, y₂ = coordinate of the goal point, and y₁ = coordinate of current point dx = |x₂ - x₁| dy = |y₂ - y₁|

A* Continued To implement this algorithm there are two lists created Fringe : A set of points that are available to check. Initially only containing starting point. Graphically considered the “frontier”. Closed: A set of points already checked. Initially empty or only containing the points of the obstructions. Graphically considered the “interior”. Each node has a pointer to its parent to keep track of the path it takes. There is a loop that pulls the best node (n) in the fringe list and checks it. Determined best if (f) is lowest. If (n) is the goal the loop breaks. If not (n) is taken from the fringe list and added to the closed list. The nodes (n’) surrounding are then checked .If (n’) is in the closed set it is ignored.

Average Times (ran 100 times) Column1 32x32 4x64 128x128 A* 0.0075 0.02265 0.1445 breadth First 0.00629 0.01555 0.0737 dijktsra's 0.0414 0.35025 5.53805

Average Number of Calls (ran 100 times) Column1 32x32 64x64 128x128 A* 7093 25529 161911 breadth First 5891 17883 87399 dijktra's 12906 79665 201593

Results Continued

Questions What is a heuristic? a commonsense rule (or set of rules) intended to increase the probability of solving some problem When was Breadth First the quickest algorithm and why? In the smaller maps because it was faster to search the entire map then calculate the cost and search only part of the map. What is a greedy algorithm? an algorithmic paradigm that follows the problem solving heuristic of making the locally optimal choice at each stage with the hope of finding a global optimum. Why is A* the most accurate algorithm? It favors both the end point and start point When pathfinding on a graph what are the vertices used for? These are used to keep record of where to travel and where traveled.