Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

simple_graph_alg.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Array.h>
35 #include <ogdf/basic/ArrayBuffer.h>
36 #include <ogdf/basic/Graph.h>
37 #include <ogdf/basic/GraphList.h>
38 #include <ogdf/basic/List.h>
39 #include <ogdf/basic/SList.h>
40 #include <ogdf/basic/basic.h>
43 #include <ogdf/basic/tuples.h>
44 
45 #include <functional>
46 
47 namespace ogdf {
48 
51 
57 OGDF_EXPORT void removeSelfLoops(Graph& graph, node v);
58 
60 
66 OGDF_EXPORT bool isLoopFree(const Graph& G);
67 
69 
76 template<class NODELIST>
77 void makeLoopFree(Graph& G, NODELIST& L) {
78  L.clear();
79 
80  safeForEach(G.edges, [&](edge e) {
81  if (e->isSelfLoop()) {
82  L.pushBack(e->source());
83  G.delEdge(e);
84  }
85  });
86 }
87 
90 OGDF_EXPORT bool hasNonSelfLoopEdges(const Graph& G);
91 
93 
98 OGDF_EXPORT void makeLoopFree(Graph& G);
99 
100 
104 
106 
112 OGDF_EXPORT void parallelFreeSort(const Graph& G, SListPure<edge>& edges);
113 
114 
116 
126 OGDF_EXPORT bool isParallelFree(const Graph& G);
127 
129 
142 template<bool ONLY_ONCE = false>
143 int numParallelEdges(const Graph& G) {
144  if (G.numberOfEdges() <= 1) {
145  return 0;
146  }
147 
148  SListPure<edge> edges;
149  parallelFreeSort(G, edges);
150 
151  int num = 0;
152  SListConstIterator<edge> it = edges.begin();
153  edge ePrev = *it, e;
154  for (it = ++it; it.valid(); ++it, ePrev = e) {
155  e = *it;
156  if (ePrev->isParallelDirected(e)) {
157  ++num;
158  if (ONLY_ONCE) {
159  return num;
160  }
161  }
162  }
163 
164  return num;
165 }
166 
168 
180 template<class EDGELIST>
181 void makeParallelFree(Graph& G, EDGELIST& parallelEdges) {
182  parallelEdges.clear();
183  if (G.numberOfEdges() <= 1) {
184  return;
185  }
186 
187  SListPure<edge> edges;
188  parallelFreeSort(G, edges);
189 
190  SListConstIterator<edge> it = edges.begin();
191  edge ePrev = *it++, e;
192  bool bAppend = true;
193  while (it.valid()) {
194  e = *it++;
195  if (e->isParallelDirected(ePrev)) {
196  G.delEdge(e);
197  if (bAppend) {
198  parallelEdges.pushBack(ePrev);
199  bAppend = false;
200  }
201  } else {
202  ePrev = e;
203  bAppend = true;
204  }
205  }
206 }
207 
209 
218 inline void makeParallelFree(Graph& G) {
219  List<edge> parallelEdges;
220  makeParallelFree(G, parallelEdges);
221 }
222 
224 
235 OGDF_EXPORT void parallelFreeSortUndirected(const Graph& G, SListPure<edge>& edges,
236  EdgeArray<int>& minIndex, EdgeArray<int>& maxIndex);
237 
238 
240 
249 OGDF_EXPORT bool isParallelFreeUndirected(const Graph& G);
250 
252 
264 template<bool ONLY_ONCE = false>
266  if (G.numberOfEdges() <= 1) {
267  return 0;
268  }
269 
270  SListPure<edge> edges;
271  EdgeArray<int> minIndex(G), maxIndex(G);
272  parallelFreeSortUndirected(G, edges, minIndex, maxIndex);
273 
274  int num = 0;
275  SListConstIterator<edge> it = edges.begin();
276  edge ePrev = *it, e;
277  for (it = ++it; it.valid(); ++it, ePrev = e) {
278  e = *it;
279  if (minIndex[ePrev] == minIndex[e] && maxIndex[ePrev] == maxIndex[e]) {
280  ++num;
281  if (ONLY_ONCE) {
282  return num;
283  }
284  }
285  }
286 
287  return num;
288 }
289 
291 
302 template<class EDGELIST>
303 void getParallelFreeUndirected(const Graph& G, EdgeArray<EDGELIST>& parallelEdges) {
304  if (G.numberOfEdges() <= 1) {
305  return;
306  }
307 
308  SListPure<edge> edges;
309  EdgeArray<int> minIndex(G), maxIndex(G);
310  parallelFreeSortUndirected(G, edges, minIndex, maxIndex);
311 
312  SListConstIterator<edge> it = edges.begin();
313  edge ePrev = *it++, e;
314  while (it.valid()) {
315  e = *it++;
316  if (minIndex[ePrev] == minIndex[e] && maxIndex[ePrev] == maxIndex[e]) {
317  parallelEdges[ePrev].pushBack(e);
318  } else {
319  ePrev = e;
320  }
321  }
322 }
323 
325 
342 template<class EDGELIST = SListPure<edge>>
343 void makeParallelFreeUndirected(Graph& G, EDGELIST* parallelEdges = nullptr,
344  EdgeArray<int>* cardPositive = nullptr, EdgeArray<int>* cardNegative = nullptr) {
345  if (parallelEdges != nullptr) {
346  parallelEdges->clear();
347  }
348  if (cardPositive != nullptr) {
349  cardPositive->fill(0);
350  }
351  if (cardNegative != nullptr) {
352  cardNegative->fill(0);
353  }
354 
355  if (G.numberOfEdges() <= 1) {
356  return;
357  }
358 
359  EdgeArray<SListPure<edge>> parEdges(G);
360  getParallelFreeUndirected(G, parEdges);
361 
362  for (edge e : G.edges) {
363  for (edge parEdge : parEdges(e)) {
364  if (cardPositive != nullptr && e->source() == parEdge->source()) {
365  (*cardPositive)[e]++;
366  }
367  if (cardNegative != nullptr && e->source() == parEdge->target()) {
368  (*cardNegative)[e]++;
369  }
370  G.delEdge(parEdge);
371  if (parallelEdges != nullptr) {
372  parallelEdges->pushBack(e);
373  }
374  }
375  }
376 }
377 
378 template<class EDGELIST>
379 OGDF_DEPRECATED("The pointer-based makeParallelFreeUndirected() should be used instead.")
380 void makeParallelFreeUndirected(Graph& G, EDGELIST& parallelEdges) {
381  makeParallelFreeUndirected(G, &parallelEdges);
382 }
383 
384 template<class EDGELIST>
385 OGDF_DEPRECATED("The pointer-based makeParallelFreeUndirected() should be used instead.")
386 void makeParallelFreeUndirected(Graph& G, EDGELIST& parallelEdges, EdgeArray<int>& cardPositive,
387  EdgeArray<int>& cardNegative) {
388  makeParallelFreeUndirected(G, &parallelEdges, &cardPositive, &cardNegative);
389 }
390 
394 
396 
402 inline bool isSimple(const Graph& G) { return isLoopFree(G) && isParallelFree(G); }
403 
405 
410 inline void makeSimple(Graph& G) {
411  makeLoopFree(G);
412  makeParallelFree(G);
413 }
414 
416 
423 inline bool isSimpleUndirected(const Graph& G) {
424  return isLoopFree(G) && isParallelFreeUndirected(G);
425 }
426 
428 
433 inline void makeSimpleUndirected(Graph& G) {
434  makeLoopFree(G);
436 }
437 
441 
443 
449 OGDF_EXPORT bool isConnected(const Graph& G);
450 
451 
453 
459 OGDF_EXPORT void makeConnected(Graph& G, List<edge>& added);
460 
462 
467 inline void makeConnected(Graph& G) {
468  List<edge> added;
469  makeConnected(G, added);
470 }
471 
474 
487 OGDF_EXPORT int connectedComponents(const Graph& G, NodeArray<int>& component,
488  List<node>* isolated = nullptr, ArrayBuffer<node>* reprs = nullptr);
489 
491 
497 inline int connectedComponents(const Graph& G) {
498  NodeArray<int> component(G);
499  return connectedComponents(G, component);
500 }
501 
502 
503 OGDF_DEPRECATED("connectedComponents() should be used instead.")
504 
505 
508 inline int connectedIsolatedComponents(const Graph& G, List<node>& isolated,
509  NodeArray<int>& component) {
510  return connectedComponents(G, component, &isolated);
511 }
512 
518 OGDF_EXPORT bool findCutVertices(const Graph& G, ArrayBuffer<node>& cutVertices,
519  ArrayBuffer<Tuple2<node, node>>& addEdges, bool onlyOne = false);
520 
523 
534 inline bool findCutVertices(const Graph& G, ArrayBuffer<node>& cutVertices, bool onlyOne = false) {
536  return findCutVertices(G, cutVertices, addEdges, onlyOne);
537 }
538 
540 
547 OGDF_EXPORT bool isBiconnected(const Graph& G, node& cutVertex);
548 
550 
555 inline bool isBiconnected(const Graph& G) {
556  node cutVertex;
557  return isBiconnected(G, cutVertex);
558 }
559 
561 
567 OGDF_EXPORT void makeBiconnected(Graph& G, List<edge>& added);
568 
570 
575 inline void makeBiconnected(Graph& G) {
576  List<edge> added;
577  makeBiconnected(G, added);
578 }
579 
586 OGDF_EXPORT int biconnectedComponents(const Graph& G, EdgeArray<int>& component,
587  int& nonEmptyComponents);
588 
590 
603 inline int biconnectedComponents(const Graph& G, EdgeArray<int>& component) {
604  int doNotNeedTheValue;
605  return biconnectedComponents(G, component, doNotNeedTheValue);
606 }
607 
613 OGDF_EXPORT bool isTwoEdgeConnected(const Graph& graph, edge& bridge);
614 
628 inline bool isTwoEdgeConnected(const Graph& graph) {
629  edge bridge;
630  return isTwoEdgeConnected(graph, bridge);
631 }
632 
634 
647 OGDF_EXPORT bool isTriconnected(const Graph& G, node& s1, node& s2);
648 
650 
656 inline bool isTriconnected(const Graph& G) {
657  node s1, s2;
658  return isTriconnected(G, s1, s2);
659 }
660 
662 
678 OGDF_EXPORT bool isTriconnectedPrimitive(const Graph& G, node& s1, node& s2);
679 
681 
690 inline bool isTriconnectedPrimitive(const Graph& G) {
691  node s1, s2;
692  return isTriconnectedPrimitive(G, s1, s2);
693 }
694 
696 
706 OGDF_EXPORT void triangulate(Graph& G);
707 
708 
712 
714 
721 OGDF_EXPORT bool isAcyclic(const Graph& G, List<edge>& backedges);
722 
724 
730 inline bool isAcyclic(const Graph& G) {
731  List<edge> backedges;
732  return isAcyclic(G, backedges);
733 }
734 
736 
743 OGDF_EXPORT bool isAcyclicUndirected(const Graph& G, List<edge>& backedges);
744 
746 
752 inline bool isAcyclicUndirected(const Graph& G) {
753  List<edge> backedges;
754  return isAcyclicUndirected(G, backedges);
755 }
756 
758 
765 OGDF_EXPORT void makeAcyclic(Graph& G);
766 
767 
769 
776 OGDF_EXPORT void makeAcyclicByReverse(Graph& G);
777 
778 
780 
787 OGDF_EXPORT bool hasSingleSource(const Graph& G, node& source);
788 
790 
796 inline bool hasSingleSource(const Graph& G) {
797  node source;
798  return hasSingleSource(G, source);
799 }
800 
802 
809 OGDF_EXPORT bool hasSingleSink(const Graph& G, node& sink);
810 
812 
818 inline bool hasSingleSink(const Graph& G) {
819  node sink;
820  return hasSingleSink(G, sink);
821 }
822 
824 
836 OGDF_EXPORT bool isStGraph(const Graph& G, node& s, node& t, edge& st);
837 
839 
847 inline bool isStGraph(const Graph& G) {
848  node s, t;
849  edge st;
850  return isStGraph(G, s, t, st);
851 }
852 
854 
862 OGDF_EXPORT void topologicalNumbering(const Graph& G, NodeArray<int>& num);
863 
864 
866 
875 OGDF_EXPORT int strongComponents(const Graph& G, NodeArray<int>& component);
876 
877 
879 
888 OGDF_EXPORT void makeBimodal(Graph& G, List<edge>& newEdges);
889 
891 
898 inline void makeBimodal(Graph& G) {
899  List<edge> dummy;
900  makeBimodal(G, dummy);
901 }
902 
903 
907 
908 OGDF_DEPRECATED("isAcyclicUndirected() should be used instead.")
909 
910 
913 inline bool isFreeForest(const Graph& G) { return isAcyclicUndirected(G); }
914 
916 
922 inline bool isTree(const Graph& G) {
923  return G.empty() || ((G.numberOfNodes() == G.numberOfEdges() + 1) && isConnected(G));
924 }
925 
927 
935 OGDF_EXPORT bool isArborescenceForest(const Graph& G, List<node>& roots);
936 
938 
944 inline bool isArborescenceForest(const Graph& G) {
945  List<node> roots;
946  return isArborescenceForest(G, roots);
947 }
948 
949 
950 OGDF_DEPRECATED("isArborescenceForest() should be used instead.")
951 
952 
955 inline bool isForest(const Graph& G, List<node>& roots) { return isArborescenceForest(G, roots); }
956 
957 
958 OGDF_DEPRECATED("isArborescenceForest() should be used instead.")
959 
960 
963 inline bool isForest(const Graph& G) { return isArborescenceForest(G); }
964 
966 
973 OGDF_EXPORT bool isArborescence(const Graph& G, node& root);
974 
976 
982 inline bool isArborescence(const Graph& G) {
983  node root;
984  return isArborescence(G, root);
985 }
986 
988 
990 
996 OGDF_EXPORT bool isRegular(const Graph& G);
997 
998 
1000 
1007 OGDF_EXPORT bool isRegular(const Graph& G, int d);
1008 
1009 
1011 
1019 OGDF_EXPORT bool isBipartite(const Graph& G, NodeArray<bool>& color);
1020 
1022 
1028 inline bool isBipartite(const Graph& G) {
1029  NodeArray<bool> color(G);
1030  return isBipartite(G, color);
1031 }
1032 
1065 OGDF_EXPORT void nodeDistribution(const Graph& G, Array<int>& degdist, std::function<int(node)> func);
1066 
1074 inline void degreeDistribution(const Graph& G, Array<int>& degdist) {
1075  nodeDistribution(G, degdist, [](node v) { return v->degree(); });
1076 }
1077 
1078 }
ogdf::ArrayBuffer
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition: Array.h:53
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ArrayBuffer.h
Declaration and implementation of ArrayBuffer class.
Graph.h
Includes declaration of graph class.
ogdf::removeSelfLoops
void removeSelfLoops(Graph &graph, node v)
Removes all self-loops for a given node v in graph.
OGDF_DEPRECATED
#define OGDF_DEPRECATED(reason)
Mark a class / member / function as deprecated.
Definition: config.h:120
ogdf::hasNonSelfLoopEdges
bool hasNonSelfLoopEdges(const Graph &G)
Returns whether G has edges which are not self-loops.
ogdf::degreeDistribution
void degreeDistribution(const Graph &G, Array< int > &degdist)
Fills degdist with the degree distribution of graph G.
Definition: simple_graph_alg.h:1074
ogdf::SListIteratorBase
Encapsulates a pointer to an ogdf::SList element.
Definition: SList.h:50
ogdf::makeSimple
void makeSimple(Graph &G)
Removes all self-loops and all but one edge of each bundle of parallel edges.
Definition: simple_graph_alg.h:410
ogdf::connectedComponents
int connectedComponents(const Graph &G)
Computes the amount of connected components of G.
Definition: simple_graph_alg.h:497
ogdf::makeLoopFree
void makeLoopFree(Graph &G, NODELIST &L)
Removes all self-loops from G and returns all nodes with self-loops in L.
Definition: simple_graph_alg.h:77
ogdf::makeLoopFree
void makeLoopFree(Graph &G)
Removes all self-loops from G.
ogdf::getParallelFreeUndirected
void getParallelFreeUndirected(const Graph &G, EdgeArray< EDGELIST > &parallelEdges)
Computes the bundles of undirected parallel edges in G.
Definition: simple_graph_alg.h:303
ogdf::makeSimpleUndirected
void makeSimpleUndirected(Graph &G)
Removes all self-loops and all but one edge of each bundle of undirected parallel edges.
Definition: simple_graph_alg.h:433
ogdf::isConnected
bool isConnected(const Graph &G)
Returns true iff G is connected.
ogdf::parallelFreeSortUndirected
void parallelFreeSortUndirected(const Graph &G, SListPure< edge > &edges, EdgeArray< int > &minIndex, EdgeArray< int > &maxIndex)
Sorts the edges of G such that undirected parallel edges come after each other in the list.
ogdf::SListIteratorBase::valid
bool valid() const
Returns true iff the iterator points to an element.
Definition: SList.h:134
ogdf::isAcyclicUndirected
bool isAcyclicUndirected(const Graph &G)
Returns true iff the undirected graph G is acyclic.
Definition: simple_graph_alg.h:752
ogdf::safeForEach
void safeForEach(CONTAINER &container, std::function< void(typename CONTAINER::value_type)> func)
Calls (possibly destructive) func for each element of container.
Definition: list_templates.h:51
ogdf::isForest
bool isForest(const Graph &G)
Returns true iff G is a forest consisting only of arborescences.
Definition: simple_graph_alg.h:963
ogdf::parallelFreeSort
void parallelFreeSort(const Graph &G, SListPure< edge > &edges)
Sorts the edges of G such that parallel edges come after each other in the list.
ogdf::isTriconnected
bool isTriconnected(const Graph &G)
Returns true iff G is triconnected.
Definition: simple_graph_alg.h:656
ogdf::numParallelEdgesUndirected
int numParallelEdgesUndirected(const Graph &G)
Returns the number of undirected parallel edges in G.
Definition: simple_graph_alg.h:265
ogdf::isAcyclic
bool isAcyclic(const Graph &G)
Returns true iff the digraph G is acyclic.
Definition: simple_graph_alg.h:730
ogdf::SListPure::begin
iterator begin()
Returns an iterator to the first element of the list.
Definition: SList.h:344
ogdf::makeAcyclic
void makeAcyclic(Graph &G)
Makes the digraph G acyclic by removing edges.
ogdf::findCutVertices
bool findCutVertices(const Graph &G, ArrayBuffer< node > &cutVertices, bool onlyOne=false)
Finds cut vertices and potential edges that could be added to turn the cut vertices into non-cut vert...
Definition: simple_graph_alg.h:534
ogdf::edge
EdgeElement * edge
The type of edges.
Definition: Graph_d.h:74
ogdf::isTriconnectedPrimitive
bool isTriconnectedPrimitive(const Graph &G)
Returns true iff G is triconnected (using a quadratic time algorithm!).
Definition: simple_graph_alg.h:690
ogdf::numParallelEdges
int numParallelEdges(const Graph &G)
Returns the number of parallel edges in G.
Definition: simple_graph_alg.h:143
list_templates.h
Implementation of algorithms as templates working with different list types.
ogdf::NodeElement::degree
int degree() const
Returns the degree of the node (indegree + outdegree).
Definition: Graph_d.h:283
ogdf::isFreeForest
bool isFreeForest(const Graph &G)
Returns true iff the undirected graph G is acyclic.
Definition: simple_graph_alg.h:913
ogdf::isStGraph
bool isStGraph(const Graph &G)
Returns true if G is an st-digraph.
Definition: simple_graph_alg.h:847
SList.h
Declaration of singly linked lists and iterators.
ogdf::Array< int >
ogdf::isTwoEdgeConnected
bool isTwoEdgeConnected(const Graph &graph)
Returns true iff graph is 2-edge-connected.
Definition: simple_graph_alg.h:628
GraphList.h
Decralation of GraphElement and GraphList classes.
ogdf::makeBiconnected
void makeBiconnected(Graph &G)
Makes G biconnected by adding edges.
Definition: simple_graph_alg.h:575
ogdf::isArborescenceForest
bool isArborescenceForest(const Graph &G)
Returns true iff G is a forest consisting only of arborescences.
Definition: simple_graph_alg.h:944
ogdf::strongComponents
int strongComponents(const Graph &G, NodeArray< int > &component)
Computes the strongly connected components of the digraph G.
ogdf::makeAcyclicByReverse
void makeAcyclicByReverse(Graph &G)
Makes the digraph G acyclic by reversing edges.
ogdf::SListPure
Singly linked lists.
Definition: SList.h:52
ogdf::makeParallelFree
void makeParallelFree(Graph &G)
Removes all but one edge of each bundle of parallel edges in G.
Definition: simple_graph_alg.h:218
ogdf::EdgeElement::source
node source() const
Returns the source node of the edge.
Definition: Graph_d.h:398
ogdf::node
NodeElement * node
The type of nodes.
Definition: Graph_d.h:70
ogdf::List< edge >
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::makeBimodal
void makeBimodal(Graph &G)
Makes the digraph G bimodal.
Definition: simple_graph_alg.h:898
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::isSimpleUndirected
bool isSimpleUndirected(const Graph &G)
Returns true iff G contains neither self-loops nor undirected parallel edges.
Definition: simple_graph_alg.h:423
ogdf::isRegular
bool isRegular(const Graph &G, int d)
Checks if a graph is d-regular.
ogdf::isLoopFree
bool isLoopFree(const Graph &G)
Returns true iff G contains no self-loop.
ogdf::biconnectedComponents
int biconnectedComponents(const Graph &G, EdgeArray< int > &component)
Computes the biconnected components of G.
Definition: simple_graph_alg.h:603
graph_iterators.h
Decralation of graph iterators.
ogdf::triangulate
void triangulate(Graph &G)
Triangulates a planarly embedded graph G by adding edges.
ogdf::connectedIsolatedComponents
int connectedIsolatedComponents(const Graph &G, List< node > &isolated, NodeArray< int > &component)
Definition: simple_graph_alg.h:508
ogdf::hasSingleSource
bool hasSingleSource(const Graph &G)
Returns true iff the digraph G contains exactly one source node (or is empty).
Definition: simple_graph_alg.h:796
ogdf::isParallelFreeUndirected
bool isParallelFreeUndirected(const Graph &G)
Returns true iff G contains no undirected parallel edges.
ogdf::isBipartite
bool isBipartite(const Graph &G)
Checks whether a graph is bipartite.
Definition: simple_graph_alg.h:1028
ogdf::isParallelFree
bool isParallelFree(const Graph &G)
Returns true iff G contains no parallel edges.
basic.h
Basic declarations, included by all source files.
ogdf::isBiconnected
bool isBiconnected(const Graph &G)
Returns true iff G is biconnected.
Definition: simple_graph_alg.h:555
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::hasSingleSink
bool hasSingleSink(const Graph &G)
Returns true iff the digraph G contains exactly one sink node (or is empty).
Definition: simple_graph_alg.h:818
Array.h
Declaration and implementation of Array class and Array algorithms.
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:363
ogdf::topologicalNumbering
void topologicalNumbering(const Graph &G, NodeArray< int > &num)
Computes a topological numbering of an acyclic digraph G.
List.h
Declaration of doubly linked lists and iterators.
ogdf::isArborescence
bool isArborescence(const Graph &G)
Returns true iff G represents an arborescence.
Definition: simple_graph_alg.h:982
ogdf::makeParallelFreeUndirected
void makeParallelFreeUndirected(Graph &G, EDGELIST &parallelEdges, EdgeArray< int > &cardPositive, EdgeArray< int > &cardNegative)
Definition: simple_graph_alg.h:386
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
tuples.h
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.
ogdf::isSimple
bool isSimple(const Graph &G)
Returns true iff G contains neither self-loops nor parallel edges.
Definition: simple_graph_alg.h:402
ogdf::makeConnected
void makeConnected(Graph &G)
makes G connected by adding a minimum number of edges.
Definition: simple_graph_alg.h:467
ogdf::isTree
bool isTree(const Graph &G)
Returns true iff G is a tree, i.e. contains no undirected cycle and is connected.
Definition: simple_graph_alg.h:922
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716
ogdf::nodeDistribution
void nodeDistribution(const Graph &G, Array< int > &degdist, std::function< int(node)> func)
Fills dist with the distribution given by a function func in graph G.