initialize sources, dest, nodes, edges arrays at the end of each iteration