CPSC 203, 2026 W1
November 17, 2026
Project 3 (Campus Walks) due Monday December 7.
This week: Lab 9 (dynamic programming) and POTW 9 (potpourri) due Sunday Nov 22.
Examlet 4 window is Thursday Nov 19 to Monday Nov 23.
Feeling overwhelmed? You are not alone!
We have seen graphs and corresponding algorithms for:
| Data | Task | Algorithm |
|---|---|---|
| Images / grids | Voronoi diagrams / flood fill | breadth first search |
| Music / evolving systems | sampling / simulation | Markov chains |
| Games | path to solution | depth first search |
Next few lectures:
Geospatial data is often stored as a graph.
In geospatial data sets, nodes often have associated location information.
When thinking of the data set as a graph, location information may be:
An open-source alternative to the data behind Google / Apple maps:
https://www.openstreetmap.org/
osmnx module.You will:
Launch Class Activity: Fun with Open Street Maps in PrairieLearn.

What if we have a specific destination vertex?

v,
d[v] =p[v] =s:
d[s] =p[s] =
v with smallest d[v]v as visitedw of v:
d[w]):
d[w] =p[w] =
Launch Class Activity: Dijkstra’s Algorithm in PrairieLearn.
You will:

v with smallest d[v]v as visitedw of v:
d[v] + weight[v,w] < d[w]):
d[w] = d[v] + weight[v,w]p[w] = v
| Property | DFS | BFS | Dijkstra |
|---|---|---|---|
| Data Structure | stack | queue | priority queue |
| Edge costs? | ignored | all equal | any non-negative |
| Shortest path? | no | yes | yes |
| Frontier | dive deep | explore in layers | explore by shortest known distance |
REALLY great example: https://www.youtube.com/watch?v=wsSEKm-rU6U
OSMNX reference: https://github.com/gboeing/osmnx-examples
Tutorial: https://gist.github.com/psychemedia/b49c49da365666ba9199d2e27d002d07