igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Subsetting a graph with set radius


From: Thomas Chesney
Subject: [igraph] Subsetting a graph with set radius
Date: Wed, 12 Aug 2015 10:22:26 +0000

Is there an easy way to select all nodes that are within path length K of a certain node? So if K=1 it would be the node's neighbours. If K=2 it would be the node's neighbours plus their neighbours' neighbours. The relevant nodes can of course be identified with the neighors() function as below but this gets very messy very quickly - is there a more direct way?

nodes <- c(neighbors(g,1), neighbors(g, neighbors(g,1)))

Thank you,

Thomas Chesney


This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it. 

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]