| java.lang.Object org.geotools.graph.GraphTestUtil
GraphTestUtil | public class GraphTestUtil (Code) | | |
Method Summary | |
public static Node[] | buildCircular(GraphBuilder builder, int nnodes) | public static Node[] | buildCircular(GraphGenerator gen, int nnodes) | public static Node[] | buildNoBifurcations(GraphBuilder builder, int nnodes) Builds a graph with no bifurcations made up of a specified number of nodes.
Nodes are numbered from 0 to (# of nodes - 1).
O----O----O--...--O----O----O
Parameters: builder - Builder to use to construct graph. Parameters: nnodes - Number of nodes in graph. | public static Node[] | buildNoBifurcations(GraphGenerator gen, int nnodes) | public static Object[] | buildNoBifurcations(OptGraphBuilder builder, int nnodes) | public static Object[] | buildNoBifurcations(OptDirectedGraphBuilder builder, int nnodes) | public static Object[] | buildPerfectBinaryTree(GraphBuilder builder, int levels) Creates a balanced binary tree consisting of a specefied number of levels. | public static Object[] | buildPerfectBinaryTree(OptGraphBuilder builder, int levels) | public static Object[] | buildPerfectBinaryTree(OptDirectedGraphBuilder builder, int levels) | public static Node[] | buildSingleBifurcation(GraphBuilder builder, int nnodes, int bifurcation) |
buildNoBifurcations | public static Node[] buildNoBifurcations(GraphBuilder builder, int nnodes)(Code) | | Builds a graph with no bifurcations made up of a specified number of nodes.
Nodes are numbered from 0 to (# of nodes - 1).
O----O----O--...--O----O----O
Parameters: builder - Builder to use to construct graph. Parameters: nnodes - Number of nodes in graph. 2 element object array containing references to the end points of the graph. (The nodes of degree 1 at the end of the graph. |
buildPerfectBinaryTree | public static Object[] buildPerfectBinaryTree(GraphBuilder builder, int levels)(Code) | | Creates a balanced binary tree consisting of a specefied number of levels.
Each node created contains a string representing the nodes location in
the tree.
locstring(root) = "0";
locstring(node) = locstring(parent) + ".0" (if left child);
locstring(node) = locstring(parent) + ".1" (if right child);
Parameters: builder - Builder to construct graph with Parameters: levels - Number of levels in the tree. A 2 element object array.0 = root node1 = map of locstring to node |
buildSingleBifurcation | public static Node[] buildSingleBifurcation(GraphBuilder builder, int nnodes, int bifurcation)(Code) | | |
|
|