adding getNeighbors for each node in the graph