edu.uci.ics.jung.algorithms.generators.random
Class KleinbergSmallWorldGenerator<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.algorithms.generators.Lattice2DGenerator<V,E>
      extended by edu.uci.ics.jung.algorithms.generators.random.KleinbergSmallWorldGenerator<V,E>
All Implemented Interfaces:
GraphGenerator<V,E>

public class KleinbergSmallWorldGenerator<V,E>
extends Lattice2DGenerator<V,E>

Graph generator that produces a random graph with small world properties. The underlying model is an mxn (optionally toroidal) lattice. Each node u has four local connections, one to each of its neighbors, and in addition 1+ long range connections to some node v where v is chosen randomly according to probability proportional to d^-alpha where d is the lattice distance between u and v and alpha is the clustering exponent.

Author:
Joshua O'Madadhain
See Also:
"Navigation in a small world J. Kleinberg, Nature 406(2000), 845."

Field Summary
 
Fields inherited from class edu.uci.ics.jung.algorithms.generators.Lattice2DGenerator
col_count, edge_factory, graph_factory, is_directed, is_toroidal, row_count, vertex_factory
 
Constructor Summary
KleinbergSmallWorldGenerator( graph_factory,  vertex_factory,  edge_factory, int latticeSize, double clusteringExponent)
          Creates
KleinbergSmallWorldGenerator( graph_factory,  vertex_factory,  edge_factory, int row_count, int col_count, double clusteringExponent)
           
KleinbergSmallWorldGenerator( graph_factory,  vertex_factory,  edge_factory, int row_count, int col_count, double clusteringExponent, boolean isToroidal)
           
 
Method Summary
 Graph<V,E> create()
          Generates a random small world network according to the parameters given
 int getConnectionCount()
          Returns the number of new 'small-world' connections to be made to each vertex.
 void setConnectionCount(int num_connections)
          Sets the number of new 'small-world' connections (outgoing edges) to be added to each vertex.
 void setRandom(Random random)
          Sets the Random instance used by this instance.
 void setRandomSeed(long seed)
          Sets the seed of the internal random number generator.
 
Methods inherited from class edu.uci.ics.jung.algorithms.generators.Lattice2DGenerator
getCol, getGridEdgeCount, getIndex, getRow, getVertex, getVertex, mod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KleinbergSmallWorldGenerator

public KleinbergSmallWorldGenerator( graph_factory,
                                     vertex_factory,
                                     edge_factory,
                                    int latticeSize,
                                    double clusteringExponent)
Creates

Parameters:
graph_factory -
vertex_factory -
edge_factory -
latticeSize -
clusteringExponent -

KleinbergSmallWorldGenerator

public KleinbergSmallWorldGenerator( graph_factory,
                                     vertex_factory,
                                     edge_factory,
                                    int row_count,
                                    int col_count,
                                    double clusteringExponent)
Parameters:
graph_factory -
vertex_factory -
edge_factory -
row_count -
col_count -
clusteringExponent -

KleinbergSmallWorldGenerator

public KleinbergSmallWorldGenerator( graph_factory,
                                     vertex_factory,
                                     edge_factory,
                                    int row_count,
                                    int col_count,
                                    double clusteringExponent,
                                    boolean isToroidal)
Parameters:
graph_factory -
vertex_factory -
edge_factory -
row_count -
col_count -
clusteringExponent -
isToroidal -
Method Detail

setRandom

public void setRandom(Random random)
Sets the Random instance used by this instance. Useful for unit testing.


setRandomSeed

public void setRandomSeed(long seed)
Sets the seed of the internal random number generator. May be used to provide repeatable experiments.


setConnectionCount

public void setConnectionCount(int num_connections)
Sets the number of new 'small-world' connections (outgoing edges) to be added to each vertex.


getConnectionCount

public int getConnectionCount()
Returns the number of new 'small-world' connections to be made to each vertex.


create

public Graph<V,E> create()
Generates a random small world network according to the parameters given

Overrides:
create in class Lattice2DGenerator<V,E>
Returns:
a random small world graph
See Also:
edu.uci.ics.jung.algorithms.generators.GraphGenerator#create()


Copyright © 2010 null. All Rights Reserved.