|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
60 class ClusterGraphAttributes;
61 class GraphAttributes;
82 using tpc = std::chrono::high_resolution_clock;
83 using tp =
const std::chrono::time_point<std::chrono::high_resolution_clock>;
85 inline int64_t
dur_ms(
const tp::duration& d) {
86 return std::chrono::duration_cast<std::chrono::milliseconds>(d).count();
89 inline int64_t
dur_ns(
const tp::duration& d) {
90 return std::chrono::duration_cast<std::chrono::nanoseconds>(d).count();
128 friend class SyncPlanOptions;
132 friend class UndoContract;
134 friend class UndoConvertSmall;
136 friend class UndoEncapsulate;
138 friend class UndoInitCluster;
140 friend class UndoPropagate;
144 friend class UndoSimplifyToroidal;
146 friend class UndoMakeWheel;
148 friend class EmbeddingTrees;
157 int consistency_nr = -1;
162 virtual void undo(
SyncPlan& pq) = 0;
164 virtual std::ostream&
print(std::ostream& os)
const = 0;
166 virtual std::string name()
const;
179 std::ostream&
print(std::ostream& os)
const override;
190 std::ostream&
print(std::ostream& os)
const override;
194 enum class Result { SUCCESS, NOT_APPLICABLE, INVALID_INSTANCE };
206 #ifdef SYNCPLAN_OPSTATS
207 std::ofstream stats_out;
209 uint64_t stats_pc_time = 0;
210 bool stats_first_in_array =
true;
235 bool indices_saved =
false;
237 bool allow_contract_bb_pipe =
false;
239 bool intersect_trees =
true;
241 bool batch_spqr =
true;
243 int longestSimplifyToroidalCycle = 0;
307 std::vector<std::pair<adjEntry, adjEntry>>* augmentation =
nullptr,
319 while (!undo_stack.empty()) {
329 std::function<std::ostream&(std::ostream&)> fmtPQNode(
node n,
bool include_comp =
true)
const;
331 node nodeFromIndex(
int idx)
const;
333 edge edgeFromIndex(
int idx)
const;
355 void makeWheel(
node centre,
bool update_cuts =
true);
357 void contractWheel(
node centre);
359 Result convertSmall(
node small);
361 Result encapsulate(
node g_cut);
363 Result contract(
node u);
370 Result checkPCTree(
node u);
379 void initComponents();
382 bool makeReduced(
int check_planarity_every = 0);
385 bool solveReduced(
bool fail_fast =
false);
405 #ifdef SYNCPLAN_OPSTATS
409 void printOPStatsEnd(
bool success, int64_t time_ns);
417 bool canContract(
const Pipe* p)
const;
430 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.