A Campus Kiosk Kendal Hershberger & David Moses Union University Scholarship Symposium April 30, 2007.

Slides:



Advertisements
Similar presentations
Algorithms (and Datastructures) Lecture 3 MAS 714 part 2 Hartmut Klauck.
Advertisements

Weighted graphs Example Consider the following graph, where nodes represent cities, and edges show if there is a direct flight between each pair of cities.
CSE 390B: Graph Algorithms Based on CSE 373 slides by Jessica Miller, Ruth Anderson 1.
Graphs CSC 220 Data Structure. Introduction One of the Most versatile data structures like trees. Terminology –Nodes in trees are vertices in graphs.
Quiz 4-26-’07 Search.
Graphs Chapter 12. Chapter Objectives  To become familiar with graph terminology and the different types of graphs  To study a Graph ADT and different.
Breadth-First and Depth-First Search
CS 206 Introduction to Computer Science II 11 / 07 / 2008 Instructor: Michael Eckmann.
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.
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.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
ITEC200 – Week 12 Graphs. 2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
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.
Graphs & Graph Algorithms 2 Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Graphs. Graphs Many interesting situations can be modeled by a graph. Many interesting situations can be modeled by a graph. Ex. Mass transportation system,
CS 206 Introduction to Computer Science II 11 / 05 / 2008 Instructor: Michael Eckmann.
Blind Search-Part 2 Ref: Chapter 2. Search Trees The search for a solution can be described by a tree - each node represents one state. The path from.
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.
More Graph Algorithms Weiss ch Exercise: MST idea from yesterday Alternative minimum spanning tree algorithm idea Idea: Look at smallest edge not.
Graphs & Graph Algorithms 2 Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
C o n f i d e n t i a l HOME NEXT Subject Name: Data Structure Using C Unit Title: Graphs.
Dijkstra’s Algorithm and Heuristic Graph Search David Johnson.
Shortest Path Algorithms. Kruskal’s Algorithm We construct a set of edges A satisfying the following invariant:  A is a subset of some MST We start with.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Dijkstras Algorithm Named after its discoverer, Dutch computer scientist Edsger Dijkstra, is an algorithm that solves the single-source shortest path problem.
WAN technologies and routing Packet switches and store and forward Hierarchical addresses, routing and routing tables Routing table computation Example.
Chapter 14 Graphs. © 2004 Pearson Addison-Wesley. All rights reserved Terminology G = {V, E} A graph G consists of two sets –A set V of vertices,
COSC 2007 Data Structures II Chapter 14 Graphs III.
Representing and Using Graphs
Shortest Path Problem Weight of the graph –Nonnegative real number assigned to the edges connecting to vertices Weighted graphs –When a graph.
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.
Common final examinations When: Wednesday, 12/11, 3:30-5:30 PM Where: Ritter Hall - Walk Auditorium 131 CIS 1166 final When: Wednesday, 12/11, 5:45-7:45.
Artificial Intelligence LECTURE 4 ARTIFICIAL INTELLIGENCE LECTURES BY ENGR. QAZI ZIA.
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.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
COMP261 Lecture 6 Dijkstra’s Algorithm. Connectedness Is this graph connected or not? A Z FF C M N B Y BB S P DDGG AA R F G J L EE CC Q O V D T H W E.
Queues, Stacks and Heaps. Queue List structure using the FIFO process Nodes are removed form the front and added to the back ABDC FrontBack.
Where’s the title? You gotta search for it!. PotW Solution String s = new Scanner(System.in).next(); int[] prev = new int[s.length() * 2 + 2]; Arrays.fill(prev,
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 13: Graphs Data Abstraction & Problem Solving with C++
Consultant Presentation Group B5. Presentation Outline Introduction How to design by Group A5 Future Data Structure Interface Future Conclusion.
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.
COSC 2007 Data Structures II
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
A* Path Finding Ref: A-star tutorial.
© 2006 Pearson Addison-Wesley. All rights reserved 14 A-1 Chapter 14 Graphs.
NETWORK FLOWS Shruti Aggrawal Preeti Palkar. Requirements 1.Implement the Ford-Fulkerson algorithm for computing network flow in bipartite graphs. 2.For.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Dijkstra animation. Dijksta’s Algorithm (Shortest Path Between 2 Nodes) 2 Phases:initialization;iteration Initialization: 1. Included:(Boolean) 2. Distance:(Weight)
A vertex u is reachable from vertex v iff there is a path from v to u.
Minimum Spanning Trees and Shortest Paths
Common final examinations
Short paths and spanning trees
Comp 245 Data Structures Graphs.
Spanning Trees Longin Jan Latecki Temple University based on slides by
Graphs Representation, BFS, DFS
Graphs & Graph Algorithms 2
A* Path Finding Ref: A-star tutorial.
Copyright ©2012 by Pearson Education, Inc. All rights reserved
Graphs.
Graphs Part 2 Adjacency Matrix
Subgraphs, Connected Components, Spanning Trees
Graph Traversal Lecture 18 CS 2110 — Spring 2019.
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
INTRODUCTION A graph G=(V,E) consists of a finite non empty set of vertices V , and a finite set of edges E which connect pairs of vertices .
Presentation transcript:

A Campus Kiosk Kendal Hershberger & David Moses Union University Scholarship Symposium April 30, 2007

Purpose ► ► Make an application to give directions to people new to campus who may not know their way around ► ► Make the application easily accessible ► ► Scalability

Choosing the Language ► ► OpenGL using C   Advantage - already familiar with the language and graphics library   Disadvantage - difficulty of drawing an entire campus ► ► DirectX   Disadvantage – Microsoft-specific systems

Choosing the Language ► ► Flash and ActionScript   Advantages ► ► Very accessible and easy to update ► ► Opportunity to learn a new language ► ► ActionScript has many similarites to Java and other high-level languages ► ► Easy drawing utilities   Disadvantages ► ► Unfamiliar

ActionScript ► ► scripting language behind Flash applications ► ► ActionScript 2.0   new object-oriented model ► ► Class-based, but classes defined in external.as file

Graph Searching ► ► Graphs consist of nodes and vectors (or edges). ► ► A node can be connected to another node via an edge. ► ► For our case, the edges are paths that traverse Union's campus, and each node represents a geographical point where they connect or terminate.

Graph Searching ► ► Example:

Graph Searching ► ► Depth   Depth First   Iterative Deepening   Best First ► Breadth  Breadth First  Uniform Cost  Dijkstra's Algorithm ► Problem: Find the best path from one node (one point on campus) to another node (another point on campus) ► Techniques:

Graph Searching ► ► Depth First   Go to a node, mark it as visited, push it on a stack   Go to a neighbour node, and do the same thing   If you’re at a dead end, pop the stack until you find an unvisited neighbour   Repeat until you’ve traversed the entire tree (optimal path) or until you have found the destination node (non-optimal)

Graph Searching ► ► Depth First

Graph Searching ► ► Iterative Deepening   Same as Depth First, but depth of search is controlled   Better for very large graphs, still slow. ► ► Best First   Greedy algorithm (not uninformed) that simply selects the closest node to the destination   VERY fast, but can generate horrible paths under certain conditions

Graph Searching ► ► Breadth First   Go to a node, put all of its neighbour in a queue   Visit each neighbour in the order they were placed, and put all of its neighbours in a queue   Continue until all nodes have been visited (optimal path) or until destination node is found (non-optimal path)

Graph Searching ► ► Breadth First

Graph Searching ► ► Uniform Cost   Same as Breadth First Search, but prioritizes nodes that have shortest path from origin rather than simply the next node in the queue   More realistic paths, but still takes long ► ► Dijkstra's Algorithm   Same as Uniform Cost, but actively keeps track of shortest path to node   Uses relaxation of the path cost   Much faster than all others

Graph Searching ► dijkstra = function (origin:Node, destination:Node) { ► var S:Array = new Array();// list of visited nodes ► var Q:Array = Node.getNodes(); // list of unvisited nodes ► origin.dv = 0;// initialize distance at origin to ► ► do { ► var u:Node = extractMin(Q);// remove node with lowest distance ► S.push(u);// mark it as visited ► var neighbors:Array = u.getNeighbors();// relax u's neighbors ► for (i=0; i<neighbors.length; i++) { ► var v:Node = neighbors[i]; ► if (u.dv + u.getDistance(v) < v.dv) { ► v.dv = u.dv + u.getDistance(v); ► v.prevNode = u; ► } ► } while (u != destination) ► };

Graph Searching ► ► Dijkstra’s Algorithm

Creating the Campus Map ► ► Deciding on using an image or drawing the map ourselves ► ► Using Flash to draw graphics   vector vs. raster graphics ► ► Quality ► ► Scalability

Creating the Campus Map

Creating Paths ► ► Create a datatype to store the nodes and edges in ActionScript ► ► Make a list of points to place the nodes ► ► Display it in a Flash scene

Creating Paths ► ► Kirupa’s Graph ADT ► ► Node and Edge classes   var a:Node;   a = new Node("a", 200, 50);   a.addEdge(b, "a->b"); ► ► Uses Depth First to find path ► ► Dynamically draws the path from origin to destination

Finding the Best Path ► ► Our implementation of the Graph ADT ► ► Tested using points around the Belltower area ► ► Depth First search is fairly accurate and fast

Finding the Best Path ► ► Completed entry of points for the rest of campus ► ► Our naïve Depth First search algorithm reveals its limitations

Finding the Best Path ► ► Switched from Kirupa’s Depth First Search and implemented our own Dijkstra’s algorithm in ActionScript ► ► Still needed to provide interface and integrate map with graph

Building an Interface ► ► Added map layer to Flash scene ► ► Started adding buttons and designing interface components

Building an Interface ► ► Choosing locations in a List Box

Debugging ► ► Remaining Bugs   Refresh problem ► ► Fixed by deleting the calls to draw.   Speed degradation ► ► Caused by unintended doubling of the graph size.   Faulty edges ► ► Incorrect data entry… over 500 individual edges!

Future Possibilities ► ► Interiors of buildings, including classrooms and faculty offices   Zoom feature   Database integration ► ► Touch screen kiosks located around campus ► ► Print feature

Demonstation / Questions