function get_neighList(nodes, links){
let neighList = new Array(nodes.length);
for (let node in nodes) {
let neighbours = new Array();
neighbours.push(nodes[node].index);
for (let i=0; i<links.length; i++) {
if (links[i].sourceId === nodes[node].index) {
neighbours.push(links[i].targetId);
}
if (links[i].targetId === nodes[node].index) {
neighbours.push(links[i].sourceId);
}
}
if (neighbours.length > 1)
neighList[node] = neighbours;
}
return neighList;
}