dprewire_directed: Degree preserving rewiring for directed networks

View source: R/rewire.R

dprewire_directedR Documentation

Degree preserving rewiring for directed networks

Description

Degree preserving rewiring towards the target structure eta.

Usage

dprewire_directed(
  edgelist,
  eta,
  iteration = 200,
  nattempts,
  rewire.history = FALSE
)

Arguments

edgelist

A two-column matrix, each row represents a directed edge from the first column to the second column.

eta

A matrix generated by wdnet::get_eta_directed().

iteration

An integer, the number of rewiring iterations, with each iteration consisting of nattempts rewiring attempts.

nattempts

An integer, the number of rewiring attempts for each iteration. Default value equals the number of rows in edgelist.

rewire.history

Logical, whether the rewiring history should be returned.

Value

Rewired edgelist, degree based assortativity coefficients after each iteration, rewiring history (including the index of sampled edges and rewiring result). For each rewiring attempt, two rows are sampled form the edgelist, for example Edge1:(v_1, v_2) and Edge2:(v_3, v_4). If the rewiring attempt is accepted, the sampled edges are replaced as (v_1, v_4), (v_3, v_2).


wdnet documentation built on May 29, 2024, 9:32 a.m.