Overview     Modules     Class Hierarchy     Classes     Members  

Class for testing if the graph is a tree. More...

#include <TreeTest.h>

Inheritance diagram for tlp::TreeTest:
Collaboration diagram for tlp::TreeTest:

Static Public Member Functions

static bool isTree (Graph *graph)
static bool isFreeTree (Graph *graph)
static void makeRootedTree (Graph *freeTree, node root)
static void makeDirectedTree (Graph *freeTree, node root)
static GraphcomputeTree (Graph *graph, PluginProgress *pluginProgress=0)
static void cleanComputedTree (Graph *graph, Graph *tree)

Additional Inherited Members

- Private Member Functions inherited from tlp::GraphObserver
 GraphObserver ()
virtual ~GraphObserver ()
 GraphObserver (const GraphObserver &)
GraphObserveroperator= (const GraphObserver &)
virtual void addNode (Graph *, const node)
virtual void addEdge (Graph *, const edge)
virtual void beforeSetEnds (Graph *, const edge)
virtual void afterSetEnds (Graph *, const edge)
virtual void delNode (Graph *, const node)
virtual void delEdge (Graph *, const edge)
virtual void reverseEdge (Graph *, const edge)
virtual void destroy (Graph *)
virtual void addSubGraph (Graph *, Graph *)
virtual void delSubGraph (Graph *, Graph *)
virtual void addLocalProperty (Graph *, const std::string &)
virtual void beforeDelLocalProperty (Graph *g, const std::string &pName)
virtual void afterDelLocalProperty (Graph *, const std::string &)
virtual void delLocalProperty (Graph *, const std::string &)
virtual void addInheritedProperty (Graph *, const std::string &)
virtual void beforeDelInheritedProperty (Graph *, const std::string &)
virtual void afterDelInheritedProperty (Graph *, const std::string &)
virtual void beforeSetAttribute (Graph *, const std::string &)
virtual void afterSetAttribute (Graph *, const std::string &)
virtual void removeAttribute (Graph *, const std::string &)

Detailed Description

Class for testing if the graph is a tree.

Member Function Documentation

static void tlp::TreeTest::cleanComputedTree ( Graph graph,
Graph tree 
)
static

Clean the graph from a tree previously computed with the computeTree method

static Graph* tlp::TreeTest::computeTree ( Graph graph,
PluginProgress pluginProgress = 0 
)
static

Computes a rooted tree from the graph. The algorithm is the following :

  • if the graph is a rooted tree, returns the graph
  • if the graph is a free tree, returns a rooted clone subgraph
  • if the graph is connected, makes a clone subgraph and returns a rooted spanning tree of that clone
  • if the graph is not connected, makes a clone subgraph, computes a tree for each of its connected components, adds a simple source and returns the clone.
static bool tlp::TreeTest::isFreeTree ( Graph graph)
static

Returns true if the graph is a topological tree (i.e. if the graph was undirected, there would be no cycle), false otherwise.

static bool tlp::TreeTest::isTree ( Graph graph)
static

Returns true if the graph is a rooted tree (i.e. a graph with one node designated as the root), false otherwise.

static void tlp::TreeTest::makeDirectedTree ( Graph freeTree,
node  root 
)
inlinestatic

Synonymous of the makeRootedTree method.

static void tlp::TreeTest::makeRootedTree ( Graph freeTree,
node  root 
)
static

Turns a free tree into a rooted tree.



Tulip Software by LaBRI Visualization Team    2001 - 2012