graph.diffusionSnapShot {CTD} R Documentation

## Capture the current state of probability diffusion

### Description

Recursively diffuse probability from a starting node based on the connectivity in a network, G, where the probability represents the likelihood that a variable will be influenced by a perturbation in the starting node.

### Usage

graph.diffusionSnapShot(adj_mat,G,output_dir,p1,startNode,
visitedNodes,recursion_level,coords)


### Arguments

 adj_mat - The adjacency matrix that encodes the edge weights for the network, G. G - A list of probabilities, with names of the list being the node names in the network. output_dir - The local directory at which you want still PNG images to be saved. p1 - The probability being dispersed from the starting node, startNode, which is preferentially distributed between network nodes by the probability diffusion algorithm based solely on network connectivity. startNode - The first variable drawn in the node ranking, from which p1 gets dispersed. visitedNodes - A character vector of node names, storing the history of previous draws in the node ranking. recursion_level - The current depth in the call stack caused by a recursive algorithm. coords - The x and y coordinates for each node in the network, to remain static between images.

0

### Examples

# 7 node example graph illustrating diffusion of probability based on
# network connectivity.
c(2,0,1,0,0,0,0), # B
c(1,0,0,1,0,0,0), # C
c(0,0,1,0,2,0,0), # D
c(0,0,0,2,0,2,1), # E
c(0,0,0,1,2,0,1), # F
c(0,0,0,0,1,1,0)  # G
)
rownames(adj_mat) = c("A", "B", "C", "D", "E", "F", "G")
colnames(adj_mat) = c("A", "B", "C", "D", "E", "F", "G")
V(ig)$x = coords[,1] V(ig)$y = coords[,2]