Shortest Path Tree
Compute shortest path tree's
typedef map<A, typename Node<A>::NodeRef> Nodes | Nodes |
~Spt ()
| ~Spt |
bool set_origin (A node)
| set_origin |
Set the origin node.
Returns: false if the node doesn't exist, otherwise true.
bool add_node (A node)
| add_node |
Add node
Returns: false if the node already exists, otherwise true.
bool remove_node (A node)
| remove_node |
Remove node
Returns: false if the node doesn't exist or has already been removed, otherwise true.
bool exists_node (A node)
| exists_node |
Does this node exist?
Returns: true if the node exists.
bool add_edge (A src, int weight, 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 (A src, int weight, 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 (A src, int& weight, 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 (A src, 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.