Tulip  5.2.0 Large graphs analysis and drawing
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=nullptr, std::vector< edge > *loops=nullptr)

## 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 35 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
 graph The 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
 graph The graph to make simple. removed The edges that were removed to make the graph simple.
Returns
void
 static bool tlp::SimpleTest::simpleTest ( const Graph * graph, std::vector< edge > * multipleEdges = `nullptr`, std::vector< edge > * loops = `nullptr` )
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
 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.
Returns
bool True if the graph is simple, false otherwise.