|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
18 using namespace pc_tree;
22 std::vector<PCNode*> leaves;
34 tree.makeConsecutive({leaves.at(3), leaves.at(4), leaves.at(5)});
40 tree.makeConsecutive({leaves.at(4), leaves.at(5)});
43 tree.makeConsecutive({leaves.at(0), leaves.at(1)});
46 tree.makeConsecutive({leaves.at(1), leaves.at(2)});
49 tree.makeConsecutive({leaves.at(2), leaves.at(3), leaves.at(4), leaves.at(5)});
53 OGDF_ASSERT(
tree.makeConsecutive({leaves.at(2), leaves.at(0)}) ==
false);
58 std::vector<PCNode*> currentLeafOrder =
59 tree.currentLeafOrder();
64 auto innerNode_it =
tree.innerNodes();
65 std::vector<PCNode*> innerNodes {innerNode_it.begin(), innerNode_it.end()};
74 std::cout << n->index() <<
" ";
76 std::cout << std::endl;
82 tree.getTree(G, &GA, pc_repr);
89 PCTree from_string {
"9:[6, 8:[7:[5, 4], 3], 2, 1, 0]",
true};
91 OGDF_ASSERT(from_string.possibleOrders<
int>() ==
tree.possibleOrders<
int>());
104 std::stringstream ss;
106 OGDF_ASSERT(ss.str() ==
"0:[11, 10, 9, 5:(8, 7, 6), 4, 3, 2, 1:(14, 13, 12)]");
The namespace for all OGDF objects.
Stores additional attributes of a graph (like layout information).
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Dynamic arrays indexed with arbitrary keys.
Includes declaration of graph class.
void nodeToPosition(std::ostream &os, PCNode *n, int pos)
Print the position pos of a node n.
static bool write(const Graph &G, const string &filename, WriterFunc writer=nullptr)
Writes graph G to a file with name filename and infers the format to use from the file's extension.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
A PC-tree represents a set of cyclic orders of its leaves by labeling its inner nodes as either P- or...
PCNode * getChild1() const
void insertLeaves(int count, PCNode *parent, std::vector< PCNode * > *added=nullptr)
Attach count leaves to P- or C-node parent and optionally store the new leaves in a vector added.
size_t getChildCount() const
Declaration of linear time layout algorithm for free trees (class RadialTreeLayout).
virtual void call(GraphAttributes &GA) override
Calls the algorithm for graph attributes GA.
Declares class GraphIO which provides access to all graph read and write functionality.
int factorial(int n)
Returns n!.
A registry that allows labelling the nodes of a PC-tree.
@ Source
Select a source in the graph.
Data type for general directed graphs (adjacency list representation).
The radial tree layout algorithm.
@ tree
for every hyperedge e a minimal subcubic tree connecting all hypernodes incident with e together is a...
Predeclaration of various PC-tree related classes and enums.
Utils for PCTree::allNodes(), PCTree::innerNodes(), PCNode::children() and PCNode::neighbors().
PCNode * newNode(PCNodeType type, PCNode *parent=nullptr, int id=-1)
Create a new node.
A node in a PC-tree that is either a P-node, C-node or leaf.
A node in a PC-tree that is either a P-node, C-node or leaf.
PCNodeChildrenIterable children()
Basic declarations, included by all source files.
RootSelectionType rootSelection() const
Returns the option rootSelection.
The main class of the PC-tree.