The WithEdges data structure has a class for every major graph abstraction: Graph, Vertex, Neighbor, and Edge. A Graph object maintains a list (or container) of Vertex objects, and a list (container) of Edge objects. Each Vertex contains a list of adjacent edges, and each Edge object references both Vertex objects with the weight of the edge. The advantage of this data structure is that it cleanly supports the implementation of all graph algorithms; its disadvantage is a larger overhead for graph creation.