DynamicDirectedGraph Class Reference
Public Member Functions | |
DynamicDirectedGraph (int vertices) | |
template<typename Iter > | |
Iter | get_vertices (Iter dest) |
int | no_of_vertices () |
template<typename Iter > | |
Iter | adjTo (int vertex, Iter dest) |
void | add_edge (int u, int v) |
void | delete_edge (int u, int v) |
int | in_degree (int vertex) |
int | out_degree (int vertex) |
Detailed Description
Algorithm
- Export the graph object to an adjacency matrix.
- Find the vertices which have 0 in-degree.
- Add them to a queue.
Servicing a queue
- Deque an element off the queue
- Remove all the edges emnating from the element.
- Add the element to topological order.
- For every edge u-v emnating from u : delete_edge(u, v) if(in-degree(v) == 0) add v to the queue. Operations on the graph required. in-degree(v) - Read and write out-degree(v) - Read and write edge deletion adj(v)
Constructor & Destructor Documentation
DynamicDirectedGraph::DynamicDirectedGraph | ( | int | vertices | ) |
Member Function Documentation
void DynamicDirectedGraph::add_edge | ( | int | u, |
int | v | ||
) |
template<typename Iter >
Iter DynamicDirectedGraph::adjTo | ( | int | vertex, |
Iter | dest | ||
) |
void DynamicDirectedGraph::delete_edge | ( | int | u, |
int | v | ||
) |
template<typename Iter >
Iter DynamicDirectedGraph::get_vertices | ( | Iter | dest | ) |
The documentation for this class was generated from the following file:
- alglib/graph/legacy/source_removal.cpp