simplify

0th

Percentile

Simple graphs

Simple graphs are graphs which do not contain loop and multiple edges.

Keywords
graphs
Usage
simplify(graph, remove.multiple = TRUE, remove.loops = TRUE,
         edge.attr.comb = getIgraphOpt("edge.attr.comb"))
is.simple(graph)
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.
edge.attr.comb
Specifies what to do with edge attributes, if remove.multiple=TRUE. In this case many edges might be mapped to a single one in the new graph, and their attributes are combined. Please see
Details

A loop edge is an edge for which the two endpoints are the same vertex. Two edges are multiple edges if they have exactly the same two endpoints (for directed graphs order does matter). A graph is simple is it does not contain loop edges and multiple edges.

is.simple checks whether a graph is simple.

simplify removes the loop and/or multiple edges from a graph. If both remove.loops and remove.multiple are TRUE the function returns a simple graph.

Value

  • A new graph object with the edges deleted.

concept

Simple graph

See Also

is.loop, is.multiple and count.multiple, delete.edges, delete.vertices

Aliases
  • simplify
  • is.simple
Examples
g <- graph( c(1,2,1,2,3,3) )
is.simple(g)
is.simple(simplify(g, remove.loops=FALSE))
is.simple(simplify(g, remove.multiple=FALSE))
is.simple(simplify(g))
Documentation reproduced from package igraph, version 0.6.5-2, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.