|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
61 class ClusterGraphAttributes;
62 class GraphAttributes;
83 using tpc = std::chrono::high_resolution_clock;
84 using tp =
const std::chrono::time_point<std::chrono::high_resolution_clock>;
86 inline int64_t
dur_ms(
const tp::duration& d) {
87 return std::chrono::duration_cast<std::chrono::milliseconds>(d).count();
90 inline int64_t
dur_ns(
const tp::duration& d) {
91 return std::chrono::duration_cast<std::chrono::nanoseconds>(d).count();
129 friend class SyncPlanOptions;
133 friend class UndoContract;
135 friend class UndoConvertSmall;
137 friend class UndoEncapsulate;
139 friend class UndoInitCluster;
141 friend class UndoPropagate;
145 friend class UndoSimplifyToroidal;
147 friend class UndoMakeWheel;
149 friend class EmbeddingTrees;
158 int consistency_nr = -1;
163 virtual void undo(
SyncPlan& pq) = 0;
165 virtual std::ostream&
print(std::ostream& os)
const = 0;
167 virtual std::string name()
const;
180 std::ostream&
print(std::ostream& os)
const override;
191 std::ostream&
print(std::ostream& os)
const override;
195 enum class Result { SUCCESS, NOT_APPLICABLE, INVALID_INSTANCE };
207 #ifdef SYNCPLAN_OPSTATS
208 std::ofstream stats_out;
210 uint64_t stats_pc_time = 0;
211 bool stats_first_in_array =
true;
236 bool indices_saved =
false;
238 bool allow_contract_bb_pipe =
false;
240 bool intersect_trees =
true;
242 bool batch_spqr =
true;
244 int longestSimplifyToroidalCycle = 0;
308 std::vector<std::pair<adjEntry, adjEntry>>* augmentation =
nullptr,
320 while (!undo_stack.empty()) {
330 std::function<std::ostream&(std::ostream&)> fmtPQNode(
node n,
bool include_comp =
true)
const;
332 node nodeFromIndex(
int idx)
const;
334 edge edgeFromIndex(
int idx)
const;
356 void makeWheel(
node centre,
bool update_cuts =
true);
358 void contractWheel(
node centre);
360 Result convertSmall(
node small);
362 Result encapsulate(
node g_cut);
364 Result contract(
node u);
371 Result checkPCTree(
node u);
380 void initComponents();
383 bool makeReduced(
int check_planarity_every = 0);
386 bool solveReduced(
bool fail_fast =
false);
406 #ifdef SYNCPLAN_OPSTATS
410 void printOPStatsEnd(
bool success, int64_t time_ns);
418 bool canContract(
const Pipe* p)
const;
431 allow_contract_bb_pipe = allowContractBbPipe;
The namespace for all OGDF objects.
Stores additional attributes of a graph (like layout information).
bool consistencyCheck(bool force_check_components=false)
Manages the matching of P-nodes via pipes in an instance of SyncPlan.
Includes declaration of graph class.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
void pushUndoOperationAndCheck(UndoOperation *operation)
Result
The result of applying a single operation.
Graph::HiddenEdgeSet deletedEdges
Set of all edge objects deleted during the reduction, to be restored when undoing all operations.
int getCheckCounter() const
Functionality for temporarily hiding edges in constant time.
Manages the partitioning of Q-nodes in an instance of SyncPlan.
Utilities for working with the bijections between the edges incident to the two endpoints of a Pipe.
A PC-tree represents a set of cyclic orders of its leaves by labeling its inner nodes as either P- or...
This class represents the embedding tree of a single node in a biconnected component.
const std::chrono::time_point< std::chrono::high_resolution_clock > tp
Utilities by dumping a drawing of the current state of a SyncPlan instance.
(Bi)Connected components information maintained during the SyncPlan algorithm.
int getLongestSimplifyToroidalCycle() const
Return the longest cycle length encountered in simplify toroidal.
A class for modelling and solving Synchronized Planarity instances.
Declaration and implementation of NodeSet, EdgeSet, and AdjEntrySet classes.
void setAllowContractBBPipe(bool allowContractBbPipe)
Configure whether block-block pipes can be contracted.
A pair of matched vertices of the same degree, whose rotation shall be synchronized.
Contains logging functionality.
const SyncPlanComponents & getComponents() const
The maintained (bi)connected components information.
List< UndoOperation * > undo_stack
Stack of all operations that should be undone when embedding.
Stores additional attributes of a clustered graph (like layout information).
int64_t dur_ns(const tp::duration &d)
void setIntersectTrees(bool intersectTrees)
Configure whether the embedding trees of block-block pipes should be intersected before propagating.
PMatching matchings
Collection of all matched P-nodes and their pipes.
Manages the matching of P-nodes via pipes in an instance of SyncPlan.
int64_t dur_ms(const tp::duration &d)
Operation
The reduction operations (and their distinct cases) implemented by SyncPlan.
std::chrono::high_resolution_clock tpc
Consistency checks for debugging the SyncPlan algorithm.
Doubly linked lists (maintaining the length of the list).
RegisteredArray for nodes, edges and adjEntries of a graph.
std::ostream & operator<<(std::ostream &os, Operation op)
Data type for general directed graphs (adjacency list representation).
SyncPlanComponents components
Data structure maintaining (bi)connected components information.
E popBackRet()
Removes the last element from the list and returns it.
The information needed for undoing the changes a specific operation made to the graph while maintaini...
void pushUndoOperation(UndoOperation *operation)
int sumPNodeDegrees(const ogdf::pc_tree::PCTree &pct)
int undoOperations() const
The number of operations that need undoing.
Basic declarations, included by all source files.
bool isAllowContractBBPipe() const
NodeArray< bool > is_wheel
Labels nodes whether they are already part of a (Q-node-replacement) wheel.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
QPartitioning partitions
Collection of all Q-nodes and their partitions.
void formatNode(node n, GraphAttributes *ga, int group)
Simple util for apply a default style to nodes, including a group-based coloring.
void print(std::ostream &os, const Array< E, INDEX > &a, char delim=' ')
Prints array a to output stream os using delimiter delim.
Class for the representation of edges.
List< std::tuple< int, int, FrozenPipeBij > > pipes
Declaration of doubly linked lists and iterators.
NodeArray< node > node_reg
A mapping of node-index to node-object used while undoing operations.
Consistency checks for debugging the SyncPlan algorithm.
int size() const
Returns the number of elements in the list.
void setBatchSpqr(bool batchSpqr)
Configure whether embedding trees should be computed in batch by deriving them from an SPQR-tree.
(Bi)Connected components information maintained during the SyncPlan algorithm.
Centralized global and local logging facility working on streams like std::cout.
Graph *const G
The underlying graph.
Manages the partitioning of Q-nodes in an instance of SyncPlan.
bool isIntersectTrees() const
Representation of clustered graphs.
Class for the representation of nodes.
iterator pushBack(const E &x)
Adds element x at the end of the list.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Logger log
The logger to use.
EdgeArray< edge > edge_reg
A mapping of edge-index to edge-object used while undoing operations.