#include <ogdf/cluster/ClusterAnalysis.h>
Public Member Functions | |
ClusterAnalysis (const ClusterGraph &C, bool indyBags=false) | |
Constructor. Performs all analyses and in case indyBags is set to true, also computes a partition into independently solvable subproblems for cluster planarization (if applicable). | |
ClusterAnalysis (const ClusterGraph &C, bool oalists, bool indyBags) | |
Additionally allows to forbid storing lists of outer active vertices. | |
~ClusterAnalysis () | |
int | bagIndex (node v, cluster c) |
Returns bag index number for a vertex v in cluster c . | |
int | indyBagIndex (node v) |
Returns independent bag index number for a vertex v . | |
cluster | indyBagRoot (int i) |
Returns root cluster of independent bag. Note that this cluster either has direct vertex members or more than one child. | |
int | innerActive (cluster c) const |
Returns number of inneractive vertices of cluster c. | |
bool | isInnerActive (node v, cluster c) const |
bool | isOuterActive (node v, cluster c) const |
Returns outer activity status for vertex v wrt cluster c . | |
List< edge > & | lcaEdges (cluster c) |
Returns list of edges for cluster c with lca c. | |
int | minIALevel (node v) const |
Returns the highest (smallest) level depth for which a vertex is inner active, only initialized if vertex is inner active. | |
int | minIOALevel (node v) const |
Returns the highest (smallest) level depth for which a vertex is inner or outer active. | |
int | minOALevel (node v) const |
Returns the highest (smallest) level depth for which a vertex is outer active, only initialized if vertex is outer active. | |
int | numberOfBags (cluster c) const |
Returns number of bags for cluster c . | |
int | numberOfIndyBags () |
Returns number of independent bags in clustergraph, -1 in case no independent bags were computed. Ascending consecutive numbers are assigned, starting from 0. | |
List< node > & | oaNodes (cluster c) |
Returns list of outeractive vertices for cluster c . The result is only valid if lists are stored, i.e. m_storeoalists is true. | |
int | outerActive (cluster c) const |
Returns number of outeractive vertices of cluster c. | |
Static Public Attributes | |
static const int | DefaultIndex |
static const int | IsNotActiveBound |
Protected Member Functions | |
void | computeBags () |
Compute bags per cluster and store result as vertex-bag index in m_bagIndex. | |
void | computeIndyBags () |
Compute independent bags per cluster and store result as vertex-indyBag index in m_indyBagNumber. | |
Private Member Functions | |
void | cleanUp () |
Deletes dynamically allocated structures. | |
void | init () |
Initialize the structures, performs analyses. | |
void | partitionCluster (ListConstIterator< node > &nodeIt, cluster c, HashArray< int, List< node > > &bagNodes, HashArray< int, bool > &indyBag, Skiplist< int * > &indexNumbers, Array< cluster > &bagRoots) |
Runs through a list of vertices (starting with the one nodeIT points to) which is expected to be a full list of cluster vertices in c . Depending on outer activity and bag index number of the vertices, independent bags are detected and a corresponding index is assigned accordingly for each vertex. If omitChildBags is set to true, already processed vertices are skipped. | |
Private Attributes | |
NodeArray< ClusterArray< int > * > | m_bagindex |
We store the bag affiliation of the vertices for each cluster. A value of -1 indicates that the vertex is not a member of the cluster. | |
ClusterArray< int > * | m_bags |
Number of bags per cluster (stored even if vertex list is not stored) | |
const ClusterGraph * | m_C |
NodeArray< ClusterArray< int > * > | m_iactive |
NodeArray< int > | m_ialevel |
ClusterArray< int > * | m_ianum |
Number of inner active vertices. | |
NodeArray< int > | m_indyBagNumber |
Each independent bag has a different number. | |
cluster * | m_indyBagRoots |
const bool | m_indyBags |
If true, a node partition into independent bags is computed which can be used for dividing the input instance into smaller problems wrt cluster planarization. | |
ClusterArray< List< edge > > * | m_lcaEdges |
For each cluster c we store the edges with lca c. | |
int | m_numIndyBags |
NodeArray< ClusterArray< int > * > | m_oactive |
NodeArray< int > | m_oalevel |
ClusterArray< List< node > > * | m_oalists |
For each cluster we store the outeractive vertices. In case you want to save space, set m_storeoalists to false. | |
ClusterArray< int > * | m_oanum |
Number of outer active vertices. | |
const bool | m_storeoalists |
If set to true (default) lists of outeractive vertices are stored. | |
Definition at line 55 of file ClusterAnalysis.h.
|
explicit |
Constructor. Performs all analyses and in case indyBags is set to true, also computes a partition into independently solvable subproblems for cluster planarization (if applicable).
ogdf::ClusterAnalysis::ClusterAnalysis | ( | const ClusterGraph & | C, |
bool | oalists, | ||
bool | indyBags | ||
) |
Additionally allows to forbid storing lists of outer active vertices.
ogdf::ClusterAnalysis::~ClusterAnalysis | ( | ) |
Returns bag index number for a vertex v
in cluster c
.
|
private |
Deletes dynamically allocated structures.
|
protected |
Compute bags per cluster and store result as vertex-bag index in m_bagIndex.
|
protected |
Compute independent bags per cluster and store result as vertex-indyBag index in m_indyBagNumber.
Returns independent bag index number for a vertex v
.
Returns root cluster of independent bag. Note that this cluster either has direct vertex members or more than one child.
i | is the independent bag number for which the root is returned. |
|
private |
Initialize the structures, performs analyses.
Returns number of inneractive vertices of cluster c.
Returns outer activity status for vertex v
wrt cluster c
.
c | is the cluster for which vertex v's activity status is stored. |
v | is the vertex for which the activity status is returned. |
Returns list of edges for cluster c with lca c.
Returns the highest (smallest) level depth for which a vertex is inner active, only initialized if vertex is inner active.
Definition at line 83 of file ClusterAnalysis.h.
Returns the highest (smallest) level depth for which a vertex is inner or outer active.
Definition at line 79 of file ClusterAnalysis.h.
Returns the highest (smallest) level depth for which a vertex is outer active, only initialized if vertex is outer active.
Definition at line 87 of file ClusterAnalysis.h.
|
inline |
Returns number of independent bags in clustergraph, -1 in case no independent bags were computed. Ascending consecutive numbers are assigned, starting from 0.
Definition at line 122 of file ClusterAnalysis.h.
Returns list of outeractive vertices for cluster c
. The result is only valid if lists are stored, i.e. m_storeoalists is true.
Returns number of outeractive vertices of cluster c.
|
private |
Runs through a list of vertices (starting with the one nodeIT
points to) which is expected to be a full list of cluster vertices in c
. Depending on outer activity and bag index number of the vertices, independent bags are detected and a corresponding index is assigned accordingly for each vertex. If omitChildBags is set to true, already processed vertices are skipped.
Definition at line 58 of file ClusterAnalysis.h.
Definition at line 57 of file ClusterAnalysis.h.
|
private |
We store the bag affiliation of the vertices for each cluster. A value of -1 indicates that the vertex is not a member of the cluster.
Definition at line 158 of file ClusterAnalysis.h.
|
private |
Number of bags per cluster (stored even if vertex list is not stored)
Definition at line 165 of file ClusterAnalysis.h.
|
private |
Definition at line 149 of file ClusterAnalysis.h.
|
private |
Definition at line 153 of file ClusterAnalysis.h.
Definition at line 160 of file ClusterAnalysis.h.
|
private |
Number of inner active vertices.
Definition at line 164 of file ClusterAnalysis.h.
Each independent bag has a different number.
Definition at line 177 of file ClusterAnalysis.h.
|
private |
Definition at line 179 of file ClusterAnalysis.h.
If true, a node partition into independent bags is computed which can be used for dividing the input instance into smaller problems wrt cluster planarization.
Definition at line 176 of file ClusterAnalysis.h.
|
private |
For each cluster c we store the edges with lca c.
Definition at line 172 of file ClusterAnalysis.h.
|
private |
Definition at line 178 of file ClusterAnalysis.h.
|
private |
Definition at line 154 of file ClusterAnalysis.h.
Definition at line 161 of file ClusterAnalysis.h.
|
private |
For each cluster we store the outeractive vertices. In case you want to save space, set m_storeoalists to false.
Definition at line 169 of file ClusterAnalysis.h.
|
private |
Number of outer active vertices.
Definition at line 163 of file ClusterAnalysis.h.
If set to true (default) lists of outeractive vertices are stored.
Definition at line 170 of file ClusterAnalysis.h.