Constructor modifier to drop multiple and loop edges
See also
Constructor modifiers (and related functions):
make_(),
sample_(),
with_edge_(),
with_graph_(),
with_vertex_(),
without_attr(),
without_loops(),
without_multiples()
Examples
sample_(pa(10, m = 3, algorithm = "bag"))
#> ── <igraph> Barabasi graph ────────────────────────────────────────── 1d41aa7 ──
#> ℹ directed
#> ℹ 10 vertices · 27 edges
#>
#> ── Attributes ──────────────────────────────────────────────────────────────────
#> → graph: name <chr>, power <dbl>, m <dbl>, zero.appeal <dbl>, algorithm <chr>
#>
#> ── Edges ───────────────────────────────────────────────────────────────────────
#> [1] 2 → 1 2 → 1 2 → 1 3 → 1 3 → 1 3 → 2 4 → 1 4 → 1 4 → 1
#> [10] 5 → 1 5 → 1 5 → 1 6 → 1 6 → 1 6 → 2 7 → 1 7 → 1 7 → 1
#> [19] 8 → 2 8 → 1 8 → 1 9 → 1 9 → 6 9 → 2 10 → 2 10 → 8 10 → 1
sample_(pa(10, m = 3, algorithm = "bag"), simplified())
#> ── <igraph> Barabasi graph ────────────────────────────────────────── 1b956e3 ──
#> ℹ directed
#> ℹ 10 vertices · 13 edges
#>
#> ── Attributes ──────────────────────────────────────────────────────────────────
#> → graph: name <chr>, power <dbl>, m <dbl>, zero.appeal <dbl>, algorithm <chr>
#>
#> ── Edges ───────────────────────────────────────────────────────────────────────
#> [1] 2 → 1 3 → 1 3 → 2 4 → 1 4 → 2 5 → 1 5 → 4 6 → 1 7 → 1
#> [10] 8 → 1 8 → 2 9 → 1 10 → 1
