CSC 172 DATA STRUCTURES Traversing graphs DepthFirst Search
- Slides: 22
CSC 172 DATA STRUCTURES
Traversing graphs Depth-First Search like a post-order traversal of a tree Breath-First Search Less like tree traversal
Traversing graphs Depth-First Search like a post-order traversal of a tree Breath-First Search Less like tree traversal Priority-First Search Good for Shortest Path Dijkstra's Algorithm
Breadth-First Search Unweighted Shortest Path Starting vertex has level 0 (anchor vertex) Visit (mark) all vertices that are only one edge away mark each vertex with its “level” One edge away from level 0 is level 1 One edge away from level 1 is level 2 Etc. .
Example A B C D E F G H I J K L M N O P
Example 0 A B C D E F G H I J K L M N O P
Example 0 A B C D E F G H I J K L M N O P
Example 0 1 A B C D E F G H I J K L M N O P
Example 0 1 A B C D E F G H I J K L M N O P
Example 0 1 2 A B C D E F G H I J K L M N O P
Example 0 1 2 A B C D E F G H I J K L M N O P
Example 0 1 2 3 A B C D E F G H I J K L M N O P
Example 0 1 2 3 A B C D E F G H I J K L M N O P
Example 0 1 2 3 A B C D E F G H I J K M N O 4 L P
Example 0 1 2 3 A B C D E F G H I J K M N O 4 L P
Example 0 1 2 3 A B C D E F G H I J K M N O 4 L P
Example 0 1 2 3 A B C D E F G H I J K M N O 4 L P
Example 0 1 2 3 A B C D E F G H I J K M N O L 4 5 P
Example 0 1 2 3 A B C D E F G H I J K M N O L 4 5 P
BFS Tree 0 1 2 3 A B C D E F G H I J K M N O L 4 5 P
Dijkstra's Algorithm // for each Vertex v { v. dist = infinity ; v. known = false ; }
Dijkstra's Algorithm while (there is an unknown vertex) { v = del. Min() ; // get the next one off the queue v. known = true ; for each Vertex w adjacent to v { if (!w. known) { if (v. dist + dist_v 2 w < w. dist){ w. dist = vdist + dist_v 2 w ; enqueue(w)
- Depthfirst search
- 283+172
- Traversing algorithm in array
- Good and bad state graphs
- Comparing distance/time graphs to speed/time graphs
- Graphs that enlighten and graphs that deceive
- 5-3 practice polynomial functions
- Networks and graphs circuits paths and graph structures
- Principle of traverse survey
- Local attraction in surveying
- Theodolite specification
- Traversing a linked list
- Traversing survey
- Traversing root
- Theodolite traversing
- Homologous structures examples
- Csc data entry
- Subnet mask kelas b
- Purdue physics 172 past exams
- 172,16,0,1
- Ping 172
- Hb 172 alaska
- Bus 172 nsu