Delete edges from a graph
See also
Other functions for manipulating graph structure:
+.igraph(),
add_edges(),
add_vertices(),
complementer(),
compose(),
connect(),
contract(),
delete_vertices(),
difference(),
difference.igraph(),
disjoint_union(),
edge(),
igraph-minus,
intersection(),
intersection.igraph(),
path(),
permute(),
rep.igraph(),
reverse_edges(),
simplify(),
transitive_closure(),
union(),
union.igraph(),
vertex()
Examples
g <- make_ring(10) %>%
delete_edges(seq(1, 9, by = 2))
g
#> IGRAPH 06ebc49 U--- 10 5 -- Ring graph
#> + attr: name (g/c), mutual (g/l), circular (g/l)
#> + edges from 06ebc49:
#> [1] 2-- 3 4-- 5 6-- 7 8-- 9 1--10
g <- make_ring(10) %>%
delete_edges("10|1")
g
#> IGRAPH 62bcd8e U--- 10 9 -- Ring graph
#> + attr: name (g/c), mutual (g/l), circular (g/l)
#> + edges from 62bcd8e:
#> [1] 1-- 2 2-- 3 3-- 4 4-- 5 5-- 6 6-- 7 7-- 8 8-- 9 9--10
g <- make_ring(5)
g <- delete_edges(g, get_edge_ids(g, c(1, 5, 4, 5)))
g
#> IGRAPH a7630d9 U--- 5 3 -- Ring graph
#> + attr: name (g/c), mutual (g/l), circular (g/l)
#> + edges from a7630d9:
#> [1] 1--2 2--3 3--4
