A Reconstruction algorithm for an unknown network