graph.dist | R Documentation |
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.
graph.dist(Graphs, dist = "JS", ...)
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 |
a distance matrix
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.