Functions dealing with self-loops and multiple (parallel) edges in graphs.
More...
|
| void | ogdf::parallelFreeSort (const Graph &G, SListPure< edge > &edges) |
| | Sorts the edges of G such that parallel edges come after each other in the list. More...
|
| |
| bool | ogdf::isParallelFree (const Graph &G) |
| | Returns true iff G contains no paralle edges. More...
|
| |
| int | ogdf::numParallelEdges (const Graph &G) |
| | Returns the number of parallel edges in G. More...
|
| |
| template<class EDGELIST > |
| void | ogdf::makeParallelFree (Graph &G, EDGELIST ¶llelEdges) |
| | Removes all but one of each bundle of parallel edges. More...
|
| |
| void | ogdf::makeParallelFree (Graph &G) |
| | Removes all but one edge of each bundle of parallel edges in G. More...
|
| |
| void | ogdf::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. More...
|
| |
| bool | ogdf::isParallelFreeUndirected (const Graph &G) |
| | Returns true iff G contains no undirected parallel edges. More...
|
| |
| int | ogdf::numParallelEdgesUndirected (const Graph &G) |
| | Returns the number of undirected parallel edges in G. More...
|
| |
| template<class EDGELIST > |
| void | ogdf::makeParallelFreeUndirected (Graph &G, EDGELIST ¶llelEdges) |
| | Removes all but one of each bundle of undirected parallel edges. More...
|
| |
| void | ogdf::makeParallelFreeUndirected (Graph &G) |
| | Removes all but one of each bundle of undirected parallel edges. More...
|
| |
| template<class EDGELIST > |
| void | ogdf::makeParallelFreeUndirected (Graph &G, EDGELIST ¶llelEdges, EdgeArray< int > &cardPositive, EdgeArray< int > &cardNegative) |
| | Removes all but one of each bundle of undirected parallel edges. More...
|
| |
| template<class EDGELIST > |
| void | ogdf::getParallelFreeUndirected (const Graph &G, EdgeArray< EDGELIST > ¶llelEdges) |
| | Computes the bundles of undirected parallel edges in G. More...
|
| |
Functions dealing with self-loops and multiple (parallel) edges in graphs.
◆ getParallelFreeUndirected()
template<class EDGELIST >
| void ogdf::getParallelFreeUndirected |
( |
const Graph & |
G, |
|
|
EdgeArray< EDGELIST > & |
parallelEdges |
|
) |
| |
Computes the bundles of undirected parallel edges in G.
Stores for one (arbitrarily chosen) reference edge all edges belonging to the same bundle of undirected parallel edges; no edge is removed from the graph.
- Template Parameters
-
| EDGELIST | is the type of edge list that is assigned the list of edges. |
- Parameters
-
| G | is the input graph. |
| parallelEdges | is assigned for each reference edge the list of edges belonging to the bundle of undirected parallel edges. |
Definition at line 355 of file simple_graph_alg.h.
◆ isLoopFree()
| bool ogdf::isLoopFree |
( |
const Graph & |
G | ) |
|
Returns true iff G contains no self-loop.
- Parameters
-
- Returns
- true if
G contains no self-loops (edges whose two endpoints are the same), false otherwise.
◆ isParallelFree()
| bool ogdf::isParallelFree |
( |
const Graph & |
G | ) |
|
Returns true iff G contains no paralle edges.
A parallel edge is an edge e1=(v,w) such that there exists another edge e2=(v,w) in the graph. Reversal edges (e.g. (v,w) and (w,v)) are not parallel edges. If you want to test if a graph contains no undirected parallel edges, use isParallelFreeUndirected().
- Parameters
-
- Returns
- true if
G contains no multi-edges (edges with the same source and target).
◆ isParallelFreeUndirected()
| bool ogdf::isParallelFreeUndirected |
( |
const Graph & |
G | ) |
|
Returns true iff G contains no undirected parallel edges.
An undirected parallel edges is an edge e1=(v,w) such that there exists another edge e2=(v,w) or (w,v) in the graph.
- Parameters
-
- Returns
- true if
G contains no undirected parallel edges.
◆ isSimple()
| bool ogdf::isSimple |
( |
const Graph & |
G | ) |
|
|
inline |
Returns true iff G contains neither self-loops nor parallel edges.
- Parameters
-
- Returns
- true if
G is simple, i.e. contains neither self-loops nor parallel edges, false otherwise.
Definition at line 386 of file simple_graph_alg.h.
◆ isSimpleUndirected()
| bool ogdf::isSimpleUndirected |
( |
const Graph & |
G | ) |
|
|
inline |
Returns true iff G contains neither self-loops nor undirected parallel edges.
- Parameters
-
- Returns
- true if
G is (undirected) simple, i.e. contains neither self-loops nor undirected parallel edges, false otherwise.
Definition at line 411 of file simple_graph_alg.h.
◆ makeLoopFree() [1/2]
template<class NODELIST >
| void ogdf::makeLoopFree |
( |
Graph & |
G, |
|
|
NODELIST & |
L |
|
) |
| |
Removes all self-loops from G and returns all nodes with self-loops in L.
- Template Parameters
-
| NODELIST | is the type of the node list for returning the nodes with self-loops. |
- Parameters
-
| G | is the input graph. |
| L | is assigned the list of nodes with self-loops. |
Definition at line 61 of file simple_graph_alg.h.
◆ makeLoopFree() [2/2]
| void ogdf::makeLoopFree |
( |
Graph & |
G | ) |
|
Removes all self-loops from G.
- Parameters
-
◆ makeParallelFree() [1/2]
template<class EDGELIST >
| void ogdf::makeParallelFree |
( |
Graph & |
G, |
|
|
EDGELIST & |
parallelEdges |
|
) |
| |
Removes all but one of each bundle of parallel edges.
A parallel edge is an edge e1=(v,w) such that there exists another edge e2=(v,w) in the graph. Reversal edges (e.g. (v,w) and (w,v)) are not multi-edges. If you want to remove parallel and reversal edges, use makeParallelFreeUndirected(Graph&,EDGELIST&).
- Template Parameters
-
| EDGELIST | is the type of edge list that will be assigned the list of parallel edges. |
- Parameters
-
| G | is the input graph. |
| parallelEdges | is assigned the list of remaining edges in G that were part of a bundle of parallel edges in the input graph. |
Definition at line 142 of file simple_graph_alg.h.
◆ makeParallelFree() [2/2]
| void ogdf::makeParallelFree |
( |
Graph & |
G | ) |
|
|
inline |
Removes all but one edge of each bundle of parallel edges in G.
A parallel edge is an edge e1=(v,w) such that there exists another edge e2=(v,w) in the graph. Reversal edges (e.g. (v,w) and (w,v)) are not parallel edges. If you want to remove parallel and reversal edges, use makeParallelFreeUndirected(Graph&).
- Parameters
-
Definition at line 175 of file simple_graph_alg.h.
◆ makeParallelFreeUndirected() [1/3]
template<class EDGELIST >
| void ogdf::makeParallelFreeUndirected |
( |
Graph & |
G, |
|
|
EDGELIST & |
parallelEdges |
|
) |
| |
Removes all but one of each bundle of undirected parallel edges.
An undirected parallel edges is an edge e1=(v,w) such that there exists another edge e2=(v,w) or (w,v) in the graph. The function removes unordered pair {v,w} of nodes all but one of the edges with endpoints v and w (in any order).
- Template Parameters
-
| EDGELIST | is the type of edge list that will be assigned the list of edges. |
- Parameters
-
| G | is the input graph. |
| parallelEdges | is assigned the list of remaining edges that were part of a bundle of undirected parallel edges in the input graph. |
Definition at line 242 of file simple_graph_alg.h.
◆ makeParallelFreeUndirected() [2/3]
| void ogdf::makeParallelFreeUndirected |
( |
Graph & |
G | ) |
|
|
inline |
Removes all but one of each bundle of undirected parallel edges.
An undirected parallel edges is an edge e1=(v,w) such that there exists another edge e2=(v,w) or (w,v) in the graph. The function removes unordered pair {v,w} of nodes all but one of the edges with endpoints v and w (in any order).
- Parameters
-
Definition at line 276 of file simple_graph_alg.h.
◆ makeParallelFreeUndirected() [3/3]
template<class EDGELIST >
| void ogdf::makeParallelFreeUndirected |
( |
Graph & |
G, |
|
|
EDGELIST & |
parallelEdges, |
|
|
EdgeArray< int > & |
cardPositive, |
|
|
EdgeArray< int > & |
cardNegative |
|
) |
| |
Removes all but one of each bundle of undirected parallel edges.
An undirected parallel edges is an edge e1=(v,w) such that there exists another edge e2=(v,w) or (w,v) in the graph. The function removes unordered pair {v,w} of nodes all but one of the edges with endpoints v and w (in any order).
- Template Parameters
-
| EDGELIST | is the type of edge list that is assigned the list of edges. |
- Parameters
-
| G | is the input graph. |
| parallelEdges | is assigned the list of remaining edges that were part of a bundle of undirected parallel edges in the input graph. |
| cardPositive | contains for each edge the number of removed undirected parallel edges pointing in the same direction. |
| cardNegative | contains for each edge the number of removed undirected parallel edges pointing in the opposite direction. |
Definition at line 300 of file simple_graph_alg.h.
◆ makeSimple()
| void ogdf::makeSimple |
( |
Graph & |
G | ) |
|
|
inline |
Removes all self-loops and all but one edge of each bundle of parallel edges.
- Parameters
-
Definition at line 397 of file simple_graph_alg.h.
◆ makeSimpleUndirected()
| void ogdf::makeSimpleUndirected |
( |
Graph & |
G | ) |
|
|
inline |
Removes all self-loops and all but one edge of each bundle of undirected parallel edges.
- Parameters
-
Definition at line 422 of file simple_graph_alg.h.
◆ numParallelEdges()
| int ogdf::numParallelEdges |
( |
const Graph & |
G | ) |
|
Returns the number of parallel edges in G.
A parallel edge is an edge e1=(v,w) such that there exists another edge e2=(v,w) in the graph. Reversal edges (e.g. (v,w) and (w,v)) are not parallel edges. If you want to also take reversal edges into account, use numParallelEdgesUndirected().
- Parameters
-
- Returns
- is the number of parallel edges: for each bundle of parallel edges between two nodes v and w, all but one are counted.
◆ numParallelEdgesUndirected()
| int ogdf::numParallelEdgesUndirected |
( |
const Graph & |
G | ) |
|
Returns the number of undirected parallel edges in G.
An undirected parallel edges is an edge e1=(v,w) such that there exists another edge e2=(v,w) or (w,v) in the graph.
- Parameters
-
- Returns
- the number of undirected parallel edges; for each unordered pair {v,w} of nodes, all but one of the edges with endpoints v and w (in any order) are counted.
◆ parallelFreeSort()
Sorts the edges of G such that parallel edges come after each other in the list.
- Parameters
-
| G | is the input graph. |
| edges | is assigned the list of sorted edges. |
◆ parallelFreeSortUndirected()
Sorts the edges of G such that undirected parallel edges come after each other in the list.
An undirected parallel edges is an edge e1=(v,w) such that there exists another edge e2=(v,w) or (w,v) in the graph.
- Parameters
-
| G | is the input graph. |
| edges | is assigned the list of sorted edges. |
| minIndex | is assigned for each edge (v,w) the index min(index(v),index(w)). |
| maxIndex | is assigned for each edge (v,w) the index max(index(v),index(w)). |