Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/GraphDiffusion.R
Using a diffusion kernelbased algorithm, compute the distance between vertex pairs in an undirected network, with or without edge weights. This algorithm provides an alternative to the shortest.paths
and mfpt
measures of vertex pair distance.
1  GraphDiffusion(g, v=V(g), edge.attr.weight=NULL, beta=1, correct.neg=TRUE)

g 

v 

edge.attr.weight 
String, the name of the edge attribute to be used as weights along the edges. Greater weights indicate a stronger interaction between the two genes (this is the opposite to edge distances, where smaller distances indicate stronger interactions). If 
beta 
Numeric value, the probability that the diffusion process will take an edge emanating from a vertex. 
correct.neg 
Logical, if 
Diffusion across a network follows a process similar to a random walk. This provides a method of measuring the distance between vertex pairs that does not simply take into account a single path (like the shortest.paths
algorithm) but instead incorporates multiple paths. This function uses a diffusion kernelbased approach to compute distances. The algorithm implemented is detailed in the referenced paper.
The distance from vertex A to vertex A is always 0
.
Numeric matrix, containing the diffusion kernelbased vertex pair distances between each vertex in v
and every vertex in g
.
Alex J. Cornish a.cornish12@imperial.ac.uk
Kondor, R.I. and Lafferty, J. (2002). Diffusion Kernels on Graph and Other Discrete Structures. Proc. Intl. Conf. Machine Learning.
1 2 3 4  # create a network and computes the diffusion kernelderived vertex pair distance matrix
g < barabasi.game(6, directed=FALSE)
GraphDiffusion(g)
plot(g, layout=layout.fruchterman.reingold)

Loading required package: igraph
Attaching package: 'igraph'
The following objects are masked from 'package:stats':
decompose, spectrum
The following object is masked from 'package:base':
union
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.0000000 0.4404859 0.4421952 0.7680472 0.7581080 0.7680472
[2,] 0.4404859 0.0000000 0.6518802 0.8782897 0.4934081 0.8782897
[3,] 0.4421952 0.6518802 0.0000000 0.5100285 0.8407141 0.5100285
[4,] 0.7680472 0.8782897 0.5100285 0.0000000 1.0011557 0.8577639
[5,] 0.7581080 0.4934081 0.8407141 1.0011557 0.0000000 1.0011557
[6,] 0.7680472 0.8782897 0.5100285 0.8577639 1.0011557 0.0000000
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.