Shortest Path Tree
Compute shortest path tree's
typedef map<A, typename Node<A>::NodeRef> Nodes | Nodes |
Spt (bool trace = true)
| Spt |
~Spt ()
| ~Spt |
bool set_origin (const A& node)
| set_origin |
Set the origin node.
Returns: false if the node doesn't exist, otherwise true.
bool add_node (const A& node)
| add_node |
Add node
Returns: false if the node already exists, otherwise true.
bool remove_node (const A& node)
| remove_node |
Remove node
Returns: false if the node doesn't exist or has already been removed, otherwise true.
bool exists_node (const A& node)
| exists_node |
Does this node exist?
Returns: true if the node exists.
bool add_edge (const A& src, int weight, const A& dst)
| add_edge |
Add a new edge.
Parameters:
src | source node must exist. |
weight | edge weight. |
dst | destination node, created if necessary. |
Returns: true on success.
bool update_edge_weight (const A& src, int weight, const A& dst)
| update_edge_weight |
Update existing edge weight.
Parameters:
src | source node must exist. |
weight | new edge weight. |
dst | destination node must exist |
Returns: true on success.
bool get_edge_weight (const A& src, int& weight, const A& dst)
| get_edge_weight |
Get edge weight.
Parameters:
src | source node must exist. |
weight | of this edge returned. |
dst | destination node must exist |
Returns: true on success.
bool remove_edge (const A& src, const A& dst)
| remove_edge |
Remove an edge
Parameters:
src | source node must exist. |
dst | destination node must exist |
Returns: true on success.
bool compute (list<RouteCmd<A> >& routes)
| compute |
Compute the tree.
Parameters:
routes | a list of route adds, deletes and replaces that must be performed. |
Returns: true on success
string str ()
| str |
[const]
Convert this graph to presentation format.
Returns: C++ string with the human-readable ASCII representation of the graph.