An extensible directed graph class.
- DirectedNodes are identified by positive integers – each node is assigned a unique integer starting at 1.
- DirectedNodes know about both their incoming and outgoing edges. Iterators can range over all edges, just the incoming edges or just the outgoing edges.
- DirectedNodes store their incident edge information in edge lists; they provide const and non-const iterators which return const and non-const pointers to Edge objects.
- The Digraph object provides iterators for all of the edges in the graph; this list is unordered.
- The Digraph base class is instantiatable (ie not a pure virtual class). It was also built with extension in mind. See protocols/jd3/JobDigraph for an example on how to create an extension of the DirectedNode, Edge and Digraph classes
- Derived graph classes must define two factory methods: create_node and create_edge which are called by the base class when adding graph elements.
- Edges offer constant-time deletion – edges remove themselves from the edge-lists that their nodes maintain, and from the edge-list that the Digraph maintains without having to iterate over those lists.
- Digraphs own the vertices and edges they create. Digraphs cannot share or give away edges.
- The virtual functions Derived graph classes must override: DirectedNode: copy_from, print, count_static_memory, count_dynamic_memory Edge: copy_from, count_static_mmory, count_dynamic_memory Digraph: create_node, create_edge, delete_edge, count_static_memory, count_dynamic_memoryCustom written edge list element class. Little more than a struct. Defined so that edge list memory management could rely on boost::pool like object