Represents a directed graph data structure with certaing useful functions on it.