Path between two nodes

igraph, another graph module for Python can calculate all the shortest paths between a given pair of nodes. Calculating all the paths does not make sense as you have infinitely many such paths. An example for calculating all the shortest paths from vertex 0: >>> from igraph import Graph >>> g = Graph.Lattice([10, 10], circular=False) … Read more

Network chord diagram woes in R

I made a bunch of changes to edgebundleR. These are now in the main repo. The following code should get you close to the desired result. live example # devtools::install_github(“garthtarr/edgebundleR”) library(edgebundleR) library(igraph) library(data.table) d <- structure(list(ID = c(“KP1009”, “GP3040”, “KP1757”, “GP2243”, “KP682”, “KP1789”, “KP1933”, “KP1662”, “KP1718”, “GP3339”, “GP4007”, “GP3398”, “GP6720”, “KP808”, “KP1154”, “KP748”, “GP4263”, “GP1132”, … Read more

How to make grouped layout in igraph?

Inspired on Antoine’s suggestion, I created this function: edge.weights <- function(community, network, weight.within = 100, weight.between = 1) { bridges <- crossing(communities = community, graph = network) weights <- ifelse(test = bridges, yes = weight.between, no = weight.within) return(weights) } The function does the same; just put your community object in the community slot, your … Read more