Utilities for dealing with graphs.