74 if (adj->theEdge()->target() == v) {
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);
188 if (pBCTree->typeOfGNode(nG) == BCTree::GNodeType::CutVertex) {
189 node cT2 = pBCTree->bcproper(nG);
191 bool doRecurse =
true;
194 node parent_bT_of_cT2 =
nullptr;
197 if (adj->theEdge()->source() == cT2) {
198 parent_bT_of_cT2 = adj->twinNode();
205 if (treeNodeTreated[parent_bT_of_cT2]) {
212 if (aeFace->theNode() == nSG) {
213 ae = aeFace->
succ() ==
nullptr ? nSG->firstAdj() : aeFace->
succ();
220 node bT2 = adj->theEdge()->opposite(cT2);
222 if (!treeNodeTreated[bT2]) {
223 embedBlock(bT2, cT2, *pAfter);
230 bool after_ae =
true;
231 for (
adjEntry aeNode = ae; after_ae || aeNode != ae;
232 aeNode = aeNode->
succ() ==
nullptr ? nSG->firstAdj() : aeNode->succ()) {
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) {
Declaration of class BCTree.
Declaration of CombinatorialEmbedding and face.
Definition of ogdf::EmbedderBCTreeBase.
Declares ogdf::EmbedderMaxFaceBiconnectedGraphs.
Includes declaration of graph class.
Decralation of GraphElement and GraphList classes.
Declaration of doubly linked lists and iterators.
Simple, safe base classes for C++ observables and observers.
Basic declarations, included by all source files.
Class for adjacency list elements.
adjEntry succ() const
Returns the successor in the adjacency list.
edge theEdge() const
Returns the edge associated with this adjacency entry.
node theNode() const
Returns the node whose adjacency list contains this element.
Combinatorial embeddings of planar graphs with modification functionality.
face leftFace(adjEntry adj) const
Returns the face to the left of adj, i.e., the face containing the twin of adj.
Class for the representation of edges.
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
node source() const
Returns the source node of the edge.
Embedder that maximizing the external face.
Embedder that maximizes the external face.
void embedBlock(const node &bT)
Computes the adjacency list for all nodes in a block and calls recursively the function for all block...
void computeBlockGraphs(const node &bT, const node &cH)
Computes recursively the block graph for every block.
NodeArray< NodeArray< int > > nodeLength
saving for each node in the block graphs its length
NodeArray< NodeArray< int > > cstrLength
is saving for each node in the block graphs its cstrLength
void forEachIngoingNeighbor(node v, std::function< void(node)> fun)
Calls fun for every ingoing edge (w,v).
EmbedderMaxFace()=default
virtual void maximumFaceRec(const node &bT, node &bT_opt, int &ell_opt)
Top down traversal of BC-tree.
NodeArray< NodeArray< node > > nBlockEmbedding_to_nH
a mapping of nodes in blockG to the auxiliaryGraph of the BC-tree
NodeArray< EdgeArray< edge > > eBlockEmbedding_to_eH
a mapping of edges in blockG to the auxiliaryGraph of the BC-tree
NodeArray< bool > treeNodeTreated
treeNodeTreated saves for all block nodes in the BC-tree if it has already been treated or not.
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)
NodeArray< EdgeArray< edge > > eH_to_eBlockEmbedding
a mapping of edges in the auxiliaryGraph of the BC-tree to blockG
NodeArray< NodeArray< node > > nH_to_nBlockEmbedding
a mapping of nodes in the auxiliaryGraph of the BC-tree to blockG
NodeArrayP< Graph > blockG
all blocks
void computeNodeLength(node bT, std::function< int &(node)> setter)
virtual int constraintMaxFace(const node &bT, const node &cH)
Bottom up traversal of BC-tree.
NodeArray< List< adjEntry > > newOrder
saves for every node of PG the new adjacency list
virtual void doCall(Graph &G, adjEntry &adjExternal) override
Computes an embedding of G with maximum external face.
virtual void embedBlock(const node &bT, const node &cT, ListIterator< adjEntry > &after)
Computes the adjacency list for all nodes in a block and calls recursively the function for all block...
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)
NodeArray< StaticSPQRTree * > spqrTrees
The SPQR-trees of the blocks.
Faces in a combinatorial embedding.
internal::FaceAdjContainer entries
Container maintaining the adjacency entries in the face.
Data type for general directed graphs (adjacency list representation).
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
Encapsulates a pointer to a list element.
bool valid() const
Returns true iff the iterator points to an element.
ListIteratorBase< E, isConst, isReverse > succ() const
Returns successor iterator.
Class for the representation of nodes.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
void init(const Base *base=nullptr)
Reinitializes the array. Associates the array with the matching registry of base.
Linear-time implementation of static SPQR-trees.
Common base for embedder algorithms based on BC trees.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
#define OGDF_NO_COPY(cls)
Explicitly disables (deletes) copy construction and assignment for class cls.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
The namespace for all OGDF objects.