|
From: Simone G. <sim...@gm...> - 2013-05-11 15:20:27
|
Dear List,
I'd like to find all node's neighbors at distance two for a not so small
network (5000 nodes and 25k undirected edges). Right now I am using:
ArrayList<Node> twoDistNei = new ArrayList<Node>();
Collection<Node> myThreads = zpa.getNeighbors(u);
for(Node t:myThreads){
Collection<Node> neighbors = zpa.getNeighbors(t);
for(Node uu:neighbors){
if(!twoDistNei.contains(uu)){
twoDistNei.add(uu);
}
}
}
but I am wondering if there are more efficient and fast way to accomplish
this.
Many thanks for your help.
Best regards,
Simone
--
Simone Gabbriellini, PhD
PostDoc@DISI, University of Bologna
mobile: +39 340 39 75 626
email: sim...@un...
academia.edu: http://goo.gl/7pq62
DigitalBrains srl
Amministratore
mobile: +39 340 39 75 626
email: sim...@di...
home: www.digitalbrains.it
|