Dear all, I am looking for a function to select the N closest neighbors (in terms of distance) of a vertex in igraph.
Assume for example N=7. If the vertex has 3 direct neighbors, I would like that the function selects those 3 plus a random 4 among the second degree neighbors. Is there some way to do this in an efficient way? I have been trying to program something using ego () with varying levels of distance but I have not managed to get a conclusive solution. Thanks for your help, Michael Michael Haenlein Professor of Marketing ESCP Europe [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.