Содержание
- 2. CONTENT Adjacency List Review Search Depth-first search Breadth-first search Edge-weighted graphs The shortest path Dijkstra’s algorithm
- 3. ADJACENCY LIST (REVIEW) AdjList[0] = (1, 2, 3, 4) AdjList[1] = (0, 5, 6) AdjList[2] =
- 4. ADJACENCY LIST (REVIEW) adj[] null null null null null null null null null null null null
- 5. SEARCH Why do we need to search graphs? Path problems: e.g. What is the shortest path
- 6. SEARCH There are two standard graph traversal techniques: Depth-First Search (DFS) Breadth-First Search (BFS) In both
- 7. DEPTH-FIRST SEARCH
- 8. DEPTH-FIRST SEARCH DFS follows the following rules: Select an unvisited node x, visit it, and treat
- 9. DEPTH-FIRST SEARCH 1 2 3 4 0 5 6 0 7 0 0 1 1 2
- 10. BREADTH-FIRST SEARCH
- 11. BREADTH-FIRST SEARCH BFS follows the following rules: Select an unvisited node x, visit it, have it
- 12. BREADTH-FIRST SEARCH 1 2 3 4 0 5 6 0 7 0 0 1 1 2
- 13. EDGE-WEIGHTED GRAPHS An edge-weighted graph is a graph model where we associate weights or costs with
- 14. THE SHORTEST PATH Find the lowest-cost way to get from one vertex to another A path
- 15. DIJKSTRA’S ALGORITHM Dijkstra’s algorithm solves the single-source shortest-paths problem in edge-weighted digraphs with nonnegative weights The
- 16. DIJKSTRA’S ALGORITHM 0.5. 1 inf inf. inf Choose the shortest path, which is to vertex B,
- 17. DIJKSTRA’S ALGORITHM When the algorithm finds the shortest path between two nodes, that node is tagged
- 18. DIJKSTRA’S ALGORITHM
- 19. DIJKSTRA’S ALGORITHM
- 20. DIJKSTRA’S ALGORITHM
- 21. DIJKSTRA’S ALGORITHM
- 22. DIJKSTRA’S ALGORITHM
- 23. DIJKSTRA’S ALGORITHM
- 24. DIJKSTRA’S ALGORITHM
- 25. DIJKSTRA’S ALGORITHM
- 26. DIJKSTRA’S ALGORITHM
- 27. DIJKSTRA’S ALGORITHM
- 28. DIJKSTRA’S ALGORITHM
- 29. LITERATURE Algorithms, 4th Edition, by Robert Sedgewick and Kevin Wayne, Addison-Wesley Chapter 4 Grokking Algorithms, by
- 31. Скачать презентацию