Combinatorial embeddings of planar graphs with modification functionality. More...
#include <ogdf/basic/CombinatorialEmbedding.h>
Inheritance diagram for ogdf::CombinatorialEmbedding:Public Member Functions | |
| CombinatorialEmbedding () | |
| Creates a combinatorial embedding associated with no graph. More... | |
| CombinatorialEmbedding (Graph &G) | |
Creates a combinatorial embedding of graph G. More... | |
Access to the associated graph | |
| const Graph & | getGraph () const |
| Returns the associated graph. More... | |
| Graph & | getGraph () |
| operator const Graph & () const | |
| operator Graph & () | |
Initialization | |
| void | init (Graph &G) |
Initializes the embedding for graph G. More... | |
| void | clear () |
| Removes all nodes, edges, and faces from the graph and the embedding. More... | |
Update of embedding | |
| edge | split (edge e) |
Splits edge e=(v,w) into e=(v,u) and e'=(u,w) creating a new node u. More... | |
| void | unsplit (edge eIn, edge eOut) |
| Undoes a split operation. More... | |
| node | splitNode (adjEntry adjStartLeft, adjEntry adjStartRight) |
| Splits a node while preserving the order of adjacency entries. More... | |
| node | contract (edge e) |
Contracts edge e. More... | |
| edge | splitFace (adjEntry adjSrc, adjEntry adjTgt) |
| Splits a face by inserting a new edge. More... | |
| edge | addEdgeToIsolatedNode (node v, adjEntry adjTgt) |
| Inserts a new edge similarly to splitFace without having to call computeFaces again. More... | |
| edge | addEdgeToIsolatedNode (adjEntry adjSrc, node v) |
| Inserts a new edge similarly to splitFace without having to call computeFaces again. More... | |
| face | joinFaces (edge e) |
Removes edge e and joins the two faces adjacent to e. More... | |
| void | reverseEdge (edge e) |
Reverses edges e and updates embedding. More... | |
| void | moveBridge (adjEntry adjBridge, adjEntry adjBefore) |
| Moves a bridge in the graph. More... | |
| void | removeDeg1 (node v) |
Removes degree-1 node v. More... | |
| void | updateMerger (edge e, face fRight, face fLeft) |
| Update face information after inserting a merger in a copy graph. More... | |
Public Member Functions inherited from ogdf::ConstCombinatorialEmbedding | |
| ConstCombinatorialEmbedding () | |
| Creates a combinatorial embedding associated with no graph. More... | |
| ConstCombinatorialEmbedding (const Graph &G) | |
Creates a combinatorial embedding of graph G. More... | |
| ConstCombinatorialEmbedding (const ConstCombinatorialEmbedding &C) | |
| Copy constructor. More... | |
| ConstCombinatorialEmbedding & | operator= (const ConstCombinatorialEmbedding &C) |
| Assignment operator. More... | |
| virtual | ~ConstCombinatorialEmbedding () |
| Destructor. More... | |
| bool | valid () const |
| Returns whether the embedding is associated with a graph. More... | |
| const Graph & | getGraph () const |
| Returns the associated graph of the combinatorial embedding. More... | |
| operator const Graph & () const | |
| Returns associated graph. More... | |
| face | firstFace () const |
| Returns the first face in the list of all faces. More... | |
| face | lastFace () const |
| Returns the last face in the list of all faces. More... | |
| int | numberOfFaces () const |
| Returns the number of faces. More... | |
| face | rightFace (adjEntry adj) const |
Returns the face to the right of adj, i.e., the face containing adj. More... | |
| face | leftFace (adjEntry adj) const |
Returns the face to the left of adj, i.e., the face containing the twin of adj. More... | |
| int | maxFaceIndex () const |
| Returns the largest used face index. More... | |
| int | faceArrayTableSize () const |
| Returns the table size of face arrays associated with this embedding. More... | |
| face | chooseFace (std::function< bool(face)> includeFace=[](face) { return true;}, bool isFastTest=true) const |
| Returns a random face. More... | |
| face | maximalFace () const |
| Returns a face of maximal size. More... | |
| face | externalFace () const |
| Returns the external face. More... | |
| void | setExternalFace (face f) |
Sets the external face to f. More... | |
| bool | isBridge (edge e) const |
| void | init (const Graph &G) |
Initializes the embedding for graph G. More... | |
| void | init () |
| void | computeFaces () |
| Computes the list of faces. More... | |
| bool | consistencyCheck () |
| Checks the consistency of the data structure. More... | |
| ListIterator< FaceArrayBase * > | registerArray (FaceArrayBase *pFaceArray) const |
Registers the face array pFaceArray. More... | |
| void | unregisterArray (ListIterator< FaceArrayBase *> it) const |
Unregisters the face array identified by it. More... | |
| void | moveRegisterArray (ListIterator< FaceArrayBase *> it, FaceArrayBase *pFaceArray) const |
Move the registration it of a node array to pFaceArray (used with move semantics for face arrays). More... | |
| adjEntry | findCommonFace (const node v, const node w, bool left=true) const |
| Identifies a common face of two nodes and returns the respective adjacency entry. More... | |
| adjEntry | findCommonFace (const node v, const node w, adjEntry &adjW, bool left=true) const |
| Identifies a common face of two nodes and returns the respective adjacency entry. More... | |
Protected Member Functions | |
| face | joinFacesPure (edge e) |
Joins the two faces adjacent to e but does not remove edge e. More... | |
Protected Member Functions inherited from ogdf::ConstCombinatorialEmbedding | |
| face | createFaceElement (adjEntry adjFirst) |
| Create a new face. More... | |
| void | reinitArrays () |
| Reinitialize associated face arrays. More... | |
Private Member Functions | |
| CombinatorialEmbedding (const CombinatorialEmbedding &)=delete | |
| edge | addEdgeToIsolatedNode (adjEntry adj, node v, bool adjSrc) |
| Inserts a new edge similarly to splitFace without having to call computeFaces again. More... | |
| CombinatorialEmbedding & | operator= (const CombinatorialEmbedding &)=delete |
Private Attributes | |
| Graph * | m_pGraph |
| The associated graph. More... | |
Friends | |
| class | GraphCopy |
Additional Inherited Members | |
Public Types inherited from ogdf::ConstCombinatorialEmbedding | |
| using | face_iterator = internal::GraphIterator< face > |
| Provides a bidirectional iterator to a face in a combinatorial embedding. More... | |
Public Attributes inherited from ogdf::ConstCombinatorialEmbedding | |
| internal::GraphObjectContainer< FaceElement > | faces |
| The container containing all face objects. More... | |
Protected Attributes inherited from ogdf::ConstCombinatorialEmbedding | |
| const Graph * | m_cpGraph |
| The associated graph. More... | |
| face | m_externalFace |
| int | m_faceArrayTableSize |
| The current table size of face arrays. More... | |
| int | m_faceIdCount |
| The index assigned to the next created face. More... | |
| std::mutex | m_mutexRegArrays |
| The critical section for protecting shared acces to register/unregister methods. More... | |
| ListPure< FaceArrayBase * > | m_regFaceArrays |
| The external face. More... | |
| AdjEntryArray< face > | m_rightFace |
| The face to which an adjacency entry belongs. More... | |
Combinatorial embeddings of planar graphs with modification functionality.
Maintains a combinatorial embedding of an embedded graph, i.e., the set of faces, and provides method for modifying the embedding, e.g., by inserting edges.
The class Graph allows shared access of threads to const methods only. If one thread executes a non-const method, shared access is no longer thread-safe.
Definition at line 412 of file CombinatorialEmbedding.h.
|
privatedelete |
|
inline |
Creates a combinatorial embedding associated with no graph.
Definition at line 428 of file CombinatorialEmbedding.h.
|
inlineexplicit |
Creates a combinatorial embedding of graph G.
G must be embedded, i.e., the adjacency lists of its nodes must define an embedding. Definition at line 438 of file CombinatorialEmbedding.h.
Inserts a new edge similarly to splitFace without having to call computeFaces again.
Creates a new edge from the degree 0 node v to the node of adjTgt. The face that adjTgt belongs to is split.
Inserts a new edge similarly to splitFace without having to call computeFaces again.
Creates a new edge from the node of adjSrc to the degree 0 node v. The face that adjSrc belongs to is split.
|
private |
Inserts a new edge similarly to splitFace without having to call computeFaces again.
| adj | The adjacency entry belonging to the face that we want to insert the new edge into |
| v | The degree 0 node. |
| adjSrc | whether v will be the target node. |
| void ogdf::CombinatorialEmbedding::clear | ( | ) |
Removes all nodes, edges, and faces from the graph and the embedding.
Contracts edge e.
| e | is an edge is the associated graph. |
|
inline |
Returns the associated graph.
Definition at line 449 of file CombinatorialEmbedding.h.
|
inline |
Definition at line 455 of file CombinatorialEmbedding.h.
|
inline |
Initializes the embedding for graph G.
G must be embedded, i.e., the adjacency lists of its nodes must define an embedding. Definition at line 478 of file CombinatorialEmbedding.h.
Removes edge e and joins the two faces adjacent to e.
| e | is an edge in the associated graph. |
Joins the two faces adjacent to e but does not remove edge e.
| e | is an edge in the associated graph. |
Moves a bridge in the graph.
|
inline |
Definition at line 461 of file CombinatorialEmbedding.h.
|
inline |
Definition at line 463 of file CombinatorialEmbedding.h.
|
privatedelete |
| void ogdf::CombinatorialEmbedding::removeDeg1 | ( | node | v | ) |
Removes degree-1 node v.
| void ogdf::CombinatorialEmbedding::reverseEdge | ( | edge | e | ) |
Reverses edges e and updates embedding.
Splits edge e=(v,w) into e=(v,u) and e'=(u,w) creating a new node u.
| e | is the edge to be split; e is modified by the split. |
Splits a face by inserting a new edge.
Creates a new edge from the node of adjSrc to the one of adjTgt. Note that this can also be achieved by inserting an edge in the underlying graph directly and calling computeFaces again. In contrast, this operation achieves constant running time.
adjSrc and adjTgt are distinct AdjEntries, belonging to the same face. Splits a node while preserving the order of adjacency entries.
This method splits a node v into two nodes vl and vr. Node vl receives all adjacent edges of v from adjStartLeft until the edge preceding adjStartRight, and vr the remaining nodes (thus adjStartRight is the first edge that goes to vr). The order of adjacency entries is preserved. Additionally, a new edge (vl,vr) is created, such that this edge is inserted before adjStartLeft and adjStartRight in the the adjacency lists of vl and vr.
Node v is modified to become node vl, and node vr is returned.
| adjStartLeft | is the first entry that goes to the left node. |
| adjStartRight | is the first entry that goes to the right node. |
Undoes a split operation.
| eIn | is the edge (v,u). |
| eOut | is the edge (u,w). |
Update face information after inserting a merger in a copy graph.
|
friend |
Definition at line 414 of file CombinatorialEmbedding.h.
|
private |
The associated graph.
Definition at line 416 of file CombinatorialEmbedding.h.