Calculate all pairs of shortest distances of unweighted network
Logical adjacency matrix of given unweighted network
Logical vector to indicate the source nodes that need to calculate the shortest distances
This function calculates all pairs of shortest distances of unweighted network by using breadth-first-search (BFS) algorithm.
This function will return the shortest distance matrix, where the element
[i, j] is the shortest distance between node i and j. Value -1 means unreachable.
source.nodes[i] equals FALSE, the shortest distance from i to other nodes
will not be calculated and the row i will be all -1.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.