A graph with random subgraphs connected by negative edges
Source:R/random_graphs.R
sample_islands_signed.Rd
Create a number of Erdos-Renyi random graphs with identical parameters, and connect them with the specified number of negative ties.
Arguments
- islands.n
The number of islands in the graph.
- islands.size
The size of the islands in the graph.
- islands.pin
The probability of intra-island edges.
- n.inter
number of negative edges between two islands.
Examples
library(igraph)
sample_islands_signed(3, 10, 0.5, 1)
#> IGRAPH 3cfe40d U--- 30 74 --
#> + attr: grp (v/c), sign (e/n)
#> + edges from 3cfe40d:
#> [1] 1-- 4 1-- 7 1-- 9 1--10 2-- 3 2-- 7 2-- 9 2--10 3-- 4 3-- 6
#> [11] 3-- 8 3-- 9 3--10 4-- 5 4-- 8 5-- 6 5-- 7 5-- 8 5-- 9 5--10
#> [21] 6-- 8 6--10 7-- 8 8--10 11--13 11--14 11--15 11--17 12--16 12--18
#> [31] 13--14 13--15 13--16 13--19 13--20 14--15 14--16 14--17 14--19 14--20
#> [41] 15--16 15--17 15--18 15--20 16--17 16--18 16--20 17--18 18--20 21--23
#> [51] 21--25 21--27 21--28 22--23 22--26 22--29 22--30 23--24 23--28 23--29
#> [61] 24--25 24--27 24--28 24--29 25--27 25--30 26--27 26--28 26--30 27--28
#> [71] 29--30 3--26 3--20 7--23