#include <WhiteheadGraph.h>
Public Member Functions | |
| CutVertices (const int **G, int n) | |
| Constructor. | |
| ~CutVertices () | |
| void | compute () |
| Finds articulation points. | |
| void | computeBruteForce () |
| Finds articulation points (Brute force algorithm. | |
| int | numberOfComponents (bool ignore_single_vertices=false) |
| Computes the number of connected components of the graph. | |
| vector< int > | getCutVertices () const |
| Get the list of articulation points. | |
Private Member Functions | |
| void | init () |
| void | DepthFirstSearch () |
| Execute depth first search. | |
| void | RecursiveDepthFirstSearch (int v) |
| Execute recursive depth first search. | |
| void | RDFS_Compute_Low (int v) |
| Compute the low subtree recursively. | |
| void | ArticulationPoints () |
| Extract articulation points from the labels. | |
Private Attributes | |
| int ** | theGraph |
| Adjacency matrix of the graph. | |
| int | N |
| Number of vertices. | |
| int | time |
| Current time label (internal use only). | |
| vector< int > | visit |
| List of visited points (internal use only). | |
| vector< int > | pred |
| List of predecessors (internal use only). | |
| vector< int > | discover |
| Labels of discovered vertices (internal use only). | |
| vector< int > | Low |
| vector< int > | articulation_point |
| List of articulation points. | |
Definition at line 29 of file WhiteheadGraph.h.
| CutVertices::CutVertices | ( | const int ** | G, | |
| int | n | |||
| ) |
Constructor.
| G | - the adjacency matrix of a graph ( there is an edge from i to j in the graph iff G[i][j] 0 ). | |
| n | - the number of vertices. |
| CutVertices::~CutVertices | ( | ) |
| void CutVertices::compute | ( | ) |
Finds articulation points.
Finds all articulation points of the graph. The result can be obtained through getCutVertices() function. This algorithm requires linear time in the size of the graph, or
.
| void CutVertices::computeBruteForce | ( | ) |
Finds articulation points (Brute force algorithm.
Finds all articulation points of the graph. The result can be obtained through getCutVertices() function. Complexity:
.
| int CutVertices::numberOfComponents | ( | bool | ignore_single_vertices = false |
) |
Computes the number of connected components of the graph.
Computes the number of connected components of the graph.
| ignore_single_vertices | - if set to true, then components containing only one vertex are ignored. Default value is false. |
| vector<int> CutVertices::getCutVertices | ( | ) | const [inline] |
Get the list of articulation points.
Return the list of articulation points obtained using one of the algorithms. compute() or computeBruteForce() must be called first.
Definition at line 72 of file WhiteheadGraph.h.
References articulation_point.
| void CutVertices::init | ( | ) | [private] |
| void CutVertices::DepthFirstSearch | ( | ) | [private] |
Execute depth first search.
| void CutVertices::RecursiveDepthFirstSearch | ( | int | v | ) | [private] |
Execute recursive depth first search.
| void CutVertices::RDFS_Compute_Low | ( | int | v | ) | [private] |
Compute the low subtree recursively.
| void CutVertices::ArticulationPoints | ( | ) | [private] |
Extract articulation points from the labels.
int** CutVertices::theGraph [private] |
int CutVertices::N [private] |
int CutVertices::time [private] |
vector<int> CutVertices::visit [private] |
vector<int> CutVertices::pred [private] |
vector<int> CutVertices::discover [private] |
vector<int> CutVertices::Low [private] |
Definition at line 104 of file WhiteheadGraph.h.
vector<int> CutVertices::articulation_point [private] |
List of articulation points.
Definition at line 108 of file WhiteheadGraph.h.
Referenced by getCutVertices().
1.5.6