public class TestGraphs extends Object
Modifier and Type | Field and Description |
---|---|
static String[][] |
pairs
A series of pairs that may be useful for generating graphs.
|
Constructor and Description |
---|
TestGraphs() |
Modifier and Type | Method and Description |
---|---|
static Graph<String,Number> |
createChainPlusIsolates(int chain_length,
int isolate_count) |
static Graph<String,Number> |
createDirectedAcyclicGraph(int layers,
int maxNodesPerLayer,
double linkprob)
Creates a sample directed acyclic graph by generating several "layers",
and connecting nodes (randomly) to nodes in earlier (but never later)
layers.
|
static Graph<String,Number> |
createTestGraph(boolean directed)
Creates a small sample graph that can be used for testing purposes.
|
static Graph<String,Number> |
getDemoGraph()
Returns a bigger test graph with a clique, several components, and other
parts.
|
static Graph<String,Number> |
getOneComponentGraph()
Returns a bigger, undirected test graph with a just one component.
|
static Graph<String,Number> |
getSmallGraph() |
public static String[][] pairs
public static Graph<String,Number> createTestGraph(boolean directed)
pairs
. If isDirected
,
the graph is a DirectedSparseMultigraph
,
otherwise, it is an UndirectedSparseMultigraph
.directed
- true iff the graph created is to have directed edgespublic static Graph<String,Number> createChainPlusIsolates(int chain_length, int isolate_count)
chain_length
- the length of the chain of vertices to add to the returned graphisolate_count
- the number of isolated vertices to add to the returned graphchain_length
vertices
and isolate_count
isolated vertices.public static Graph<String,Number> createDirectedAcyclicGraph(int layers, int maxNodesPerLayer, double linkprob)
layers
- the number of layers of vertices to create in the graphmaxNodesPerLayer
- the maximum number of vertices to put in any layerlinkprob
- the probability that this method will add an edge from a vertex in layer
k to a vertex in layer k+1public static Graph<String,Number> getOneComponentGraph()
public static Graph<String,Number> getDemoGraph()
Copyright © 2015. All rights reserved.