Graph Diffusion Distance (nd.gdd) quantifies the difference between two weighted graphs of same size. It takes an idea from heat diffusion process on graphs via graph Laplacian exponential kernel matrices. For a given adjacency matrix A, the graph Laplacian is defined as [REMOVE_ME]L:=D−A[REMOVEME2]
where Dii=∑jAij. For two adjacency matrices A1 and A2, GDD is defined as [REMOVE_ME]dgdd(A1,A2)=maxt∥exp(−tL1)−exp(−tL2)∥F2[REMOVEME2]
where exp(⋅) is matrix exponential, ∥⋅∥F a Frobenius norm, and L1 and L2
Laplacian matrices corresponding to A1 and A2, respectively.
A: a list of length N containing adjacency matrices.
out.dist: a logical; TRUE for computed distance matrix as a dist object.
vect: a vector of parameters t whose values will be used.
Returns
a named list containing
D: an (N×N) matrix or dist object containing pairwise distance measures.
maxt: an (N×N) matrix whose entries are maximizer of the cost function.
Description
Graph Diffusion Distance (nd.gdd) quantifies the difference between two weighted graphs of same size. It takes an idea from heat diffusion process on graphs via graph Laplacian exponential kernel matrices. For a given adjacency matrix A, the graph Laplacian is defined as
L:=D−A
where Dii=∑jAij. For two adjacency matrices A1 and A2, GDD is defined as
dgdd(A1,A2)=maxt∥exp(−tL1)−exp(−tL2)∥F2
where exp(⋅) is matrix exponential, ∥⋅∥F a Frobenius norm, and L1 and L2
Laplacian matrices corresponding to A1 and A2, respectively.
Examples
## load data and extract a subsetdata(graph20)gr.small = graph20[c(1:5,11:15)]## compute distance matrixoutput = nd.gdd(gr.small, out.dist=FALSE)## visualizeopar = par(no.readonly=TRUE)par(pty="s")image(output$D[,10:1], main="two group case", col=gray((0:32)/32), axes=FALSE)par(opar)