|
1 | 1 | # Class Meeting 12B
|
2 | 2 |
|
3 |
| -Today we will be try to find the shortest path through some graphs. |
| 3 | +Today we will finish off our discussion of depth first search to solve Sudoku puzzles. Then we will talk about shortest path search using Dijkstra's algorithm and priority queues. |
4 | 4 |
|
5 | 5 | <div>
|
6 | 6 | <iframe src="../../Lec18_Maps.pdf" width="100%" height="600px" frameBorder="0"> </iframe>
|
7 | 7 | </div>
|
8 | 8 |
|
9 | 9 | [Download the Slides from today](https://github.com/ubc-cs/cpsc203/raw/main/files/Lec18_Maps.pdf)
|
10 | 10 |
|
11 |
| -## Important links for today: |
| 11 | +## Topics for today's lecture |
12 | 12 |
|
13 |
| -- [Solving Dijkstra's Algorithm](https://algo-dijkstra.vercel.app/index.html) |
14 |
| -- [Dijkstra's Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) |
15 |
| -- [Graphical explanation of Dijkstra's algorithm](https://www.geeksforgeeks.org/dijkstras-shortest-path-algorithm-greedy-algo-7/) |
16 |
| -- [Another graphical explanation of Dijkstra's algorithm](https://www.freecodecamp.org/news/dijkstras-shortest-path-algorithm-visual-introduction/) |
| 13 | +- TBA |
17 | 14 |
|
18 |
| -<!-- |
19 |
| -## Optional links for today |
20 |
| ---> |
| 15 | +## Links for today |
| 16 | + |
| 17 | +- [Dijkstra's Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm). |
| 18 | + - [Graphical explanation of Dijkstra's algorithm](https://www.geeksforgeeks.org/dijkstras-shortest-path-algorithm-greedy-algo-7/). |
| 19 | + - [Another graphical explanation of Dijkstra's algorithm](https://www.freecodecamp.org/news/dijkstras-shortest-path-algorithm-visual-introduction/). |
| 20 | + - [Build your own grid and run Dijkstra's algorithm](https://algo-dijkstra.vercel.app/index.html) |
| 21 | +- Python's [`heapq` module](https://docs.python.org/3/library/heapq.html) provides an implementation of a priority queue. |
| 22 | + - There is also the `PriorityQueue` in the [`queue` module](https://docs.python.org/3/library/queue.html), but that is unnecessarily fancy for our simple Dijkstra's algorithm. (It allows multiple threads to access the queue at once, which is necessary for parallel programming but not for our single threaded serial program.) |
| 23 | + - [Tutorial implementing Dijkstra's algorithm using `heapq`](https://www.datacamp.com/tutorial/dijkstra-algorithm-in-python). Because there is no way to remove or update an entry in `heapq`, we may end up removing a node from the queue multiple times; however, that is okay since the first removal will represent the minimum distance / shortest path so subsequent removals can be ignored. |
| 24 | +- Mapping |
| 25 | + - [Video Intro to Geographic Information Systems (GIS) and Python mapping modules](https://www.youtube.com/watch?v=wsSEKm-rU6U). |
| 26 | +- [OpenStreetMap (OSM)](https://www.openstreetmap.org/) and [an explanation of OSM](https://en.wikipedia.org/wiki/OpenStreetMap). |
| 27 | + - Python package [OSMnx](https://osmnx.readthedocs.io/en/stable/) for accessing OSM data. |
| 28 | + - [Lots of OSMnx examples](https://github.com/gboeing/osmnx-examples/tree/master/notebooks). |
| 29 | + - [An OSMnx Tutorial](https://gist.github.com/psychemedia/b49c49da365666ba9199d2e27d002d07). |
21 | 30 |
|
22 | 31 | ## Logistics
|
23 | 32 |
|
24 | 33 | There is no repo to clone today!
|
25 |
| -<!-- |
26 |
| - 1. Clone the Class Activity Repository |
27 |
| -
|
28 |
| -You will first need to "accept" the GitHub Classroom assignment to get a copy of the starter code. |
29 |
| -
|
30 |
| -You can do that by [clicking here](https://classroom.github.com/a/ZEaSSumI). |
31 |
| -
|
32 |
| -Then, clone the `classActivity1XY` repository by running the following line in your Terminal: |
33 |
| -
|
34 |
| -``` |
35 |
| -git clone <your_clone_url> |
36 |
| -``` |
37 |
| ---> |
38 |
| - |
39 |
| -## Acknowledgements |
40 |
| - |
41 |
| -Slides for {{ COURSE_CODE }} were developed and created by [Dr. Cinda Heeren](https://www.cs.ubc.ca/people/cinda-heeren). The current iteration of the course resulted in minor adaptations and updates, but by in large, full credit of these slides belongs to Dr. Cinda Heeren. |
0 commit comments