On 11.09.2015 13:59, Christopher Morris wrote:
> Hello,
>
> given an undirected, unweighted graph and a vertex v, I want to
> compute the k-disk around v, i.e. the induced subgraph of vertices at
> a distanst at most k from v.
>
> Of course, this can be easily be done by a variation of BFS or DFS. Is
> it possible do use graph_tool.search.bfs_search in some way for this?

Just do:

     dist = shortest_distance(g, source=v)
     k_disk = GraphView(g, vfilt=dist.fa <= k)

Best,
Tiago

-- 
Tiago de Paula Peixoto <[email protected]>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
graph-tool mailing list
[email protected]
http://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to