68template<
class NODELIST>
73 if (e->isSelfLoop()) {
74 L.pushBack(e->source());
134template<
bool ONLY_ONCE = false>
136 if (G.numberOfEdges() <= 1) {
146 for (it = ++it; it.
valid(); ++it,
ePrev = e) {
148 if (
ePrev->isParallelDirected(e)) {
172template<
class EDGELIST>
175 if (G.numberOfEdges() <= 1) {
187 if (e->isParallelDirected(
ePrev)) {
256template<
bool ONLY_ONCE = false>
258 if (G.numberOfEdges() <= 1) {
269 for (it = ++it; it.
valid(); ++it,
ePrev = e) {
294template<
class EDGELIST>
296 if (G.numberOfEdges() <= 1) {
334template<
class EDGELIST = SListPure<edge>>
347 if (G.numberOfEdges() <= 1) {
354 for (
edge e : G.edges) {
357 (*cardPositive)[e]++;
360 (*cardNegative)[e]++;
370template<
class EDGELIST>
371OGDF_DEPRECATED(
"The pointer-based makeParallelFreeUndirected() should be used instead.")
376template<
class EDGELIST>
377OGDF_DEPRECATED(
"The pointer-based makeParallelFreeUndirected() should be used instead.")
914 return G.empty() || ((G.numberOfNodes() == G.numberOfEdges() + 1) &&
isConnected(G));
Declaration and implementation of EdgeArray class.
Declaration and implementation of NodeArray class.
Declaration of singly linked lists and iterators.
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
The parameterized class Array implements dynamic arrays of type E.
Dynamic arrays indexed with edges.
Class for the representation of edges.
Data type for general directed graphs (adjacency list representation).
Doubly linked lists (maintaining the length of the list).
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
int degree() const
Returns the degree of the node (indegree + outdegree).
Encapsulates a pointer to an ogdf::SList element.
bool valid() const
Returns true iff the iterator points to an element.
iterator begin()
Returns an iterator to the first element of the list.
Tuples of two elements (2-tuples).
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
bool isBiconnected(const Graph &G, node &cutVertex)
Returns true iff G is biconnected.
void makeBiconnected(Graph &G, List< edge > &added)
Makes G biconnected by adding edges.
void makeConnected(Graph &G, List< edge > &added)
Makes G connected by adding a minimum number of edges.
int biconnectedComponents(const Graph &G, EdgeArray< int > &component, int &nonEmptyComponents)
Computes the biconnected components of G.
bool isConnected(const Graph &G)
Returns true iff G is connected.
bool isTwoEdgeConnected(const Graph &graph, edge &bridge)
Returns true iff graph is 2-edge-connected.
bool isTriconnected(const Graph &G, node &s1, node &s2)
Returns true iff G is triconnected.
bool findCutVertices(const Graph &G, ArrayBuffer< node > &cutVertices, ArrayBuffer< Tuple2< node, node > > &addEdges, bool onlyOne=false)
Finds cut vertices and potential edges that could be added to turn the cut vertices into non-cut vert...
int connectedComponents(const Graph &G, NodeArray< int > &component, List< node > *isolated=nullptr)
Computes the connected components of G and optionally generates a list of isolated nodes.
void triangulate(Graph &G)
Triangulates a planarly embedded graph G by adding edges.
bool isTriconnectedPrimitive(const Graph &G, node &s1, node &s2)
Returns true iff G is triconnected (using a quadratic time algorithm!).
bool isAcyclic(const Graph &G, List< edge > &backedges)
Returns true iff the digraph G is acyclic.
int strongComponents(const Graph &G, NodeArray< int > &component)
Computes the strongly connected components of the digraph G.
void makeAcyclicByReverse(Graph &G)
Makes the digraph G acyclic by reversing edges.
void makeBimodal(Graph &G, List< edge > &newEdges)
Makes the digraph G bimodal.
bool hasSingleSource(const Graph &G, node &source)
Returns true iff the digraph G contains exactly one source node (or is empty).
bool isStGraph(const Graph &G, node &s, node &t, edge &st)
Returns true iff G is an st-digraph.
bool hasSingleSink(const Graph &G, node &sink)
Returns true iff the digraph G contains exactly one sink node (or is empty).
void makeAcyclic(Graph &G)
Makes the digraph G acyclic by removing edges.
void topologicalNumbering(const Graph &G, NodeArray< int > &num)
Computes a topological numbering of an acyclic digraph G.
bool isAcyclicUndirected(const Graph &G, List< edge > &backedges)
Returns true iff the undirected graph G is acyclic.
bool isParallelFreeUndirected(const Graph &G)
Returns true iff G contains no undirected parallel edges.
void makeLoopFree(Graph &G, NODELIST &L)
Removes all self-loops from G and returns all nodes with self-loops in L.
bool isParallelFree(const Graph &G)
Returns true iff G contains no parallel edges.
void makeSimple(Graph &G)
Removes all self-loops and all but one edge of each bundle of parallel edges.
void makeParallelFreeUndirected(Graph &G, EDGELIST *parallelEdges=nullptr, EdgeArray< int > *cardPositive=nullptr, EdgeArray< int > *cardNegative=nullptr)
Removes all but one edge of each bundle of undirected parallel edges.
bool isLoopFree(const Graph &G)
Returns true iff G contains no self-loop.
void parallelFreeSort(const Graph &G, SListPure< edge > &edges)
Sorts the edges of G such that parallel edges come after each other in the list.
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.
int numParallelEdgesUndirected(const Graph &G)
Returns the number of undirected parallel edges in G.
void makeParallelFree(Graph &G, EDGELIST ¶llelEdges)
Removes all but one of each bundle of parallel edges.
void removeSelfLoops(Graph &graph, node v)
Removes all self-loops for a given node v in graph.
void getParallelFreeUndirected(const Graph &G, EdgeArray< EDGELIST > ¶llelEdges)
Computes the bundles of undirected parallel edges in G.
bool isSimpleUndirected(const Graph &G)
Returns true iff G contains neither self-loops nor undirected parallel edges.
bool isSimple(const Graph &G)
Returns true iff G contains neither self-loops nor parallel edges.
bool hasNonSelfLoopEdges(const Graph &G)
Returns whether G has edges which are not self-loops.
int numParallelEdges(const Graph &G)
Returns the number of parallel edges in G.
void makeSimpleUndirected(Graph &G)
Removes all self-loops and all but one edge of each bundle of undirected parallel edges.
bool isArborescenceForest(const Graph &G, List< node > &roots)
Returns true iff G is a forest consisting only of arborescences.
bool isArborescence(const Graph &G, node &root)
Returns true iff G represents an arborescence.
bool isTree(const Graph &G)
Returns true iff G is a tree, i.e. contains no undirected cycle and is connected.
bool isBipartite(const Graph &G, NodeArray< bool > &color)
Checks whether a graph is bipartite.
void degreeDistribution(const Graph &G, Array< int > °dist)
Fills degdist with the degree distribution of graph G.
void nodeDistribution(const Graph &G, Array< int > °dist, std::function< int(node)> func)
Fills dist with the distribution given by a function func in graph G.
bool isRegular(const Graph &G)
Checks if a graph is regular.
#define OGDF_DEPRECATED(reason)
Mark a class / member / function as deprecated.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
void safeForEach(CONTAINER &container, std::function< void(typename CONTAINER::value_type)> func)
Calls (possibly destructive) func for each element of container.
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.