Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Simplify.h
Go to the documentation of this file.
1 
31 #pragma once
32 
33 #include <ogdf/basic/Graph.h>
34 #include <ogdf/basic/List.h>
35 #include <ogdf/basic/Logger.h>
36 #include <ogdf/basic/SList.h>
38 
39 #include <functional>
40 #include <iosfwd>
41 
42 namespace ogdf::pc_tree {
43 class NodePCRotation;
44 } // namespace ogdf::pc_tree
45 
46 namespace ogdf {
47 template<bool>
48 class EdgeSet;
49 } // namespace ogdf
50 
51 namespace ogdf::sync_plan {
52 
53 class SyncPlanComponents;
54 
55 namespace internal {
56 
60 
61  explicit SimplifyMapping(adjEntry u2Adj = nullptr, adjEntry uAdj = nullptr,
62  adjEntry vAdj = nullptr, adjEntry v2Adj = nullptr);
63 
64  friend std::ostream& operator<<(std::ostream& os, const SimplifyMapping& mapping);
65 };
66 
70 
71  explicit FrozenSimplifyMapping(int u2Adj = -1, int uAdj = -1, int vAdj = -1, int v2Adj = -1);
72 
73  friend std::ostream& operator<<(std::ostream& os, const FrozenSimplifyMapping& mapping);
74 };
75 
79 
80 public:
81  UndoSimplify(const List<SimplifyMapping>& in_bij, node u2, node u, node v, node v2 = nullptr);
82 
83  void undo(SyncPlan& pq) override;
84 
85  std::ostream& print(std::ostream& os) const override;
86 };
87 
92 int findCycles(Graph& G, node u, const std::function<adjEntry(adjEntry)>& mapping,
93  List<List<adjEntry>>& cycles, std::ostream& log);
94 
106 adjEntry continueNodeDFS(Graph& G, adjEntry u_adj, node v, EdgeSet<>& visited,
107  List<adjEntry>& dfs_stack);
108 
118 adjEntry startNodeDFS(Graph& G, adjEntry u_adj, node v, EdgeSet<>& visited,
119  List<adjEntry>& dfs_stack);
120 
127 int exhaustiveNodeDFS(Graph& G, adjEntry u_adj, node v, EdgeSet<>& visited, List<adjEntry>& out);
128 
129 #ifdef OGDF_DEBUG
130 
134 bool compareWithExhaustiveNodeDFS(Graph& G, adjEntry u_adj, node v, const EdgeSet<>& visited,
135  const List<adjEntry>& found);
136 
141 void validatePartnerPCTree(const NodePCRotation* u_pc, const NodePCRotation* v_pc);
142 
146 bool validateCollectedAdjs(node v, node u, List<SimplifyMapping>& bij_list, EdgeSet<>& visited,
147  SyncPlanComponents& components);
148 
149 #endif
150 
151 }
152 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::sync_plan::internal::UndoSimplify::v2_idx
int v2_idx
Definition: Simplify.h:77
Graph.h
Includes declaration of graph class.
ogdf::sync_plan::internal::SimplifyMapping::v_adj
List< adjEntry > v_adj
Definition: Simplify.h:59
ogdf::sync_plan::internal::UndoSimplify::bij
SList< FrozenSimplifyMapping > bij
Definition: Simplify.h:78
ogdf::sync_plan
Definition: clustering.h:44
ogdf::sync_plan::internal::continueNodeDFS
adjEntry continueNodeDFS(Graph &G, adjEntry u_adj, node v, EdgeSet<> &visited, List< adjEntry > &dfs_stack)
Continue a DFS from the last node of dfs_stack until an unvisited edge incident to v is found.
ogdf::sync_plan::internal::UndoSimplify::undo
void undo(SyncPlan &pq) override
ogdf::sync_plan::internal::SimplifyMapping::SimplifyMapping
SimplifyMapping(adjEntry u2Adj=nullptr, adjEntry uAdj=nullptr, adjEntry vAdj=nullptr, adjEntry v2Adj=nullptr)
ogdf::pc_tree
Definition: NodePCRotation.h:37
ogdf::sync_plan::internal::FrozenSimplifyMapping
Definition: Simplify.h:67
ogdf::SList
Singly linked lists (maintaining the length of the list).
Definition: SList.h:833
ogdf::sync_plan::internal::UndoSimplify::u_idx
int u_idx
Definition: Simplify.h:77
ogdf::pc_tree::NodePCRotation
This class represents the embedding tree of a single node in a biconnected component.
Definition: NodePCRotation.h:44
ogdf::sync_plan::internal::SimplifyMapping::u_adj
adjEntry u_adj
Definition: Simplify.h:58
ogdf::sync_plan::internal::UndoSimplify::UndoSimplify
UndoSimplify(const List< SimplifyMapping > &in_bij, node u2, node u, node v, node v2=nullptr)
ogdf::sync_plan::internal::FrozenSimplifyMapping::v_adj
List< int > v_adj
Definition: Simplify.h:69
ogdf::sync_plan::SyncPlan
A class for modelling and solving Synchronized Planarity instances.
Definition: SyncPlan.h:123
ogdf::sync_plan::internal::validateCollectedAdjs
bool validateCollectedAdjs(node v, node u, List< SimplifyMapping > &bij_list, EdgeSet<> &visited, SyncPlanComponents &components)
Check that /p bij_list contains all adjEntries of v which belong to a parallel bundle leading to u.
ogdf::sync_plan::internal::FrozenSimplifyMapping::v2_adj
int v2_adj
Definition: Simplify.h:68
ogdf::adjEntry
AdjElement * adjEntry
The type of adjacency entries.
Definition: Graph_d.h:71
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:135
Logger.h
Contains logging functionality.
ogdf::sync_plan::internal::exhaustiveNodeDFS
int exhaustiveNodeDFS(Graph &G, adjEntry u_adj, node v, EdgeSet<> &visited, List< adjEntry > &out)
Use a DFS to find all edges incident to v reachable from u_adj without crossing the node u and add th...
ogdf::sync_plan::internal::FrozenSimplifyMapping::operator<<
friend std::ostream & operator<<(std::ostream &os, const FrozenSimplifyMapping &mapping)
SList.h
Declaration of singly linked lists and iterators.
ogdf::EdgeSet
Edge sets.
Definition: Graph_d.h:748
ogdf::sync_plan::internal::FrozenSimplifyMapping::FrozenSimplifyMapping
FrozenSimplifyMapping(int u2Adj=-1, int uAdj=-1, int vAdj=-1, int v2Adj=-1)
ogdf::sync_plan::internal::UndoSimplify::v_idx
int v_idx
Definition: Simplify.h:77
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:42
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::sync_plan::internal::FrozenSimplifyMapping::u_adj
int u_adj
Definition: Simplify.h:68
ogdf::sync_plan::SyncPlan::UndoOperation
The information needed for undoing the changes a specific operation made to the graph while maintaini...
Definition: SyncPlan.h:154
ogdf::sync_plan::internal::validatePartnerPCTree
void validatePartnerPCTree(const NodePCRotation *u_pc, const NodePCRotation *v_pc)
For two poles u,v of an (SPQR-Tree) parallel, check that their embedding PCTrees correctly represent ...
ogdf::sync_plan::internal::SimplifyMapping::v2_adj
adjEntry v2_adj
Definition: Simplify.h:58
ogdf::sync_plan::internal::SimplifyMapping::operator<<
friend std::ostream & operator<<(std::ostream &os, const SimplifyMapping &mapping)
List.h
Declaration of doubly linked lists and iterators.
ogdf::sync_plan::internal::UndoSimplify::print
std::ostream & print(std::ostream &os) const override
ogdf::sync_plan::internal::compareWithExhaustiveNodeDFS
bool compareWithExhaustiveNodeDFS(Graph &G, adjEntry u_adj, node v, const EdgeSet<> &visited, const List< adjEntry > &found)
Check that the method exhaustiveNodeDFS would return the same adjEntries as contained in found.
ogdf::sync_plan::internal::startNodeDFS
adjEntry startNodeDFS(Graph &G, adjEntry u_adj, node v, EdgeSet<> &visited, List< adjEntry > &dfs_stack)
Use a DFS to find an edge incident to v reachable from u_adj without crossing the node u.
ogdf::sync_plan::SyncPlanComponents
(Bi)Connected components information maintained during the SyncPlan algorithm.
Definition: SyncPlanComponents.h:57
ogdf::sync_plan::internal::UndoSimplify
Definition: Simplify.h:76
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::sync_plan::internal::findCycles
int findCycles(Graph &G, node u, const std::function< adjEntry(adjEntry)> &mapping, List< List< adjEntry >> &cycles, std::ostream &log)
Find all cycles the permutation mapping defines on the order of the adjEntries of u and put all adjEn...
ogdf::sync_plan::internal::FrozenSimplifyMapping::u2_adj
int u2_adj
Definition: Simplify.h:68
ogdf::sync_plan::internal::UndoSimplify::u2_idx
int u2_idx
Definition: Simplify.h:77
ogdf::sync_plan::internal::SimplifyMapping
Definition: Simplify.h:57
SyncPlan.h
The main code for modelling and solving Synchronized Planarity instances.
ogdf::sync_plan::internal::SimplifyMapping::u2_adj
adjEntry u2_adj
Definition: Simplify.h:58