Class Graph#
Defined in File Graph.h
Nested Relationships#
Nested Types#
Inheritance Relationships#
Base Type#
public BaseGraph(Class BaseGraph)
Class Documentation#
-
class Graph : public BaseGraph#
Graph is the base class for a general undirected graph (Graph) that is in turn derived from BaseGraph.
Algorithms that operate upon abstract undirected graphs should, normally, use only this base Graph class for maximum portability.
No extra restrictions are placed on nodes and edges in addition to those imposed by BaseGraph. This means that self-edges, and multiple edges between two nodes, are allowed.
An undirected graph, Graph, extends BaseGraph by adding DFS and BFS iterators, as well as iterators to enumerate neighboring nodes and incident edges for a node.
NOTE ON friend CLASSES: Many classes (especially Graph, Graph::Node, and Graph::Edge) have many friend classes. This is not a kludge. It is simulating “package” visiblity in Java. We want a limited public interface to Node and Edge and yet give more permissions to methods within the Graph class.
-
class BFSIterator : public BaseGraph::BFSIterator#
The BFSIterator here is just an extension of BaseGraph::DFSIterator to allow proper casting.
-
class BiDirNodesIterator : public BaseGraph::BiDirNodesIterator#
The BiDirNodesIterator is just an extension of BaseGraph::BiDirNodesIterator to provide access to Graph nodes.
-
class DFSIterator : public BaseGraph::DFSIterator#
The DFSIterator here is just an extension of BaseGraph::DFSIterator to allow proper casting.
-
class Edge : public BaseGraph::Edge#
Public Functions
-
inline virtual ~Edge()#
Friends
- friend class Graph
- friend class Graph::NeighborNodesIterator
-
inline virtual ~Edge()#
-
class EdgesIterator : public BaseGraph::EdgesIterator#
The EdgesIterator is just and extension of BaseGraph::EdgesIterator to provide access to Graph edges.
-
class IncidentEdgesIterator : public Iterator#
Incident edges iterator iterates over all the edges incident on a node.
-
class NeighborNodesIterator : public Iterator#
Node iterator iterates over all the neighboring nodes.
-
class Node : public BaseGraph::Node#
An node in an undirected graph has a list of neighboring nodes and a list of incident edges.
Friends
- friend class Graph::Edge
- friend class Graph::IncidentEdgesIterator
- friend class Graph::NeighborNodesIterator
-
class NodesIterator : public BaseGraph::NodesIterator#
The NodesIterator is just and extension of BaseGraph::NodesIterator to provide access to Graph nodes.
-
class BFSIterator : public BaseGraph::BFSIterator#