60 template<
class NODELIST>
141 template <
class EDGELIST>
144 parallelEdges.clear();
151 edge ePrev = *it++, e;
155 if (ePrev->
source() == e->source() && ePrev->
target() == e->target()) {
157 if (bAppend) { parallelEdges.pushBack(ePrev); bAppend =
false; }
159 ePrev = e; bAppend =
true;
241 template <
class EDGELIST>
244 parallelEdges.clear();
252 edge ePrev = *it++, e;
256 if (minIndex[ePrev] == minIndex[e] && maxIndex[ePrev] == maxIndex[e]) {
258 if (bAppend) { parallelEdges.pushBack(ePrev); bAppend =
false; }
260 ePrev = e; bAppend =
true;
299 template <
class EDGELIST>
302 EDGELIST ¶llelEdges,
306 parallelEdges.clear();
307 cardPositive.
fill(0);
308 cardNegative.
fill(0);
316 edge ePrev = *it++, e;
321 if (minIndex[ePrev] == minIndex[e] && maxIndex[ePrev] == maxIndex[e])
323 if (ePrev->
source() == e->source() && ePrev->
target() == e->target())
324 cardPositive[ePrev]++;
325 else if (ePrev->
source() == e->target() && ePrev->
target() == e->source())
326 cardNegative[ePrev]++;
330 parallelEdges.pushBack(ePrev);
336 ePrev = e; bAppend =
true;
354 template <
class EDGELIST>
364 edge ePrev = *it++, e;
368 if (minIndex[ePrev] == minIndex[e] && maxIndex[ePrev] == maxIndex[e])
369 parallelEdges[ePrev].pushBack(e);
564 int doNotNeedTheValue;
node target() const
Returns the target node of the edge.
Declaration of singly linked lists and iterators.
bool isForest(const Graph &G, List< node > &roots)
Returns true iff G represents a forest, i.e., a collection of arborescences.
bool isRegular(const Graph &G)
Checks if a graph is regular.
bool valid() const
Returns true iff the iterator points to an element.
Data type for general directed graphs (adjacency list representation).
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
void makeLoopFree(Graph &G, NODELIST &L)
Removes all self-loops from G and returns all nodes with self-loops in L.
void topologicalNumbering(const Graph &G, NodeArray< int > &num)
Computes a topological numbering of an acyclic digraph G.
int degree() const
Returns the degree of the node (indegree + outdegree).
void getParallelFreeUndirected(const Graph &G, EdgeArray< EDGELIST > ¶llelEdges)
Computes the bundles of undirected parallel edges in G.
bool isTriconnectedPrimitive(const Graph &G, node &s1, node &s2)
Returns true iff G is triconnected (using a quadratic time algorithm!).
virtual void delEdge(edge e)
Removes edge e from the graph.
void makeSimple(Graph &G)
Removes all self-loops and all but one edge of each bundle of parallel edges.
Encapsulates a pointer to an ogdf::SList element.
int connectedIsolatedComponents(const Graph &G, List< node > &isolated, NodeArray< int > &component)
Computes the connected components of G and returns the list of isolated nodes.
void parallelFreeSort(const Graph &G, SListPure< edge > &edges)
Sorts the edges of G such that parallel edges come after each other in the list.
Declaration and implementation of bounded stack class.
void fill(const T &x)
Sets all array elements to x.
void makeSimpleUndirected(Graph &G)
Removes all self-loops and all but one edge of each bundle of undirected parallel edges...
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...
void makeConnected(Graph &G, List< edge > &added)
Makes G connected by adding a minimum number of edges.
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).
bool isTriconnected(const Graph &G, node &s1, node &s2)
Returns true iff G is triconnected.
bool isFreeForest(const Graph &G)
Returns true iff G is a forest, i.e. contains no undirected cycle.
int numberOfEdges() const
Returns the number of edges in the graph.
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.
iterator begin()
Returns an iterator to the first element of the list.
bool isAcyclicUndirected(const Graph &G, List< edge > &backedges)
Returns true iff the undirected graph G is acyclic.
Declaration and implementation of EdgeArray class.
edge firstEdge() const
Returns the first edge in the list of all edges.
bool isLoopFree(const Graph &G)
Returns true iff G contains no self-loop.
bool isBiconnected(const Graph &G, node &cutVertex)
Returns true iff G is biconnected.
Class for the representation of edges.
void makeBimodal(Graph &G, List< edge > &newEdges)
Makes the digraph G bimodal.
void makeAcyclicByReverse(Graph &G)
Makes the digraph G acyclic by reversing edges.
Class for the representation of nodes.
void makeAcyclic(Graph &G)
Makes the digraph G acyclic by removing edges.
int numParallelEdges(const Graph &G)
Returns the number of parallel edges in G.
bool isAcyclic(const Graph &G, List< edge > &backedges)
Returns true iff the digraph G is acyclic.
bool isParallelFree(const Graph &G)
Returns true iff G contains no paralle edges.
bool isSimpleUndirected(const Graph &G)
Returns true iff G contains neither self-loops nor undirected parallel edges.
bool isArborescence(const Graph &G, node &root)
Returns true iff G represents a tree.
bool isParallelFreeUndirected(const Graph &G)
Returns true iff G contains no undirected parallel edges.
edge succ() const
Returns the successor in the list of all edges.
bool hasSingleSource(const Graph &G, node &source)
Returns true iff the digraph G contains exactly one source node (or is empty).
bool isTree(const Graph &G)
Returns true iff G is a tree, i.e. contains no undirected cycle and is connected. ...
void degreeDistribution(const Graph &G, Array< int > °dist)
Fills degdist with the degree distribution of graph G.
node source() const
Returns the source node of the edge.
void triangulate(Graph &G)
Triangulates a planarly embedded graph G by adding edges.
int biconnectedComponents(const Graph &G, EdgeArray< int > &component, int &nonEmptyComponents)
Computes the biconnected components of G.
bool isSimple(const Graph &G)
Returns true iff G contains neither self-loops nor parallel edges.
The namespace for all OGDF objects.
int strongComponents(const Graph &G, NodeArray< int > &component)
Computes the strongly connected components of the digraph G.
int numberOfNodes() const
Returns the number of nodes in the graph.
void makeParallelFreeUndirected(Graph &G, EDGELIST ¶llelEdges)
Removes all but one of each bundle of undirected parallel edges.
void makeBiconnected(Graph &G, List< edge > &added)
Makes G biconnected by adding edges.
bool isConnected(const Graph &G)
Returns true iff G is connected.
int connectedComponents(const Graph &G, NodeArray< int > &component)
Computes the connected components of G.
void makeParallelFree(Graph &G, EDGELIST ¶llelEdges)
Removes all but one of each bundle of parallel edges.
bool empty() const
Returns true iff the graph is empty, i.e., contains no nodes.
int numParallelEdgesUndirected(const Graph &G)
Returns the number of undirected parallel edges in G.