graph.dist {statGraph} | R Documentation |
Distance Matrix on a List of Graphs
Description
Given a list of graphs, graph.dist
builds a distance matrix
according to the Jensen-Shannon divergence, L2 norm, or L1 norm
between the spectral density of the graphs graphs.
Usage
graph.dist(Graphs, dist = "JS", ...)
Arguments
Graphs |
a list of undirected graphs.
If each graph has the attribute |
dist |
string indicating if you want to use the 'JS' (default), 'L1' or 'L2' distances. 'JS' means Jensen-Shannon divergence. |
... |
Other relevant parameters for |
Value
a distance matrix
Examples
set.seed(1)
g <- list()
for(i in 1:5){
g[[i]] <- igraph::sample_gnp(n=50, p=0.1)
}
for(i in 6:10){
g[[i]] <- igraph::sample_gnp(n=50, p=0.5)
}
for(i in 11:15){
g[[i]] <- igraph::sample_gnp(n=50, p=0.9)
}
graph.dist(g, dist = 'JS')
[Package statGraph version 1.0.3 Index]