public class GraphLib
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LABEL
Label data field included in generated Graphs
|
static Schema |
LABEL_SCHEMA
Node table schema used for generated Graphs
|
Modifier and Type | Method and Description |
---|---|
static Tree |
getBalancedTree(int breadth,
int depth)
Returns a balanced tree of the requested breadth and depth.
|
static Graph |
getClique(int n)
Returns a clique of given size.
|
static Tree |
getDiamondTree(int b,
int d1,
int d2)
Create a diamond tree, with a given branching factor at
each level, and depth levels for the two main branches.
|
static Graph |
getGrid(int m,
int n)
Returns a graph structured as an m-by-n grid.
|
static Graph |
getHoneycomb(int levels) |
static Tree |
getLeftDeepTree(int depth)
Returns a left deep binary tree
|
static Graph |
getNodes(int n)
Builds a completely unconnected (edge-free) graph with the given
number of nodes
|
static Tree |
getRightDeepTree(int depth)
Returns a right deep binary tree
|
static Graph |
getStar(int n)
Builds a "star" graph with one central hub connected to the given
number of satellite nodes.
|
public static final java.lang.String LABEL
public static final Schema LABEL_SCHEMA
public static Graph getNodes(int n)
n
- the number of nodespublic static Graph getStar(int n)
n
- the number of points of the starpublic static Graph getClique(int n)
n
- the number of nodes in the graphpublic static Graph getGrid(int m, int n)
m
- the number of rows of the gridn
- the number of columns of the gridpublic static Graph getHoneycomb(int levels)
public static Tree getBalancedTree(int breadth, int depth)
breadth
- the breadth of each level of the treedepth
- the depth of the treepublic static Tree getLeftDeepTree(int depth)
depth
- the depth of the treepublic static Tree getRightDeepTree(int depth)
depth
- the depth of the treepublic static Tree getDiamondTree(int b, int d1, int d2)
b
- the number of children of each branch noded1
- the length of the first (left) branchd2
- the length of the second (right) branchCopyright ? 2013 Regents of the University of California