|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
63 virtual void doCall(
Graph& G,
adjEntry& adjExternal)
override;
81 forEachIngoingNeighbor(bT, [&](
node vT) {
82 node vH = pBCTree->cutVertex(vT, bT);
83 int length_v_in_block = 0;
86 forEachIngoingNeighbor(vT, [&](
node bT2) {
87 node cutVertex = pBCTree->cutVertex(vT, bT2);
88 length_v_in_block += constraintMaxFace(bT2, cutVertex);
91 setter(vH) = length_v_in_block;
97 std::function<
node&(
node)> getBENode, std::function<
int&(
node,
node)> getCstrLength,
98 std::function<
int&(
node,
node)> getNodeLength,
int*
const maxFaceSizeToUpdate =
nullptr) {
104 paramNodeLength, edgeLengthForEllOpt, spqrTree, edgeLengthSkel);
106 if (maxFaceSizeToUpdate !=
nullptr) {
107 *maxFaceSizeToUpdate = tmp_ell_opt;
110 forEachIngoingNeighbor(bT, [&](
node cT) {
111 node cH = pBCTree->cutVertex(cT, bT);
115 if (maxFaceSizeToUpdate ==
nullptr) {
116 uniformLengths.
init(blockGraph, 1);
120 getBENode(cH), paramNodeLength,
121 maxFaceSizeToUpdate ==
nullptr ? uniformLengths : edgeLengthForEllOpt, spqrTree,
127 forEachIngoingNeighbor(cT, [&](
node bT2) {
129 L += getCstrLength(bT2, pBCTree->cutVertex(cT, bT2));
132 forEachIngoingNeighbor(cT, [&](
node pT) {
135 node partnerV = pBCTree->cutVertex(cT, pT);
136 getNodeLength(pT, partnerV) = L - getCstrLength(pT, partnerV);
139 node thisbT_opt = pBCTree->originalGraph().chooseNode();
141 maximumFaceRec(pT, thisbT_opt, thisell_opt);
143 if (thisell_opt > tmp_ell_opt) {
144 tmp_bT_opt = thisbT_opt;
145 tmp_ell_opt = thisell_opt;
153 ell_opt = tmp_ell_opt;
163 paramEdgeLength, nodeInBlock);
170 if (*pAdjExternal ==
nullptr) {
171 node on = pBCTree->original(mapNodeToH[m_adjExternal->
theNode()]);
174 if (ae->
theEdge() == pBCTree->original(mapEdgeToH[m_adjExternal->
theEdge()])) {
175 *pAdjExternal = ae->
twin();
182 node nH = mapNodeToH[nSG];
183 node nG = pBCTree->original(nH);
189 node cT2 = pBCTree->bcproper(nG);
191 bool doRecurse =
true;
194 node parent_bT_of_cT2 =
nullptr;
205 if (treeNodeTreated[parent_bT_of_cT2]) {
212 if (aeFace->
theNode() == nSG) {
222 if (!treeNodeTreated[bT2]) {
223 embedBlock(bT2, cT2, *pAfter);
230 bool after_ae =
true;
231 for (
adjEntry aeNode = ae; after_ae || aeNode != ae;
233 edge e = pBCTree->original(mapEdgeToH[aeNode->theEdge()]);
235 if (pAfter->
valid()) {
236 *pAfter = newOrder[nG].insertAfter(e->
adjSource(), *pAfter);
238 *pAfter = newOrder[nG].pushBack(e->
adjSource());
241 if (pAfter->
valid()) {
242 *pAfter = newOrder[nG].insertAfter(e->
adjTarget(), *pAfter);
244 *pAfter = newOrder[nG].pushBack(e->
adjTarget());
248 after_ae &= aeNode->
succ() !=
nullptr;
251 if (*pAfter !=
after) {
263 void computeBlockGraphs(
const node& bT,
const node& cH);
272 virtual int constraintMaxFace(
const node& bT,
const node& cH);
282 virtual void maximumFaceRec(
const node& bT,
node& bT_opt,
int& ell_opt);
290 void embedBlock(
const node& bT);
The namespace for all OGDF objects.
NodeArray< bool > treeNodeTreated
treeNodeTreated saves for all block nodes in the BC-tree if it has already been treated or not.
Includes declaration of graph class.
Linear-time implementation of static SPQR-trees.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
node theNode() const
Returns the node whose adjacency list contains this element.
Embedder that maximizes the external face.
face leftFace(adjEntry adj) const
Returns the face to the left of adj, i.e., the face containing the twin of adj.
NodeArray< NodeArray< node > > nH_to_nBlockEmbedding
a mapping of nodes in the auxiliaryGraph of the BC-tree to blockG
NodeArray< NodeArray< node > > nBlockEmbedding_to_nH
a mapping of nodes in blockG to the auxiliaryGraph of the BC-tree
Simple, safe base classes for C++ observables and observers.
internal::FaceAdjContainer entries
Container maintaining the adjacency entries in the face.
Common base for embedder algorithms based on BC trees.
bool valid() const
Returns true iff the iterator points to an element.
void internalEmbedBlock(const node bT, const node cT, ListIterator< adjEntry > &after, Graph &blockGraph, NodeArray< T > ¶mNodeLength, EdgeArray< T > ¶mEdgeLength, NodeArray< node > &mapNodeToH, EdgeArray< edge > &mapEdgeToH, const node nodeInBlock)
adjEntry twin() const
Returns the corresponding adjacency element associated with the same edge.
Class for adjacency list elements.
ListIteratorBase< E, isConst, isReverse > succ() const
Returns successor iterator.
edge theEdge() const
Returns the edge associated with this adjacency entry.
NodeArrayP< Graph > blockG
all blocks
void computeNodeLength(node bT, std::function< int &(node)> setter)
Declaration of class BCTree.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
Decralation of GraphElement and GraphList classes.
adjEntry succ() const
Returns the successor in the adjacency list.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
static void embed(Graph &G, adjEntry &adjExternal, const NodeArray< T > &nodeLength, const EdgeArray< T > &edgeLength, const node &n=nullptr)
Embeds G by computing and extending a maximum face in G containing n.
#define OGDF_NO_COPY(cls)
Explicitly disables (deletes) copy construction and assignment for class cls.
node source() const
Returns the source node of the edge.
NodeArray< List< adjEntry > > newOrder
saves for every node of PG the new adjacency list
RegisteredArray for nodes, edges and adjEntries of a graph.
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Data type for general directed graphs (adjacency list representation).
NodeArray< NodeArray< int > > nodeLength
saving for each node in the block graphs its length
node twinNode() const
Returns the associated node of the corresponding adjacency entry (shorthand for twin()->theNode()).
void internalMaximumFaceRec(const node &bT, node &bT_opt, int &ell_opt, Graph &blockGraph, NodeArray< int > ¶mNodeLength, StaticSPQRTree *spqrTree, std::function< node &(node)> getBENode, std::function< int &(node, node)> getCstrLength, std::function< int &(node, node)> getNodeLength, int *const maxFaceSizeToUpdate=nullptr)
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
void forEachIngoingNeighbor(node v, std::function< void(node)> fun)
Calls fun for every ingoing edge (w,v).
Definition of ogdf::EmbedderBCTreeBase.
Basic declarations, included by all source files.
Declares ogdf::EmbedderMaxFaceBiconnectedGraphs.
Declaration of CombinatorialEmbedding and face.
static T computeSize(const Graph &G, const node &n, const NodeArray< T > &nodeLength, const EdgeArray< T > &edgeLength)
Returns the size of a maximum external face in G containing the node n.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Combinatorial embeddings of planar graphs with modification functionality.
adjEntry firstAdj() const
Returns the first entry in the adjaceny list.
node opposite(node v) const
Returns the adjacent node different from v.
NodeArray< NodeArray< int > > cstrLength
is saving for each node in the block graphs its cstrLength
Class for the representation of edges.
Declaration of doubly linked lists and iterators.
void init(const Graph *base=nullptr)
Reinitializes the array. Associates the array with the matching registry of base.
Encapsulates a pointer to a list element.
NodeArray< EdgeArray< edge > > eBlockEmbedding_to_eH
a mapping of edges in blockG to the auxiliaryGraph of the BC-tree
node target() const
Returns the target node of the edge.
Class for the representation of nodes.
NodeArray< EdgeArray< edge > > eH_to_eBlockEmbedding
a mapping of edges in the auxiliaryGraph of the BC-tree to blockG
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
NodeArray< StaticSPQRTree * > spqrTrees
The SPQR-trees of the blocks.
Faces in a combinatorial embedding.