simplify {igraph}R Documentation

Remove loop and/or multiple edges from a graph

Description

simplify removes the multiple and/or loop edges from a graph.

Usage

simplify(graph, remove.multiple = TRUE, remove.loops = TRUE)

Arguments

graph The graph to work on.
remove.loops Logical, whether the loop edges are to be removed.
remove.multiple Logical, whether the multiple edges are to be removed.

Details

If both remove.loops and remove.multiple are TRUE the function returns a simple graph.

Value

A new graph object with the edges deleted.

Author(s)

Gabor Csardi csardi@rmki.kfki.hu

See Also

delete.edges, delete.vertices

Examples

g <- graph( c(1,2,1,2,3,3) )
simplify(g, remove.loops=FALSE)
simplify(g, remove.multiple=FALSE)

[Package igraph version 0.2.1 Index]