biconnectivity Class Reference

Biconnectivity-test and low-numbers. More...

Inheritance diagram for biconnectivity:

Inheritance graph
[legend]
Collaboration diagram for biconnectivity:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 biconnectivity ()
 Creates biconnectivity algorithm object.
virtual ~biconnectivity ()
 Destroys biconnectivity algorithm object.
virtual int check (graph &G)
 Checks whether the algorithm can be applied.
virtual void reset ()
 Resets algorithm.
int low_number (const node &n) const
 low-number.
bool is_biconnected () const
 Biconnectivity-test.
bool store_components () const
 Returns whether the storing of components is enabled.
void store_components (bool set)
 Enables or disables the storing of biconnected components.
void make_biconnected (bool set)
 If enabled edges will be added to the graph in order to make it biconnected, if cutpoints are discovered.
bool make_biconnected () const
 Returns whether addition of edges neccessary to make graph biconnected is enabled.
list< edge >::iterator additional_begin ()
 Begin of edges added to make graph biconnected.
list< edge >::iterator additional_end ()
 End of edges added to make graph biconnected.
cutpoint_iterator cut_points_begin ()
 Start iteration over all cutpoints found.
cutpoint_iterator cut_points_end ()
 End of iteration over all cutpoints.
component_iterator components_begin ()
 Start iteration over all biconnected components (if enabled during last call to run).
component_iterator components_end ()
 End of iteration over all biconnected components.
int number_of_components () const
 Number von biconnected components detected during the last run.
virtual void init_handler (graph &)
 Handler called before the start of DFS.
virtual void entry_handler (graph &, node &, node &)
 Handler called when touching node n.
virtual void before_recursive_call_handler (graph &, edge &, node &)
 Handler called when a unused node n connected to the actual node by e is found.
virtual void after_recursive_call_handler (graph &, edge &, node &)
 Handler called after the algorithm returns from the subtree starting at n connected to the actual node by e.
virtual void old_adj_node_handler (graph &, edge &, node &)
 Handler called when a already marked node n connected to the actual node by e is found during the search of all adjacent edges of the actual node.
virtual void new_start_handler (graph &, node &)
 Called when DFS is started with start-node n.
virtual void leave_handler (graph &, node &, node &)
 Handler called after all the adjacent edges of n have been examined.
virtual void end_handler (graph &)
 Handler called at the end of DFS.


Detailed Description

Biconnectivity-test and low-numbers.

Date
Revision

Obviously there is a close relationship between DFS and the testing of biconnectivity. Thus this test takes advantage of the possibility to add pieces of code to the DFS-class in order to calculate the low-numbers.

As default no biconnected components will be stored and no edges will be added to make the graph biconnected. The test will run on the whole graph, even if it is not connected.


Constructor & Destructor Documentation

biconnectivity::biconnectivity (  ) 

Creates biconnectivity algorithm object.

See also:
dfs::dfs

virtual biconnectivity::~biconnectivity (  )  [inline, virtual]

Destroys biconnectivity algorithm object.

See also:
dfs::~dfs


Member Function Documentation

virtual int biconnectivity::check ( graph G  )  [virtual]

Checks whether the algorithm can be applied.

Necessary preconditions:

Parameters:
G graph.
Returns:
algorithm::GTL_OK if binconnectivity-test can be applied to G.
See also:
dfs::scan_whole_graph, dfs::store_preds

Reimplemented from dfs.

virtual void biconnectivity::reset (  )  [virtual]

Resets algorithm.

Prepares the algorithm to be applied to another graph. Please note: The options an algorithm may support do not get reset by this. It is just to reset internally used datastructures.

Reimplemented from dfs.

int biconnectivity::low_number ( const node n  )  const [inline]

low-number.

Parameters:
n node.
Returns:
low-number of n.

bool biconnectivity::is_biconnected (  )  const [inline]

Biconnectivity-test.

Returns:
true iff graph is biconnected.

bool biconnectivity::store_components (  )  const [inline]

Returns whether the storing of components is enabled.

Returns:
true iff storing of components is enabled.
See also:
biconnectivity::components_begin, biconnectivity::components_end

void biconnectivity::store_components ( bool  set  )  [inline]

Enables or disables the storing of biconnected components.

If this feature is enabled, the whole graph will be scanned in order to get all the biconnected components even if the graph isn't connected. By default this feature is disabled.

Parameters:
set if true each biconnected component will be stored.
See also:
biconnectivity::components_begin, biconnectivity::components_end

void biconnectivity::make_biconnected ( bool  set  )  [inline]

If enabled edges will be added to the graph in order to make it biconnected, if cutpoints are discovered.

The list of added edges can be accessed via additional_begin and additional_end.

Parameters:
set if true additional edges will we inserted to make the graph biconnected.
See also:
biconnectivity::additional_begin, biconnectivity::additional_end

bool biconnectivity::make_biconnected (  )  const [inline]

Returns whether addition of edges neccessary to make graph biconnected is enabled.

Returns:
true iff addition edges is enabled.
See also:
biconnectivity::additional_begin, biconnectivity::additional_end

list<edge>::iterator biconnectivity::additional_begin (  )  [inline]

Begin of edges added to make graph biconnected.

Returns:
begin of additional edges
See also:
biconnectivity::make_biconnected

list<edge>::iterator biconnectivity::additional_end (  )  [inline]

End of edges added to make graph biconnected.

Returns:
end of additional edges
See also:
biconnectivity::make_biconnected

cutpoint_iterator biconnectivity::cut_points_begin (  )  [inline]

Start iteration over all cutpoints found.

A cutpoints is a node whose removal will disconnect the graph, thus a graph with no cutpoints is biconnected and vice versa.

Returns:
iterator to first cutpoint.
See also:
biconnectivity::cut_points_end

cutpoint_iterator biconnectivity::cut_points_end (  )  [inline]

End of iteration over all cutpoints.

Returns:
one-past-the-end iterator.
See also:
biconnectivity::cut_points_begin

component_iterator biconnectivity::components_begin (  )  [inline]

Start iteration over all biconnected components (if enabled during last call to run).

Components are represented as a pair consisting of a list of nodes and a list of edges, i.e. if it is of type component_iterator then *it is of type pair<list<node>,list<edge> >.

Returns:
iterator to first component
See also:
biconnectivity::store_components

component_iterator biconnectivity::components_end (  )  [inline]

End of iteration over all biconnected components.

Returns:
end of iteration over biconnected components
See also:
biconnectivity::store_components

int biconnectivity::number_of_components (  )  const [inline]

Number von biconnected components detected during the last run.

Returns:
number of biconnected components.

virtual void biconnectivity::init_handler ( graph G  )  [virtual]

Handler called before the start of DFS.

Parameters:
G graph for which DFS was invoked.

Reimplemented from dfs.

virtual void biconnectivity::entry_handler ( graph G,
node n,
node f 
) [virtual]

Handler called when touching node n.

Parameters:
G graph for which DFS was invoked.
n actual node.
f predecessor.

Reimplemented from dfs.

virtual void biconnectivity::before_recursive_call_handler ( graph G,
edge e,
node n 
) [virtual]

Handler called when a unused node n connected to the actual node by e is found.

Parameters:
G graph for which DFS was invoked.
e edge connecting the actual node to the unused one.
n unused node.

Reimplemented from dfs.

virtual void biconnectivity::after_recursive_call_handler ( graph G,
edge e,
node n 
) [virtual]

Handler called after the algorithm returns from the subtree starting at n connected to the actual node by e.

Parameters:
G graph for which DFS was invoked.
e edge connecting the actual node to the unused one.
n unused node.

Reimplemented from dfs.

virtual void biconnectivity::old_adj_node_handler ( graph G,
edge e,
node n 
) [virtual]

Handler called when a already marked node n connected to the actual node by e is found during the search of all adjacent edges of the actual node.

Parameters:
G graph for which DFS was invoked.
e edge connecting the actual node to the old one.
n used node.

Reimplemented from dfs.

virtual void biconnectivity::new_start_handler ( graph G,
node n 
) [virtual]

Called when DFS is started with start-node n.

This is particularly useful when DFS was invoked with the scan_whole_graph option.

Parameters:
G graph for which DFS was invoked.
n start-node.

Reimplemented from dfs.

virtual void biconnectivity::leave_handler ( graph G,
node n,
node f 
) [virtual]

Handler called after all the adjacent edges of n have been examined.

Parameters:
G graph for which DFS was invoked.
n actual node.
f predecessor.

Reimplemented from dfs.

virtual void biconnectivity::end_handler ( graph G  )  [virtual]

Handler called at the end of DFS.

Parameters:
G graph for which DFS was invoked.

Reimplemented from dfs.