Degree preserving rewiring towards the target structure eta.
dprewire_undirected(
edgelist,
eta,
iteration = 200,
nattempts,
rewire.history = FALSE
)Rewired edgelist, assortativity coefficient after each iteration, and rewiring history (including the index of sampled edges and rewiring result). For each rewiring attempt, two rows are sampled from the
edgelist, for example Edge1:{v_1, v_2} and Edge2:{v_3, v_4}, the
function try to rewire the sampled edges as {v_1, v_4}, {v_3, v_2}
(rewire type 1) or {v_1, v_3}, {v_2, v_4} (rewire type 2) with
probability 1/2.
A two column matrix, each row represents an undirected edge.
A matrix generated by wdnet::get_eta_undirected().
An integer, number of rewiring iterations, each iteration
consists of nattempts rewiring attempts.
An integer, number of rewiring attempts for each iteration.
The default value equals the number of rows in edgelist.
Logical, whether the rewiring history should be returned.