|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graph.model.GraphGeneration
This class has code that generates different sorts of graphs that are used frequently or that are some sort of standard graphs. These graphs are used for debugging and testing graph algorithms and might also be of interest for api users or even final-customers. One important method is provided to allow generation of subgraphs from given graphs with constraining nodes and lists to certain subsets of the sets of nodes and lists in the source graph.
| Nested Class Summary | |
static class |
GraphGeneration.TreeRandomizer
Helper class for randomization. |
| Method Summary | |
static Graph |
buildSubgraph(Graph graph,
java.util.Iterator nodes,
java.util.Iterator edges)
Builds a subgraph from the given graph and the given lists of nodes and edges. |
static Graph |
completeGraph(int n_nodes)
Generates a complete graph. |
static Graph |
gridGraph(int n)
Generates a digraph that looks like a grid of size n * n. |
static Graph |
randomCircular(int n_nodes)
Generates a random-circular Graph. |
static Graph |
randomGraph(int n_nodes,
int n_edges)
Generates a random graph. |
static Graph |
randomTree(int n_nodes)
Generates a random-tree Graph. |
static Graph |
randomWorkflow_old(int n_nodes,
int n_edges)
Generates a random-workflow Graph. |
static Graph |
randomWorkflow(int n_nodes)
Generates a random Graph with workflow characteristics. |
static Graph |
starGraph(int n)
Generates a star-graph. |
static Graph |
treeGraph(int levels,
int leavesPerNode)
Generates a tree graph. |
static Graph |
treeGraph(int levels,
int leavesPerNode,
GraphGeneration.TreeRandomizer randomizer)
Generates a tree graph. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final Graph buildSubgraph(Graph graph,
java.util.Iterator nodes,
java.util.Iterator edges)
throws GraphException
graph - the original graphnodes - the nodes to use for building the subgraph.edges - the edges to use for building the subgraph.
GraphException - thrown if building failed.
public static Graph gridGraph(int n)
throws GraphException
n - the number of nodes per column and row.
GraphException - thrown if building failed.
public static Graph starGraph(int n)
throws GraphException
n - number of outer nodes.
Graph.
GraphException - thrown if building failed.
public static Graph treeGraph(int levels,
int leavesPerNode)
throws GraphException
levels - depth of the tree.
GraphException - thrown if building failed.
public static Graph treeGraph(int levels,
int leavesPerNode,
GraphGeneration.TreeRandomizer randomizer)
throws GraphException
levels - depth of the tree.randomizer - the tree randomizer
GraphException - thrown if building failed.
public static Graph completeGraph(int n_nodes)
throws GraphException
n_nodes - the number of nodes.
Graph.
GraphException - thrown if building failed.
public static Graph randomGraph(int n_nodes,
int n_edges)
throws GraphException
n_nodes - number of nodes to createn_edges - number of edges to create
GraphException - thrown if building failed.
public static Graph randomCircular(int n_nodes)
throws GraphException
Graph.
n_nodes - the number of nodes.
Graph.
GraphException - thrown if the generation fails.
public static Graph randomWorkflow(int n_nodes)
throws GraphException
Graph with workflow characteristics.
n_nodes - number of nodes in the Graph.
Graph.
GraphException - thrown if generation failed.
public static Graph randomWorkflow_old(int n_nodes,
int n_edges)
throws GraphException
Graph.
n_nodes - the number of nodes to create.n_edges - the number of edges to create.
Graph.
GraphException - thrown if the generation fails.
public static Graph randomTree(int n_nodes)
throws GraphException
Graph.
n_nodes - the number of nodes.
Graph.
GraphException - thrown if the generation fails.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||