Tulip
5.7.4
Large graphs analysis and drawing
|
#include <SimpleTest.h>
Static Public Member Functions | |
static bool | hasLoops (const Graph *graph) |
static bool | hasParallelEdges (const Graph *graph, const bool directed=false) |
static bool | isSimple (const Graph *graph, const bool directed=false) |
static void | makeSimple (Graph *graph, std::vector< edge > &removed, const bool directed=false) |
static bool | simpleTest (const Graph *graph, std::vector< edge > *multipleEdges=nullptr, std::vector< edge > *loops=nullptr, const bool directed=false) |
Performs test to check if a graph is Simple. An undirected graph is simple if it has no loops and no more than one edge between any unordered pair of vertices. A directed graph is simple if has no loops and no more than one edge between any ordered pair of vertices.
Definition at line 40 of file SimpleTest.h.
|
static |
Checks if the graph has self loop edges.
graph | The graph to check. |
|
static |
Checks if the graph has parallel edges.
graph | The graph to check. |
directed | Whether the graph shall be considered directed or not. |
|
static |
Checks if the graph is simple (i.e. it contains no self loops or parallel edges).
graph | The graph to check. |
directed | Whether the graph shall be considered directed or not. |
|
static |
Makes the graph simple, by removing self loops and parallel edges if any.
Makes the graph simple by removing self loops and parallel edges if any. The removed edges are stored in the removed vector.
graph | The graph to make simple. |
removed | The edges that were removed to make the graph simple. |
directed | Whether the graph shall be considered directed or not. |
|
static |
Checks if the graph is simple, and stores parallel edges and self loops in different vectors.
Performs simple test and stores found parallel edges in the multipleEdges vector and found self loops in the loops vector. Returns true if the graph is simple, false otherwise.
graph | The graph to check for simplicity. |
multipleEdges | The parallel edges that need to be removed to make the graph simple. Defaults to 0. |
loops | The self loops that need to be removed to make the graph simple. Defaults to 0. |
directed | Whether the graph shall be considered directed or not. |