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:

  1. when you first encounter a node, mark it REACHED. When you visit a node, if it is already marked REACHED, ignore it.

  2. when you process a node, delete it from the graph.

General Traversal Strategy:

  1. mark all nodes as not REACHED.

  2. pick a starting node, mark it as reached, and place it on the READY list.

  3. 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.

  4. repeat step 3 until READY is empty.