Questions about anything?
The homework for Monday is posted.
I'd like to go over a few specific graph and tree search problems today ... we'll see how much we have time for.
A classic, invented by Lewis Carroll (Alice in Wonderland author), studied by Knuth.
We'll discuss what it is and how it works :
Concepts to understand :
Trees are also used to represent the syntax of programming languages - an essential part of parsers and interpreters. This is a huge topic, much bigger than we can go through thoroughly here ... but worth getting the basic idea for now.
The structure of a specific parse tree for some language comes from its grammar ... another topic slightly outside our scope this term, but which I'll go over briefly today to give you the general idea.
One more classic is searching for the best move in a two player game like tic-tac-toe.
Each position in the game is a node, and each move is an edge leading to another node. The task is to search for the winning position.
The complication is that there are two alternating players, and so at each depth of the tree the search goal alternates between being good for player one or good for player two. If we give each position a numeric value, then we alternate between searching for a minimum value vs a maximum value ... and so this is called "minmax search". There are a few refinements, but the idea of the algorithm is consistent throughout.
Are we having fun yet?
Next week we'll look at several "shortest path" algorithms, looking at two problems each done two ways. All these algorithms are named after their inventors: Prim, Kruskal, Dijkstra, and Floyd-Warshall . If you'd like to read ahead, here are some starting places :
minimum spanning tree
shortest path