class NstGraph

Directed graph

Inheritance:


Public Fields

NstEdgeList edges
List of edges.
NstVertexList vertices
List of vertices.

Public Methods

NstGraph* clone(int deep = 0)
Clones the graph
void copy(const NstGraph& s, int deep = 0)
Copy the graph
void exec_vcg()
Execution of vcg to display the graph
int graph_cc()
Computes connected components
NstGraphList* graph_color()
Returns a list of graphs, each graph corresponds to the subgraph generated by all vertices with the same color
int graph_scc()
Computes strongly connected components
NstGraph* merge_color()
Fuses all vertices with the same color
NstGraph()
Creates an empty graph.
NstGraph(const NstEdgeList &new_edges, const NstVertexList &new_vertices)
Creates a graph from a given edge list and a given vertex list.
virtual void output_vcg(ostream &s)
Output method in vcg format.
void system_vcg()
Execution of vcg by a system call and storing file to /tmp to display the graph
int topological_sort()
Topological sort
virtual ~NstGraph()
Deletes the graph.

Private Methods

friend ostream& operator << (ostream&, const NstGraph&)
Prints the graph.
friend ostream& operator << (ostream& s, const NstGraphList& glist)
Prints the list of graphs.

Documentation

Directed graph. A directed graph is represented by a list of vertices (see the classes NstVertex and NstVertexList) and a list of directed edges (see the classes NstEdge and NstEdgeList).
friend ostream& operator << (ostream&, const NstGraph&)
Prints the graph.

friend ostream& operator << (ostream& s, const NstGraphList& glist)
Prints the list of graphs.

NstEdgeList edges
List of edges.

NstVertexList vertices
List of vertices.

NstGraph()
Creates an empty graph.

NstGraph(const NstEdgeList &new_edges, const NstVertexList &new_vertices)
Creates a graph from a given edge list and a given vertex list.

virtual ~NstGraph()
Deletes the graph.

void copy(const NstGraph& s, int deep = 0)
Copy the graph. @param deep simple cloning if deep = 0, (one level) duplication otherwise. Just after the call, the order in the vertex list and in the edge list is the same in the original graph and in the copy.

NstGraph* clone(int deep = 0)
Clones the graph. @param deep simple cloning if deep = 0, (one level) duplication otherwise. Just after the call, the order in the vertex list and in the edge list is the same in the original graph and in the clone.

virtual void output_vcg(ostream &s)
Output method in vcg format.

void exec_vcg()
Execution of vcg to display the graph

void system_vcg()
Execution of vcg by a system call and storing file to /tmp to display the graph

NstGraph* merge_color()
Fuses all vertices with the same color. All vertices with the same color are merged into a vertex set. The method returns a graph whose vertices are these sets. There is an edge between two sets if there is an edge in the original graph from a vertex of the first set to a vertex of the second set.

NstGraphList* graph_color()
Returns a list of graphs, each graph corresponds to the subgraph generated by all vertices with the same color

int topological_sort()
Topological sort. Sorts the list of vertices so that each predecessor of a given vertex appears before in the list. Returns -1 if the graph has a cycle which is not a self-loop.

int graph_scc()
Computes strongly connected components. The result is that two vertices have the same color if and only if they belong to the same strongly connected component. The returned value is the number of such components.

int graph_cc()
Computes connected components. The result is that two vertices have the same color if and only if they belong to the same connected component. The returned value is the number of such components.


Direct child classes:
NstRDGVar
NstRDGStat

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de