Extract subnetwork/graph within a given distance from a vertex

I am looking for a feature of igraph to extract a subnetwork based on distances from a known vertex. Basically, I have a route-able river network available as an igraph object. The river network comprises of stream segments and nodes (i.e. confluences). Now, I have the ID of a specific vertex node which is very central in my network. Starting from that vertex, I’d like extract a sub-network that is within a distance from that node. There is a column “LE” in my edge-layer which represents the length of each edge and which could/should be used as weight.

I tried “shortest_paths”, which generally works but I’m not sure if this is the way to go for my task:

sp1 <- shortest_paths(
   from= 1099, # the vertex of interest
   to = V(g),
   mode = "all",
   weights = E(g)$LE # length of each edge in real world

What would be the correct function to extract such a subnetwork which is all edges within a distance of e.g. 5000 meters from my starting vertex? I could imagine that there is a specific function in the igraph package that exactly performs such tasks(?)

neighborhood() (combined with induced_subgraph()) does this, but does not support weights yet. I’ll put in a feature request for weight support.

For now you will need to use shortest_paths() for weighted graphs.