Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    java.lang.Object
      edu.uci.ics.jung.random.permuters.BernoulliEdgePermuter

All Implemented Interfaces:
  EdgePermuter

public class BernoulliEdgePermuter
extends 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
`protected void` | `initialize(Graph g)`
`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
`clone, equals, finalize, 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

### initialize

    protected void initialize(Graph g)

### 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD