logic
Class GraphGenerator

java.lang.Object
  extended by logic.GraphGenerator

public class GraphGenerator
extends java.lang.Object

Author:
"Daniel Pardo" The GraphGenerator class provides methods to generate a random amount of nodes with randomly set links between those nodes

A internal counter for the nodeID is used to guarantee that same values for nodes are never used.

private static int numberOfNodes 

Two members define a graph. A List for the nodes and a HashMap of the neighborhood nodes with the ID as the key value

The GraphGenerator uses randomly generated values for the neighbors of a node. To obtain such values the java.util.Random class is used.


Nested Class Summary
static class GraphGenerator.Graph
           
 
Constructor Summary
GraphGenerator()
           
 
Method Summary
static GraphGenerator.Graph GenerateRandomGraph_constNodeSize(int numNodes, int nodeSize)
          Generates a random graph.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphGenerator

public GraphGenerator()
Method Detail

GenerateRandomGraph_constNodeSize

public static GraphGenerator.Graph GenerateRandomGraph_constNodeSize(int numNodes,
                                                                     int nodeSize)
Generates a random graph.

Parameters:
numNodes - the number of nodes
nodeSize - the size of nodes
Returns:
the generated graph