In previous version of this code, G_sim is only constructed with edgelist. If too many edges are pruned, leaving some vertices with no edges left, then these vertices won't be included in the G_sim graph, resulting in an error at the np.reshape step.
In previous version of this code, G_sim is only constructed with edgelist. If too many edges are pruned, leaving some vertices with no edges left, then these vertices won't be included in the G_sim graph, resulting in an error at the np.reshape step.