igraph (version 0.1.2)

simplify: 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.

Value

  • A new graph object with the edges deleted.

Details

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

See Also

delete.edges, delete.vertices

Examples

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

Run the code above in your browser using DataCamp Workspace