Skip to contents

Prepares and normalizes the diffusion kernel matrix to be used in network diffusion.

Usage

prepare_diffusion(
  graph,
  method = c("laplacian", "heat", "rwr"),
  alpha = 0.7,
  t = 1,
  restart_prob = 0.3,
  normalize = TRUE
)

Arguments

graph

An igraph object or a data frame containing a symbolic edge list in the first two columns. Additional columns are considered as edge attributes.

method

Character string: one of "laplacian", "heat", or "rwr".

alpha

Numeric (used in "laplacian").

t

Time parameter (used in "heat").

restart_prob

Restart probability (used in "rwr").

Value

A matrix representing the diffusion kernel.