# Neighborhood with Weights

**URL:** https://igraph.discourse.group/t/neighborhood-with-weights/809
**Category:** Usage
**Tags:** Python
**Created:** [3 August 2021 21:08 UTC](https://igraph.discourse.group/t/neighborhood-with-weights/809 "2021-08-03T21:08:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kidilam](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@kidilam](https://igraph.discourse.group/u/kidilam)
#### Post date: [3 August 2021 21:08 UTC](https://igraph.discourse.group/t/neighborhood-with-weights/809/1 "2021-08-03T21:08:34Z")

</div>

Is there a way to find all nodes that are within a threshold distance (in terms of sum of edge weights) from a given node? Essentially what I am looking for is something like the “neighborhood” function that also considers edge weights or a “shortest\_path” function that allows for a distance cutoff.

Thanks.

---

<div class="post-metadata">

### Author: ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)
#### Post date: [4 August 2021 07:54 UTC](https://igraph.discourse.group/t/neighborhood-with-weights/809/2 "2021-08-04T07:54:03Z")

</div>

Not yet.

You can add a comment to the relevant feature requests to indicate your interest. When more people want a feature, there’s a higher chance that it gets implemented sooner.

> <https://github.com/igraph/igraph/issues/918>
>
> The built-in function \[neighborhood.size(graph, order, nodes=V(graph), ,,,)\](htt…p://www.inside-r.org/packages/cran/igraph/docs/neighborhood) is implemented for an integer order (0, 1, 2, 3). 
> 
> It would be usefull to write a code for non-integer order, for example, r=1.5; 2.5, 3.5.
> Here is an example for order =1, 1.5, and 2: http://scalar.usc.edu/works/querying-social-media-with-nodexl/media/TwoDegreesArticleNetworkonWikipedia.jpg
> Here is a possible solution for the order = 1.5:
> http://stackoverflow.com/questions/32470713/how-to-calculate-the-neighborhood-of-a-graph-with-order-1-5
> 
> Mailing list reference: http://lists.nongnu.org/archive/html/igraph-help/2016-02/msg00000.html

> <https://github.com/igraph/igraph/issues/720>
>
> It would be great to have \`max\_depth\` parameter which restricts the maximum leng…th of shortest path. I believe it is not too hard to add this feature to BFS, Dijkstra, Bellman-Ford algorithms.
