59 m_cnEdges +=
cr.m_cnEdges;
64 return RCCrossings(m_cnClusters +
cr.m_cnClusters, m_cnEdges +
cr.m_cnEdges);
68 return RCCrossings(m_cnClusters -
cr.m_cnClusters, m_cnEdges -
cr.m_cnEdges);
72 if (m_cnClusters ==
cr.m_cnClusters) {
73 return m_cnEdges <=
cr.m_cnEdges;
75 return m_cnClusters <=
cr.m_cnClusters;
80 if (m_cnClusters ==
cr.m_cnClusters) {
81 return m_cnEdges <
cr.m_cnEdges;
83 return m_cnClusters <
cr.m_cnClusters;
87 bool isZero()
const {
return m_cnClusters == 0 && m_cnEdges == 0; }
90 m_cnClusters = m_cnEdges = std::numeric_limits<int>::max();
110 enum class Type { Compound, Node, AuxNode };
162 m_type = Type::Compound;
173 m_origCluster =
nullptr;
197 int pos()
const {
return m_pos; }
212 void store() { m_storedChild = m_child; }
298 enum class NodeType { Node, ClusterTop, ClusterBottom, Dummy, ClusterTopBottom };
Declaration and implementation of ClusterArray class.
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
Declaration and implementation of EdgeArray class.
The parameterized class Array implements dynamic arrays of type E.
Dynamic arrays indexed with clusters.
Representation of clusters in a clustered graph.
cluster parent()
Returns the parent of the cluster.
void createClusterTree(cluster cOrig)
const ClusterGraph * m_pCG
ClusterArray< cluster > m_original
ClusterArray< cluster > m_copy
ClusterGraphCopy(const ExtendedNestingGraph &H, const ClusterGraph &CG)
void setParent(node v, cluster c)
cluster original(cluster cCopy) const
const ExtendedNestingGraph * m_pH
const ClusterGraph & getOriginalClusterGraph() const
void init(const ExtendedNestingGraph &H, const ClusterGraph &CG)
cluster copy(cluster cOrig) const
Representation of clustered graphs.
Represents layer in an extended nesting graph.
void simplifyAdjacencies(List< LHTreeNode::Adjacency > &adjs)
const LHTreeNode * root() const
void simplifyAdjacencies()
void setRoot(LHTreeNode *r)
Dynamic arrays indexed with edges.
Class for the representation of edges.
node source() const
Returns the source node of the edge.
void assignAeLevel(cluster c, int &count)
ClusterArray< node > m_topNode
cluster parent(node v) const
edge origEdge(edge e) const
NodeArray< int > m_auxDeg
RCCrossings reduceCrossings(LHTreeNode *cNode, bool dirTopDown)
SListPure< cluster > m_markedClustersTree
Array< ENGLayer > m_layer
const ClusterGraph & getOriginalClusterGraph() const
void assignPos(const LHTreeNode *vNode, int &count)
const LHTreeNode * layerHierarchyTree(int i) const
EdgeArray< List< edge > > m_copyEdge
ClusterArray< LHTreeNode * > m_markTree
ClusterArray< cluster > m_mark
bool isVirtual(cluster c) const
ClusterArray< int > m_bottomRank
ClusterArray< int > m_topRank
NodeType type(node v) const
EdgeArray< bool > m_vertical
cluster parent(cluster c) const
const List< edge > & chain(edge e) const
bool reachable(node v, node u, SListPure< node > &successors)
bool isReversed(edge e) const
const ENGLayer & layer(int i) const
LHTreeNode * lca(LHTreeNode *uNode, LHTreeNode *vNode, LHTreeNode **uChild, LHTreeNode **vChild) const
int aeLevel(node v) const
NodeArray< int > m_aeLevel
ClusterArray< node > m_bottomNode
int topRank(cluster c) const
NodeArray< bool > m_aeVisited
const ClusterGraphCopy & getClusterGraph() const
bool isLongEdgeDummy(node v) const
void createVirtualClusters()
edge addEdge(node u, node v, bool addAlways=false)
node origNode(node v) const
int numberOfLayers() const
void removeTopBottomEdges()
NodeArray< NodeType > m_type
ClusterGraphCopy m_CGC
copy of original cluster graph
EdgeArray< edge > m_origEdge
SListPure< cluster > m_markedClusters
int bottomRank(cluster c) const
ExtendedNestingGraph(const ClusterGraph &CG)
cluster originalCluster(node v) const
node bottom(cluster cOrig) const
bool tryEdge(node u, node v, Graph &G, NodeArray< int > &level)
bool verticalSegment(edge e) const
node top(cluster cOrig) const
cluster lca(node u, node v) const
void moveDown(node v, const SListPure< node > &successors, NodeArray< int > &level)
void createVirtualClusters(cluster c, NodeArray< node > &vCopy, ClusterArray< node > &cCopy)
RCCrossings reduceCrossings(int i, bool dirTopDown)
NodeArray< node > m_origNode
Data type for general directed graphs (adjacency list representation).
List< ClusterCrossing > m_upperClusterCrossing
Array< LHTreeNode * > m_child
cluster originalCluster() const
void setChild(int i, LHTreeNode *p)
List< Adjacency > m_upperAdj
void setParent(LHTreeNode *p)
LHTreeNode * child(int i)
const LHTreeNode * up() const
const LHTreeNode * parent() const
LHTreeNode(LHTreeNode *parent, node v, Type t=Type::Node)
const LHTreeNode * down() const
List< Adjacency > m_lowerAdj
const LHTreeNode * child(int i) const
int numberOfChildren() const
Array< LHTreeNode * > m_storedChild
LHTreeNode(cluster c, LHTreeNode *up)
List< ClusterCrossing > m_lowerClusterCrossing
Doubly linked lists (maintaining the length of the list).
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
int outdeg() const
Returns the outdegree of the node.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.
Adjacency(node u, LHTreeNode *vNode, int weight=1)
ClusterCrossing(node uc, LHTreeNode *cNode, node u, LHTreeNode *uNode, edge e)
RCCrossings operator-(const RCCrossings &cr) const
RCCrossings operator+(const RCCrossings &cr) const
bool operator<=(const RCCrossings &cr) const
RCCrossings & setInfinity()
RCCrossings & operator+=(const RCCrossings &cr)
RCCrossings(int cnClusters, int cnEdges)
bool operator<(const RCCrossings &cr) const
static int compare(const RCCrossings &x, const RCCrossings &y)