simplify: Remove multiple and loop edges from a graph

View source: R/multigraphs.R

simplifyR Documentation

Remove multiple and loop edges from a graph

Description

Remove multiple and loop edges from a graph

Usage

simplify(graph)

Arguments

graph

Input graph.

Value

Another graph, with the multiple and loop edges removed.

See Also

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

Examples

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

G2 <- simplify(G)
is_simple(G2)

simplegraph documentation built on Aug. 31, 2023, 9:07 a.m.