simplegraph (version 1.0.1)

simplify: Remove multiple and loop edges from a graph

Description

Remove multiple and loop edges from a graph

Usage

simplify(graph)

Value

Another graph, with the multiple and loop edges removed.

Arguments

graph

Input graph.

See Also

Other multigraphs: is_loopy(), is_multigraph(), is_simple(), remove_loops(), remove_multiple()

Examples

Run this code
G <- graph(list(A = c("A", "B", "B"), B = c("A", "C"), C = "A"))
is_simple(G)

G2 <- simplify(G)
is_simple(G2)

Run the code above in your browser using DataLab