Home | Documentation | Download | Platforms | Projects | Mailing Lists | Version History
Public Member Functions | |
planarity () | |
Creates an object of the planarity test algorithm. | |
~planarity () | |
Destructor. | |
int | check (graph &G) |
Checks whether planarity test can be applied to G . | |
int | run (graph &G) |
Runs planarity test on G . | |
void | reset () |
Resets algorithm object, such that it can be applied to another graph. | |
void | calc_embedding (bool p) |
If p is true a planar embedding will be calculated in the next run. | |
bool | calc_embedding () const |
Returns true if a planar embedding will be calculated in the next run. | |
void | calc_obstruction (bool p) |
If p is true the obstructions to planarity will be calculated in the next run. | |
bool | calc_obstruction () const |
Returns true if the obstructions to planarity will be calculated in the next run. | |
void | make_biconnected (bool p) |
Determines the strategy used to test a graph which is not biconnected. | |
bool | make_biconnected () const |
Returns strategy for testing graphs, which are not biconnected. | |
bool | is_planar () const |
Result of last test. | |
planar_embedding & | get_embedding () |
If graph in last run was planar a planar embedding is calculated during the reductions. This function gives access to it. | |
list< edge > & | get_obstruction_edges () |
Returns the edges of a subgraph homeomorphic to either K3,3 or K5 if graph in last run was not planar. | |
list< node > & | get_obstruction_nodes () |
Returns the nodes of a subgraph homeomorphic to either K3,3 or K5 if graph in last run was not planar. |
This class implements the Lempel-Even-Cederbaum planarity test using PQ-trees. In case the graph is planar a planar embedding is obtained, i.e. for each node in the graph an ordered adjacency list is calculated, such that there exists a planar drawing in which all adjacent edges around a node apply to this order.
If the graph is not planar Kuratowski's famous theorem states that it must contain a subgraph hoemeomorphic to either K5 (the complete graph with five nodes) or K3,3 (the complete bipartite graph with three nodes each side). In this case the nodes and edges of the tested graph that form either of these two are calculated.
In case the graph is planar and has nodes the algorithm needs
time for the test (including the planar embedding). In case the graph isn't planar it needs at most
time if
is the number of edges for both the test and the detection of K5 or K3,3.
int planarity::check | ( | graph & | G | ) | [virtual] |
Checks whether planarity test can be applied to G
.
This should return always GTL_OK
. There aren't any restrictions on G
, even multiple edges and selfloops are tolerated.
G | arbitrary graph |
GTL_OK | if planarity test can be applied | |
GTL_ERROR | if not |
Implements algorithm.
int planarity::run | ( | graph & | G | ) | [virtual] |
Runs planarity test on G
.
This should return always GTL_OK
. The return value only tracks errors that might occur, it is definitly not the result of the test itself. The result of the test is stored in a member variable and can be accessed via is_planar.
G | arbitrary graph |
GTL_OK | if planarity test was sucessfully applied | |
GTL_ERROR | if not |
Implements algorithm.
void planarity::reset | ( | ) | [virtual] |
Resets algorithm object, such that it can be applied to another graph.
Implements algorithm.
void planarity::calc_embedding | ( | bool | p | ) | [inline] |
If p
is true a planar embedding will be calculated in the next run.
p | true iff embedding should be calculated |
bool planarity::calc_embedding | ( | ) | const [inline] |
Returns true if a planar embedding will be calculated in the next run.
true | iff embedding will be calculated |
void planarity::calc_obstruction | ( | bool | p | ) | [inline] |
If p
is true the obstructions to planarity will be calculated in the next run.
This implies the calculation of an embedding.
p | true iff obstructions to planarity should be calculated |
bool planarity::calc_obstruction | ( | ) | const [inline] |
Returns true if the obstructions to planarity will be calculated in the next run.
true | iff obstructions to planarity will be calculated |
void planarity::make_biconnected | ( | bool | p | ) | [inline] |
Determines the strategy used to test a graph which is not biconnected.
If this is enabled the graph will be made biconnected by adding some new edges. This is usually faster than testing the biconnected components one by one, which is done if this option is disabled. By default this is enabled.
p | true iff graph should be made biconnected |
bool planarity::make_biconnected | ( | ) | const [inline] |
Returns strategy for testing graphs, which are not biconnected.
true | iff graph will be made biconnected before test |
bool planarity::is_planar | ( | ) | const [inline] |
Result of last test.
true | iff graph in last run was planar. |
planar_embedding& planarity::get_embedding | ( | ) | [inline] |
If graph in last run was planar a planar embedding is calculated during the reductions. This function gives access to it.
list<edge>& planarity::get_obstruction_edges | ( | ) | [inline] |
Returns the edges of a subgraph homeomorphic to either K3,3 or K5 if graph in last run was not planar.
list<node>& planarity::get_obstruction_nodes | ( | ) | [inline] |
Returns the nodes of a subgraph homeomorphic to either K3,3 or K5 if graph in last run was not planar.
University of Passau - FMI - Theoretical Computer Science