Keep track of the network connectedness, and halt the iteration when the network becomes disconnected. This will prevent the embeddings based on SVD or eigendecomposition from failing due to insufficient rank of the matrix to be decomposed.
The new version of scipy complained data type mismatch when computing the shortest Path length. To prevent this, added a code to ensure that the (weighted) adjacency matrix is float.
Update