rewire {igraph} | R Documentation

## Graph rewiring

### Description

Randomly rewires a graph while preserving the degree distribution.

### Usage

    rewire(graph, mode = "simple", niter = 100)

### Arguments

`graph` | The graph to be rewired.
`mode` | The rewiring algorithm to be used. It can be one of the following: `simple`: simple rewiring algorithm which chooses two arbitrary edges in each step (namely (a,b) and (c,d)) and substitutes them with (a,d) and (c,b) if they don't yet exist.
`niter` | Number of rewiring trials to perform.

### Details

This function generates a new graph based on the original one by randomly rewiring edges while preserving the original graph's degree distribution.

### Value

A new graph object.

### Author(s)

Tamas Nepusz ntamas@rmki.kfki.hu and Gabor Csardi csardi@rmki.kfki.hu

### See Also

`degree.sequence.game`

### Examples

    g <- graph.ring(20)
    g2 <- rewire(g, niter=3)

[Package igraph version 0.5.2 Index]