# rewire.edges

From igraph v0.4.4
by Gabor Csardi

##### Rewires the endpoints of the edges of a graph randomly

This function rewires the endpoints of the edges with a constant probability uniformly randomly to a new vertex in a graph.

- Keywords
- graphs

##### Usage

`rewire.edges(graph, prob)`

##### Arguments

- graph
- The input graph
- prob
- The rewiring probability, a real number between zero and one.

##### Details

Note that this function might create graphs with multiple and/or loop edges.

##### Value

- A new graph object.

##### Examples

```
# Some random shortcuts shorten the distances on a lattice
g <- graph.lattice( length=100, dim=1, nei=5 )
average.path.length(g)
g <- rewire.edges( g, prob=0.05 )
average.path.length(g)
```

*Documentation reproduced from package igraph, version 0.4.4, License: GPL version 2 or later (June, 1991)*

### Community examples

Looks like there are no examples yet.