55 virtual void doCall(
Graph& G,
adjEntry& adjExternal)
override;
68 forEachIngoingNeighbor(bT, [&](
node vT) {
69 node vH = pBCTree->cutVertex(vT, bT);
70 int length_v_in_block = 0;
73 forEachIngoingNeighbor(vT, [&](
node bT2) {
74 node cutVertex = pBCTree->cutVertex(vT, bT2);
75 length_v_in_block += constraintMaxFace(bT2, cutVertex);
78 setter(vH) = length_v_in_block;
89 std::function<
node &(
node)> getBENode,
90 std::function<
int &(
node,
node)> getCstrLength,
91 std::function<
int &(
node,
node)> getNodeLength,
92 int *
const maxFaceSizeToUpdate =
nullptr) {
104 if (maxFaceSizeToUpdate !=
nullptr) {
105 *maxFaceSizeToUpdate = tmp_ell_opt;
108 forEachIngoingNeighbor(bT, [&](
node cT) {
109 node cH = pBCTree->cutVertex(cT, bT);
113 if (maxFaceSizeToUpdate ==
nullptr) {
114 uniformLengths.
init(blockGraph, 1);
121 maxFaceSizeToUpdate ==
nullptr ? uniformLengths : edgeLengthForEllOpt,
128 forEachIngoingNeighbor(cT, [&](
node bT2) {
130 L += getCstrLength(bT2, pBCTree->cutVertex(cT, bT2));
133 forEachIngoingNeighbor(cT, [&](
node pT) {
136 node partnerV = pBCTree->cutVertex(cT, pT);
137 getNodeLength(pT, partnerV) = L - getCstrLength(pT, partnerV);
140 node thisbT_opt = pBCTree->originalGraph().chooseNode();
142 maximumFaceRec(pT, thisbT_opt, thisell_opt);
144 if (thisell_opt > tmp_ell_opt) {
145 tmp_bT_opt = thisbT_opt;
146 tmp_ell_opt = thisell_opt;
154 ell_opt = tmp_ell_opt;
167 const node nodeInBlock) {
177 if (*pAdjExternal ==
nullptr) {
178 node on = pBCTree->original(mapNodeToH[m_adjExternal->
theNode()]);
181 if (ae->
theEdge() == pBCTree->original(mapEdgeToH[m_adjExternal->
theEdge()])) {
182 *pAdjExternal = ae->
twin();
189 node nH = mapNodeToH[nSG];
190 node nG = pBCTree->original(nH);
195 node cT2 = pBCTree->bcproper(nG);
196 bool doRecurse =
true;
199 node parent_bT_of_cT2 =
nullptr;
210 if (treeNodeTreated[parent_bT_of_cT2]) {
217 if (aeFace->
theNode() == nSG) {
228 if (!treeNodeTreated[bT2]) {
229 embedBlock(bT2, cT2, *pAfter);
236 bool after_ae =
true;
237 for (
adjEntry aeNode = ae; after_ae || aeNode != ae; aeNode = aeNode->
succ() ==
nullptr ? nSG->
firstAdj() : aeNode->
succ()) {
238 edge e = pBCTree->original(mapEdgeToH[aeNode->theEdge()]);
240 if (pAfter->
valid()) {
241 *pAfter = newOrder[nG].insertAfter(e->
adjSource(), *pAfter);
243 *pAfter = newOrder[nG].pushBack(e->
adjSource());
246 if (pAfter->
valid()) {
247 *pAfter = newOrder[nG].insertAfter(e->
adjTarget(), *pAfter);
249 *pAfter = newOrder[nG].pushBack(e->
adjTarget());
253 after_ae &= aeNode->
succ() !=
nullptr;
256 if (*pAfter != after) {
268 void computeBlockGraphs(
const node& bT,
const node& cH);
277 virtual int constraintMaxFace(
const node& bT,
const node& cH);
287 virtual void maximumFaceRec(
const node& bT,
node& bT_opt,
int& ell_opt);
295 void embedBlock(
const node& bT);
node target() const
Returns the target node of the edge.
NodeArray< NodeArray< node > > nBlockEmbedding_to_nH
a mapping of nodes in blockG to the auxiliaryGraph of the BC-tree
NodeArray< StaticSPQRTree * > spqrTrees
The SPQR-trees of the blocks.
edge theEdge() const
Returns the edge associated with this adjacency entry.
NodeArray< NodeArray< int > > nodeLength
saving for each node in the block graphs its length
ListIteratorBase< E, isConst, isReverse > succ() const
Returns successor iterator.
void init()
Reinitializes the array. Associates the array with no graph.
Data type for general directed graphs (adjacency list representation).
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
NodeArray< List< adjEntry > > newOrder
saves for every node of PG the new adjacency list
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.
NodeArray< EdgeArray< edge > > eH_to_eBlockEmbedding
a mapping of edges in the auxiliaryGraph of the BC-tree to blockG
void computeNodeLength(node bT, std::function< int &(node)> setter)
bool valid() const
Returns true iff the iterator points to an element.
NodeArray< bool > treeNodeTreated
treeNodeTreated saves for all block nodes in the BC-tree if it has already been treated or not...
Declaration of class StaticSPQRTree.
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.
NodeArray< NodeArray< int > > cstrLength
is saving for each node in the block graphs its cstrLength
internal::FaceAdjContainer entries
Container maintaining the adjacency entries in the face.
Faces in a combinatorial embedding.
node twinNode() const
Returns the associated node of the corresponding adjacency entry (shorthand for twin()->theNode()).
Class for the representation of edges.
adjEntry twin() const
Returns the corresponding adjacency element associated with the same edge.
Class for the representation of nodes.
Encapsulates a pointer to a list element.
Embedder that maximizes the external face.
node opposite(node v) const
Returns the adjacent node different from v.
NodeArray< NodeArray< node > > nH_to_nBlockEmbedding
a mapping of nodes in the auxiliaryGraph of the BC-tree to blockG
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)
void forEachIngoingNeighbor(node v, std::function< void(node)> fun)
Calls fun for every ingoing edge (w,v).
Linear-time implementation of static SPQR-trees.
Declares ogdf::EmbedderMaxFaceBiconnectedGraphs.
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 succ() const
Returns the successor in the adjacency list.
face leftFace(adjEntry adj) const
Returns the face to the left of adj, i.e., the face containing the twin of adj.
NodeArray< Graph > blockG
all blocks
node source() const
Returns the source node of the edge.
Common base for embedder algorithms based on BC trees.
The namespace for all OGDF objects.
Definition of ogdf::EmbedderBCTreeBase.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
adjEntry firstAdj() const
Returns the first entry in the adjaceny list.
Combinatorial embeddings of planar graphs with modification functionality.
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
node theNode() const
Returns the node whose adjacency list contains this element.
Class for adjacency list elements.
NodeArray< EdgeArray< edge > > eBlockEmbedding_to_eH
a mapping of edges in blockG to the auxiliaryGraph of the BC-tree
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.