Minor speed enhancement - cache graph data-structures.