|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object peersim.graph.GraphFactory
public class GraphFactory
Contains static methods for wiring certain kinds of graphs. The general contract of all methods is that they accept any graph and add edges as specified in the documentation.
Method Summary | |
---|---|
static Graph |
wireHypercube(Graph g)
A hypercube. |
static Graph |
wireKOut(Graph g,
int k,
java.util.Random r)
Random graph. |
static Graph |
wireRegRootedTree(Graph g,
int k)
A regular rooted tree. |
static Graph |
wireRingLattice(Graph g,
int k)
Wires a ring lattice. |
static Graph |
wireScaleFreeBA(Graph g,
int k,
java.util.Random r)
This contains the implementation of the Barabasi-Albert model of growing scale free networks. |
static Graph |
wireStar(Graph g)
A sink star. |
static Graph |
wireWS(Graph g,
int k,
double p,
java.util.Random r)
Watts-Strogatz model. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Graph wireRingLattice(Graph g, int k)
g
- the graph to be wiredk
- lattice parameter
public static Graph wireWS(Graph g, int k, double p, java.util.Random r)
Note that it is possible to pass an undirected graph as a parameter. In that case the output is the directed graph produced by the method, converted to an undirected graph by dropping directionality of the edges. This graph is still not from the original undirected WS model though.
g
- the graph to be wiredk
- lattice parameter: this is the out-degree of a node in the
ring lattice before rewiringp
- the probability of rewiring eachr
- source of randomness
public static Graph wireKOut(Graph g, int k, java.util.Random r)
g
- the graph to be wiredk
- samples to be drawn for each noder
- source of randomness
public static Graph wireStar(Graph g)
g
- the graph to be wired
public static Graph wireRegRootedTree(Graph g, int k)
g
- the graph to be wiredk
- the number of outgoing links of nodes in the tree (except
leaves that have zero out-links, and exactly one node that might have
less than k).
public static Graph wireHypercube(Graph g)
g
- the graph to be wired
public static Graph wireScaleFreeBA(Graph g, int k, java.util.Random r)
k
- the number of edges that are generated for each new node, also
the number of initial nodes (that have no edges).r
- the randomness to be used
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |