Operations: graphs are typically built by inserting or
deleting one node or edge at a time.
Graph Traversal: make sure that you do not process some node
twice. There are 2 general techniques:
- when you first encounter a node, mark it REACHED. When you visit
a node, if it is already marked REACHED, ignore it.
- when you process a node, delete it from the graph.
General Traversal Strategy:
- mark all nodes as not REACHED.
- pick a starting node, mark it as reached, and place it on the
READY list.
- pick a node on th READY list, process it, remove it from READY,
find its neighbours: for those that are not REACHED:
mark them as REACHED and add them to READY.
- repeat step 3 until READY is empty.