#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). More... | |
ClusterAnalysis (const ClusterGraph &C, bool oalists, bool indyBags) | |
Additionally allows to forbid storing lists of outer active vertices. More... | |
~ClusterAnalysis () | |
int | bagIndex (node v, cluster c) |
Returns bag index number for a vertex v in cluster c . More... | |
int | indyBagIndex (node v) |
Returns independent bag index number for a vertex v . More... | |
cluster | indyBagRoot (int i) |
Returns root cluster of independent bag. Note that this cluster either has direct vertex members or more than one child. More... | |
int | innerActive (cluster c) const |
Returns number of inneractive vertices of cluster c. More... | |
bool | isInnerActive (node v, cluster c) const |
bool | isOuterActive (node v, cluster c) const |
Returns outer activity status for vertex v wrt cluster c . More... | |
List< edge > & | lcaEdges (cluster c) |
Returns list of edges for cluster c with lca c. More... | |
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. More... | |
int | minIOALevel (node v) const |
Returns the highest (smallest) level depth for which a vertex is inner or outer active. More... | |
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. More... | |
int | numberOfBags (cluster c) const |
Returns number of bags for cluster c . More... | |
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. More... | |
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. More... | |
int | outerActive (cluster c) const |
Returns number of outeractive vertices of cluster c. More... | |
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. More... | |
void | computeIndyBags () |
Compute independent bags per cluster and store result as vertex-indyBag index in m_indyBagNumber. More... | |
Private Member Functions | |
void | cleanUp () |
Deletes dynamically allocated structures. More... | |
void | init () |
Initialize the structures, performs analyses. More... | |
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. More... | |
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. More... | |
ClusterArray< int > * | m_bags |
Number of bags per cluster (stored even if vertex list is not stored) More... | |
const ClusterGraph * | m_C |
NodeArray< ClusterArray< int > * > | m_iactive |
NodeArray< int > | m_ialevel |
ClusterArray< int > * | m_ianum |
Number of inner active vertices. More... | |
NodeArray< int > | m_indyBagNumber |
Each independent bag has a different number. More... | |
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. More... | |
ClusterArray< List< edge > > * | m_lcaEdges |
For each cluster c we store the edges with lca c. More... | |
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. More... | |
ClusterArray< int > * | m_oanum |
Number of outer active vertices. More... | |
const bool | m_storeoalists |
If set to true (default) lists of outeractive vertices are stored. More... | |
Definition at line 62 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.
int ogdf::ClusterAnalysis::indyBagIndex | ( | node | v | ) |
Returns independent bag index number for a vertex v
.
cluster ogdf::ClusterAnalysis::indyBagRoot | ( | int | i | ) |
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.
int ogdf::ClusterAnalysis::innerActive | ( | cluster | c | ) | const |
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.
|
inline |
Returns the highest (smallest) level depth for which a vertex is inner active, only initialized if vertex is inner active.
Definition at line 96 of file ClusterAnalysis.h.
|
inline |
Returns the highest (smallest) level depth for which a vertex is inner or outer active.
Definition at line 92 of file ClusterAnalysis.h.
|
inline |
Returns the highest (smallest) level depth for which a vertex is outer active, only initialized if vertex is outer active.
Definition at line 100 of file ClusterAnalysis.h.
int ogdf::ClusterAnalysis::numberOfBags | ( | cluster | c | ) | const |
Returns number of bags for cluster c
.
|
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 135 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.
int ogdf::ClusterAnalysis::outerActive | ( | cluster | c | ) | const |
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.
|
static |
Definition at line 71 of file ClusterAnalysis.h.
|
static |
Definition at line 70 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 171 of file ClusterAnalysis.h.
|
private |
Number of bags per cluster (stored even if vertex list is not stored)
Definition at line 178 of file ClusterAnalysis.h.
|
private |
Definition at line 162 of file ClusterAnalysis.h.
|
private |
Definition at line 166 of file ClusterAnalysis.h.
|
private |
Definition at line 173 of file ClusterAnalysis.h.
|
private |
Number of inner active vertices.
Definition at line 177 of file ClusterAnalysis.h.
|
private |
Each independent bag has a different number.
Definition at line 190 of file ClusterAnalysis.h.
|
private |
Definition at line 192 of file ClusterAnalysis.h.
|
private |
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 189 of file ClusterAnalysis.h.
|
private |
For each cluster c we store the edges with lca c.
Definition at line 185 of file ClusterAnalysis.h.
|
private |
Definition at line 191 of file ClusterAnalysis.h.
|
private |
Definition at line 167 of file ClusterAnalysis.h.
|
private |
Definition at line 174 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 182 of file ClusterAnalysis.h.
|
private |
Number of outer active vertices.
Definition at line 176 of file ClusterAnalysis.h.
|
private |
If set to true (default) lists of outeractive vertices are stored.
Definition at line 183 of file ClusterAnalysis.h.