Tulip  4.10.0
Better Visualization Through Research
tlp::SimpleTest Class Reference

#include <SimpleTest.h>

+ Inheritance diagram for tlp::SimpleTest:
+ Collaboration diagram for tlp::SimpleTest:

Static Public Member Functions

static bool isSimple (const Graph *graph)
 
static void makeSimple (Graph *graph, std::vector< edge > &removed)
 
static bool simpleTest (const Graph *graph, std::vector< edge > *multipleEdges=NULL, std::vector< edge > *loops=NULL)
 

Detailed Description

Performs test to check if a graph is Simple. From Wikipedia: "A simple graph is an undirected graph that has no loops and no more than one edge between any two different vertices.".

Definition at line 34 of file SimpleTest.h.

Member Function Documentation

static bool tlp::SimpleTest::isSimple ( const Graph graph)
static

Checks if the graph is simple (i.e. it contains no self loops or parallel edges).

Parameters
graphThe graph to check.
Returns
bool True if the graph is simple, false otherwise.
static void tlp::SimpleTest::makeSimple ( Graph graph,
std::vector< edge > &  removed 
)
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.

Parameters
graphThe graph to make simple.
removedThe edges that were removed to make the graph simple.
Returns
void
static bool tlp::SimpleTest::simpleTest ( const Graph graph,
std::vector< edge > *  multipleEdges = NULL,
std::vector< edge > *  loops = NULL 
)
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.

Parameters
graphThe graph to check for simplicity.
multipleEdgesThe parallel edges that need to be removed to make the graph simple. Defaults to 0.
loopsThe self loops that need to be removed to make the graph simple. Defaults to 0.
Returns
bool True if the graph is simple, false otherwise.