edu.uci.ics.jung.random.permuters
Class BernoulliEdgePermuter

java.lang.Object
  extended byedu.uci.ics.jung.random.permuters.BernoulliEdgePermuter
All Implemented Interfaces:
EdgePermuter

public class BernoulliEdgePermuter
extends java.lang.Object
implements EdgePermuter

An edge permuter that permutes edges by sampling uniformly at random a given number of possible edges and for each that exists that edge is removed and for each that doesn't exist that edge is added. The user can specify with what probability this should removal/addition process should happen.

Author:
Scott White

Constructor Summary
BernoulliEdgePermuter(int numEdgesToPermute)
          Constructs the edge permuter.
 
Method Summary
 void permuteEdges(Graph graph)
          Permutes the edges with default probability 1, meaning that if an edge is sample it will either be removed or added depending on whether it exists already
 void permuteEdges(Graph graph, double probEdgeFlip)
          Permutes the edges using a user-specified probability that an edge is removed or added.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BernoulliEdgePermuter

public BernoulliEdgePermuter(int numEdgesToPermute)
Constructs the edge permuter.

Parameters:
numEdgesToPermute - the number of edges to permute
Method Detail

permuteEdges

public void permuteEdges(Graph graph)
Permutes the edges with default probability 1, meaning that if an edge is sample it will either be removed or added depending on whether it exists already

Specified by:
permuteEdges in interface EdgePermuter
Parameters:
graph - the graph whose edges are to be permuted

permuteEdges

public void permuteEdges(Graph graph,
                         double probEdgeFlip)
Permutes the edges using a user-specified probability that an edge is removed or added.

Parameters:
graph - the graph whose edges are to be permuted
probEdgeFlip - the probability that if a possible edge is sample it is removed, if it already exists or added if it doesn't