286 if (G.numberOfEdges() <= 2) {
287 edge e = G.firstEdge();
313 mus[i] =
spqrTree.skeletonOfReal(adj->theEdge()).treeNode();
353 for (
node v : G.nodes) {
354 G.sort(v, newOrder[v]);
368 edge referenceEdge =
S.referenceEdge();
369 if (
S.isVirtual(
ae->theEdge())) {
376 if (!treeNodeTreated[
twinNT]) {
384 if (
ae->theEdge()->source() ==
ae->theNode()) {
396 if (
ae->theEdge() == referenceEdge) {
397 if (
ae->theNode() ==
ae->theEdge()->source()) {
408 if (
ae->theNode() ==
ae->theEdge()->source()) {
416 node origNode =
S.original(
ae->theNode());
417 edge origEdge =
S.realEdge(
ae->theEdge());
419 if (origNode == origEdge->
source()) {
443 treeNodeTreated[mu] =
true;
475 edge referenceEdge =
S.referenceEdge();
478 for (
edge e :
S.getGraph().edges) {
479 if (!
S.isVirtual(e)) {
485 }
else if (
leftNode->firstAdj()->theEdge() == referenceEdge) {
494 if (
orgEdge->source() ==
S.original(
ae->theNode())) {
504 }
else if (referenceEdge) {
514 if (
ae->theEdge() == referenceEdge) {
515 if (
ae->theNode() == referenceEdge->
source()) {
521 if (
S.isVirtual(
ae->theEdge()) && referenceEdge) {
523 if (
ae->theEdge()->source() ==
ae->theNode()) {
524 if (
ae->theEdge()->target() == referenceEdge->
source()) {
526 }
else if (
ae->theEdge()->target() == referenceEdge->
target()) {
530 if (
ae->theEdge()->source() == referenceEdge->
source()) {
532 }
else if (
ae->theEdge()->source() == referenceEdge->
target()) {
549 if (!referenceEdge) {
551 }
else if (
ae->theNode() == referenceEdge->
source()) {
553 }
else if (
ae->theNode() == referenceEdge->
target()) {
558 if (
ae->theEdge() == referenceEdge) {
559 if (
ae->theNode() == referenceEdge->
source()) {
571 if (
ae->theNode()->firstAdj() ==
ae) {
572 ae =
ae->theNode()->lastAdj();
574 ae =
ae->theNode()->firstAdj();
589 edge referenceEdge =
S.referenceEdge();
600 if (referenceEdge ==
nullptr) {
601 for (
edge e :
S.getGraph().edges) {
602 if (!
S.isVirtual(e)) {
617 for (
edge e :
S.getGraph().edges) {
626 if (edgeLength[mu][e] > edgeLength[mu][*it]) {
645 for (
int i = 0; i < 2; ++i) {
656 if (n == referenceEdge->
source()) {
702 if (
S.isVirtual(e)) {
775 if (
S.isVirtual(e)) {
799 if (
S.isVirtual(e)) {
813 if ((*it)->source() == n) {
814 ae = (*it)->adjSource();
816 ae = (*it)->adjTarget();
828 if (n == referenceEdge->
source()) {
834 if (n == referenceEdge->
source()) {
863 edge referenceEdge =
S.referenceEdge();
879 if ((n ==
nullptr && (
ae->theEdge() == referenceEdge || !referenceEdge))
880 ||
S.original(
ae->theNode()) == n) {
887 if (!referenceEdge && !
S.isVirtual(
ae->theEdge())) {
891 sizeOfFace += edgeLength[mu][
ae->theEdge()] + nodeLength[
S.original(
ae->theNode())];
937 for (
node v :
S.getGraph().nodes) {
953 if (
start_ae->theEdge() == referenceEdge) {
981 edge vE = (
ae->theEdge() == referenceEdge) ? referenceEdge :
ae->theEdge();
982 node nu = (
ae->theEdge() == referenceEdge) ? mu :
S.twinTreeNode(
ae->theEdge());
983 if (
S.isVirtual(
vE)) {
984 if (
ae->theNode() ==
vE->source()) {
994 if (
ae->theNode() == referenceEdge->
source()) {
996 }
else if (
ae->theNode() == referenceEdge->
target()) {
1009 && (
ae->theNode() == referenceEdge->
source()
1010 ||
ae->theNode() == referenceEdge->
target())) {
1025 : (!
aeN->succ() ?
ae->theNode()->firstAdj() :
aeN->succ()),
1028 if (
S.isVirtual(
aeN->theEdge()) &&
aeN->theEdge() != referenceEdge) {
1060 if (referenceEdge) {
1061 if (
aeN->theEdge()->source() ==
aeN->theNode()) {
1062 if (
aeN->theEdge()->target() == referenceEdge->
source()) {
1064 }
else if (
aeN->theEdge()->target() == referenceEdge->
target()) {
1068 if (
aeN->theEdge()->source() == referenceEdge->
source()) {
1070 }
else if (
aeN->theEdge()->source() == referenceEdge->
target()) {
1106 for (
node v :
S.getGraph().nodes) {
1115 if (
buffer[
ae->theEdge()].empty()) {
1119 if (
S.isVirtual(
ae->theEdge())) {
1127 for (
node nBG :
S.getGraph().nodes) {
1134 for (
node nBG :
S.getGraph().nodes) {
1148 }
while (
adj2 != adj);
1154 fPG_to_nDG.
push(
DG.newNode());
1169 if ((*
it4) == (*it2)->twin()) {
1190 for (
auto f1 : *it) {
1193 if (
f2->theEdge() == e
1195 || edgeLength[mu][e] <
e_length)) {
1218 if (referenceEdge) {
1229 if (referenceEdge) {
1289 node nu =
S.twinTreeNode(
ae->theEdge());
1329 if (
S.original(
ae->theEdge()->source()) ==
nOG) {
1382 edge referenceEdge =
S.referenceEdge();
1384 if (!referenceEdge) {
1391 for (
edge eSG :
S.getGraph().edges) {
1392 if (
eSG == referenceEdge) {
1396 if (
S.isVirtual(
eSG)) {
1409 for (
edge eSG :
S.getGraph().edges) {
1410 if (
eSG == referenceEdge) {
1422 for (
edge eSG :
S.getGraph().edges) {
1423 if (
eSG == referenceEdge) {
1472 for (
node nBG :
S.getGraph().nodes) {
1479 for (
node nBG :
S.getGraph().nodes) {
1492 }
while (
adj2 != adj);
1498 fPG_to_nDG.
push(
DG.newNode());
1511 if ((*
it4) == (*it2)->twin()) {
1533 edge e = (*it_f1)->theEdge();
1536 if ((*it_f2)->theEdge() == e
1588 const T infinity = 20000000;
1592 for (
node v : G.nodes) {
1597 for (
int i = 1; i < G.numberOfNodes(); ++i) {
1598 for (
edge e : G.edges) {
1600 if (
d[e->target()] >
d[e->source()] + length[e]) {
1601 d[e->target()] =
d[e->source()] + length[e];
1607 for (
edge e : G.edges) {
1608 if (
d[e->target()] >
d[e->source()] + length[e]) {
Declares ogdf::EmbedderMaxFaceBiconnectedGraphs.
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.
Dynamic arrays indexed with adjacency entries.
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
void push(E e)
Puts a new element in the buffer.
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 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.
Embedder that maximizes the external face (plus layers approach).
static void expandEdge(const StaticSPQRTree &spqrTree, NodeArray< bool > &treeNodeTreated, const node &mu, const node &leftNode, const NodeArray< T > &nodeLength, const NodeArray< EdgeArray< T > > &edgeLength, const NodeArray< T > &thickness, NodeArray< List< adjEntry > > &newOrder, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArraySource, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArrayTarget, const T &delta_u, const T &delta_d, adjEntry &adjExternal, const node &n=nullptr)
static void expandEdgePNode(const StaticSPQRTree &spqrTree, NodeArray< bool > &treeNodeTreated, const node &mu, const node &leftNode, const NodeArray< T > &nodeLength, const NodeArray< EdgeArray< T > > &edgeLength, const NodeArray< T > &thickness, NodeArray< List< adjEntry > > &newOrder, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArraySource, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArrayTarget, const T &delta_u, const T &delta_d, adjEntry &adjExternal)
static bool sssp(const Graph &G, const node &s, const EdgeArray< T > &length, NodeArray< T > &d)
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, const NodeArray< T > &thickness, NodeArray< List< adjEntry > > &newOrder, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArraySource, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArrayTarget, const T &delta_u, const T &delta_d, adjEntry &adjExternal)
static void expandEdgeSNode(const StaticSPQRTree &spqrTree, NodeArray< bool > &treeNodeTreated, const node &mu, const node &leftNode, const NodeArray< T > &nodeLength, const NodeArray< EdgeArray< T > > &edgeLength, const NodeArray< T > &thickness, NodeArray< List< adjEntry > > &newOrder, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArraySource, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArrayTarget, const T &delta_u, const T &delta_d, adjEntry &adjExternal)
static void bottomUpThickness(const StaticSPQRTree &spqrTree, const node &mu, NodeArray< T > &thickness, const NodeArray< T > &nodeLength, const NodeArray< EdgeArray< T > > &edgeLength)
static void expandEdgeRNode(const StaticSPQRTree &spqrTree, NodeArray< bool > &treeNodeTreated, const node &mu, const node &leftNode, const NodeArray< T > &nodeLength, const NodeArray< EdgeArray< T > > &edgeLength, const NodeArray< T > &thickness, NodeArray< List< adjEntry > > &newOrder, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArraySource, NodeArray< ListIterator< adjEntry > > &adjBeforeNodeArrayTarget, const T &delta_u, const T &delta_d, adjEntry &adjExternal, const node &n=nullptr)
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.
Faces in a combinatorial embedding.
Data type for general directed graphs (adjacency list representation).
Doubly linked lists (maintaining the length of the list).
int size() const
Returns the number of elements in the list.
iterator pushBack(const E &x)
Adds element x at the end of the list.
Encapsulates a pointer to a list element.
bool valid() const
Returns true iff the iterator points to an element.
iterator begin()
Returns an iterator to the first element of the list.
const_iterator get(int pos) const
Returns a const iterator pointing to the element at position pos.
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.
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.