In keeping with the design framework used throughout this text,
we view graphs as specialized containers.
Formally, the graph is an ordered pair
comprised of two sets--a set of vertices and a set of edges.
Informally, we can view a graph as a container with two compartments,
one which holds vertices and one which holds edges.
Therefore, there are three kinds of objects--vertices, edges, and graphs.
Accordingly, we need three object classes:
`Vertex`, `Edge`, and `Graph`.
(See Figure ).

**Figure:** Object Class Hierarchy

- Implementing Vertices
- Implementing Edges
- Abstract Graphs and Digraphs
- Implementing Undirected Graphs
- Edge-Weighted and Vertex-Weighted Graphs
- Comparison of Graph Representations

Copyright © 1997 by Bruno R. Preiss, P.Eng. All rights reserved.