230 const node& n =
nullptr);
365 if (G.numberOfEdges() <= 2) {
366 edge e = G.firstEdge();
431 for (
node v : G.nodes) {
432 G.sort(v, newOrder[v]);
445 edge referenceEdge =
S.referenceEdge();
446 if (
S.isVirtual(
ae->theEdge())) {
453 if (!treeNodeTreated[
twinNT]) {
461 if (
ae->theEdge()->source() ==
ae->theNode()) {
472 if (
ae->theEdge() == referenceEdge) {
473 if (
ae->theNode() ==
ae->theEdge()->source()) {
484 if (
ae->theNode() ==
ae->theEdge()->source()) {
492 node origNode =
S.original(
ae->theNode());
493 edge origEdge =
S.realEdge(
ae->theEdge());
494 if (origNode == origEdge->
source()) {
518 treeNodeTreated[mu] =
true;
522 expandEdgeSNode(
spqrTree, treeNodeTreated, mu,
leftNode, nodeLength, edgeLength, newOrder,
526 expandEdgePNode(
spqrTree, treeNodeTreated, mu,
leftNode, nodeLength, edgeLength, newOrder,
530 expandEdgeRNode(
spqrTree, treeNodeTreated, mu,
leftNode, nodeLength, edgeLength, newOrder,
546 edge referenceEdge =
S.referenceEdge();
549 for (
edge e :
S.getGraph().edges) {
550 if (!
S.isVirtual(e)) {
556 }
else if (
leftNode->firstAdj()->theEdge() == referenceEdge) {
565 if (
orgEdge->source() ==
S.original(
ae->theNode())) {
575 }
else if (referenceEdge) {
585 if (
ae->theEdge() == referenceEdge) {
587 if (
ae->theNode() == referenceEdge->
source()) {
605 if (
ae->theEdge() == referenceEdge) {
607 if (
ae->theNode() == referenceEdge->
source()) {
619 if (
ae->theNode()->firstAdj() ==
ae) {
620 ae =
ae->theNode()->lastAdj();
622 ae =
ae->theNode()->firstAdj();
636 edge referenceEdge =
S.referenceEdge();
647 if (!referenceEdge) {
648 for (
edge e :
S.getGraph().edges) {
649 if (!
S.isVirtual(e)) {
664 for (
edge e :
S.getGraph().edges) {
677 for (
int i = 0; i < 2; ++i) {
688 if (n == referenceEdge->
source()) {
696 S.getGraph().allEdges(edgeList);
710 if (referenceEdge->
source() == n) {
716 if (referenceEdge->
source() == n) {
732 for (
edge e : edgeList) {
734 || !
S.isVirtual(e)) {
739 if (referenceEdge !=
nullptr && e->
source() == n) {
740 if (referenceEdge->
source() == n) {
745 }
else if (referenceEdge) {
746 if (referenceEdge->
source() == n) {
755 if (e->source() == n) {
767 for (
edge e : edgeList) {
775 if (e->source() == n) {
787 if (e->source() == n) {
814 if (n == referenceEdge->
source()) {
858 edge referenceEdge =
S.referenceEdge();
874 if ((n ==
nullptr && (
ae->theEdge() == referenceEdge || !referenceEdge))
875 ||
S.original(
ae->theNode()) == n) {
882 if (!referenceEdge && !
S.isVirtual(
ae->theEdge())) {
886 sizeOfFace += edgeLength[mu][
ae->theEdge()] + nodeLength[
S.original(
ae->theNode())];
932 for (
node v :
S.getGraph().nodes) {
948 if (
start_ae->theEdge() == referenceEdge) {
976 edge vE = (
ae->theEdge() == referenceEdge) ? referenceEdge :
ae->theEdge();
977 node nu = (
ae->theEdge() == referenceEdge) ? mu :
S.twinTreeNode(
ae->theEdge());
978 if (
S.isVirtual(
vE)) {
979 if (
ae->theNode() ==
vE->source()) {
988 if (
ae->theEdge() == referenceEdge) {
1001 : (!
aeN->succ() ?
ae->theNode()->firstAdj() :
aeN->succ())) {
1003 if (
S.isVirtual(
aeN->theEdge()) &&
aeN->theEdge() != referenceEdge) {
1035 if (referenceEdge) {
1036 if (
aeN->theEdge()->source() ==
aeN->theNode()) {
1037 if (
aeN->theEdge()->target() == referenceEdge->
source()) {
1039 }
else if (
aeN->theEdge()->target() == referenceEdge->
target()) {
1043 if (
aeN->theEdge()->source() == referenceEdge->
source()) {
1045 }
else if (
aeN->theEdge()->source() == referenceEdge->
target()) {
1069 for (
node v :
S.getGraph().nodes) {
1078 if (
buffer[
ae->theEdge()].empty()) {
1107 if (G.numberOfNodes() <= 1 || G.numberOfEdges() <= 2) {
1116 for (
edge e :
spqrTree->skeleton(v).getGraph().edges) {
1117 if (
spqrTree->skeleton(v).isVirtual(e)) {
1136 if (G.numberOfEdges() == 1) {
1137 edge e = G.firstEdge();
1138 return edgeLength[e] + nodeLength[e->
source()] + nodeLength[e->
target()];
1140 if (G.numberOfEdges() == 2) {
1143 return edgeLength[
e1] + edgeLength[
e2] + nodeLength[
e1->source()] + nodeLength[
e1->target()];
1156 if (G.numberOfEdges() == 1) {
1157 edge e = G.firstEdge();
1158 return edgeLength[e] + nodeLength[e->
source()] + nodeLength[e->
target()];
1160 if (G.numberOfEdges() == 2) {
1163 return edgeLength[
e1] + edgeLength[
e2] + nodeLength[
e1->source()] + nodeLength[
e1->target()];
1172 for (
edge e :
spqrTree->skeleton(v).getGraph().edges) {
1173 if (
spqrTree->skeleton(v).isVirtual(e)) {
1203 if (G.numberOfEdges() == 1) {
1204 edge e = G.firstEdge();
1205 return edgeLength[e] + nodeLength[e->
source()] + nodeLength[e->
target()];
1207 if (G.numberOfEdges() == 2) {
1210 return edgeLength[
e1] + edgeLength[
e2] + nodeLength[
e1->source()] + nodeLength[
e1->target()];
1232 if (G.numberOfEdges() == 1) {
1233 edge e = G.firstEdge();
1234 return edgeLength[e] + nodeLength[e->
source()] + nodeLength[e->
target()];
1235 }
else if (G.numberOfEdges() == 2) {
1238 return edgeLength[
e1] + edgeLength[
e2] + nodeLength[
e1->source()] + nodeLength[
e1->target()];
1245 mus[i] =
spqrTree->skeletonOfReal(adj->theEdge()).treeNode();
1275 edge ed = adj->theEdge();
1276 if (
ed->source() == mu) {
1277 bottomUpTraversal(
spqrTree,
ed->target(), nodeLength, edgeLength);
1281 for (
edge e :
spqrTree.skeleton(mu).getGraph().edges) {
1283 if (!
spqrTree.skeleton(mu).isVirtual(e) || e ==
spqrTree.skeleton(mu).referenceEdge()) {
1330 if (
ae->theEdge() ==
er) {
1334 + nodeLength[
spqrTree.skeleton(
nu).original(
ae->theNode())];
1344 edgeLength[mu][e] = 1;
1357 edge ed = adj->theEdge();
1358 if (
ed->source() != mu) {
1370 for (
edge ed2 :
S.getGraph().edges) {
1371 L += edgeLength[mu][
ed2];
1373 for (
node no :
S.getGraph().nodes) {
1374 L += nodeLength[
S.original(
no)];
1378 - nodeLength[
S.original(
eSnu->source())] - nodeLength[
S.original(
eSnu->target())];
1383 for (
edge ed2 :
S.getGraph().edges) {
1404 if (
ae->theEdge() ==
eSnu) {
1408 edgeLength[mu][
ae->theEdge()] + nodeLength[
S.original(
ae->theNode())];
1415 - nodeLength[
S.original(
eSnu->source())] - nodeLength[
S.original(
eSnu->target())];
1421 topDownTraversal(
spqrTree,
ed->target(), nodeLength, edgeLength);
1440 if (
spqrTree.skeleton(mu).original(
ae->theNode()) == n) {
1443 if (!
spqrTree.skeleton(mu).isVirtual(
ae->theEdge())) {
1522 node originalNode =
spqrTree.skeleton(mu).original(
ae->theNode());
1524 if (!
spqrTree.skeleton(mu).isVirtual(
ae->theEdge())) {
1528 + nodeLength[
spqrTree.skeleton(mu).original(
ae->theNode())];
Declaration of CombinatorialEmbedding and face.
Declaration of class StaticSPQRTree.
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.
Dynamic arrays indexed with edges.
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 target() const
Returns the target node of the edge.
node source() const
Returns the source node of the edge.
Embedder that maximizing the external face.
static void expandEdgeRNode(const StaticSPQRTree &spqrTree, NodeArray< bool > &treeNodeTreated, const node &mu, const node &leftNode, const NodeArray< T > &nodeLength, const NodeArray< EdgeArray< T > > &edgeLength, NodeArray< List< adjEntry > > &newOrder, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArraySource, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArrayTarget, adjEntry &adjExternal, const node &n)
static void topDownTraversal(StaticSPQRTree &spqrTree, const node &mu, const NodeArray< T > &nodeLength, NodeArray< EdgeArray< T > > &edgeLength)
Top down traversal of SPQR-tree computing the component length of all reference edges.
static void expandEdgePNode(const StaticSPQRTree &spqrTree, NodeArray< bool > &treeNodeTreated, const node &mu, const node &leftNode, const NodeArray< T > &nodeLength, const NodeArray< EdgeArray< T > > &edgeLength, NodeArray< List< adjEntry > > &newOrder, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArraySource, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArrayTarget, adjEntry &adjExternal)
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.
static void bottomUpTraversal(StaticSPQRTree &spqrTree, const node &mu, const NodeArray< T > &nodeLength, NodeArray< EdgeArray< T > > &edgeLength)
Bottom up traversal of SPQR-tree computing the component length of all non-reference edges.
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.
static void compute(const Graph &G, const NodeArray< T > &nodeLength, const EdgeArray< T > &edgeLength, StaticSPQRTree *spqrTree, NodeArray< EdgeArray< T > > &edgeLengthSkel)
Computes the component lengths of all virtual edges in spqrTree.
static T largestFaceInSkeleton(const StaticSPQRTree &spqrTree, const node &mu, const NodeArray< T > &nodeLength, const NodeArray< EdgeArray< T > > &edgeLength)
Computes the size of a maximum face in the skeleton graph of mu.
static T largestFaceContainingNode(const StaticSPQRTree &spqrTree, const node &mu, const node &n, const NodeArray< T > &nodeLength, const NodeArray< EdgeArray< T > > &edgeLength)
Computes the size of a maximum face in the skeleton graph of mu containing n.
static void expandEdgeSNode(const StaticSPQRTree &spqrTree, NodeArray< bool > &treeNodeTreated, const node &mu, const node &leftNode, const NodeArray< T > &nodeLength, const NodeArray< EdgeArray< T > > &edgeLength, NodeArray< List< adjEntry > > &newOrder, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArraySource, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArrayTarget, adjEntry &adjExternal)
static void adjEntryForNode(adjEntry &ae, ListIterator< adjEntry > &before, const StaticSPQRTree &spqrTree, NodeArray< bool > &treeNodeTreated, const node &mu, const node &leftNode, const NodeArray< T > &nodeLength, const NodeArray< EdgeArray< T > > &edgeLength, NodeArray< List< adjEntry > > &newOrder, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArraySource, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArrayTarget, adjEntry &adjExternal)
static void expandEdge(const StaticSPQRTree &spqrTree, NodeArray< bool > &treeNodeTreated, const node &mu, const node &leftNode, const NodeArray< T > &nodeLength, const NodeArray< EdgeArray< T > > &edgeLength, NodeArray< List< adjEntry > > &newOrder, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArraySource, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArrayTarget, adjEntry &adjExternal, const node &n=nullptr)
Faces in a combinatorial embedding.
Data type for general directed graphs (adjacency list representation).
Doubly linked lists (maintaining the length of the list).
Encapsulates a pointer to a list element.
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
int degree() const
Returns the degree of the node (indegree + outdegree).
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
Skeleton graphs of nodes in an SPQR-tree.
Linear-time implementation of static SPQR-trees.
Declaration of extended graph algorithms.
bool planarEmbed(Graph &G)
Returns true, if G is planar, false otherwise. If true is returned, G will be planarly embedded.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.