Commit 0dd009c3 authored by gsavin's avatar gsavin

Fix bug in edge connectivity when there is less than 2 nodes.

parent e8e1c066
......@@ -117,6 +117,9 @@ public class ConnectivityMeasure {
int k = Integer.MAX_VALUE;
EdmondsKarpAlgorithm flow = new EdmondsKarpAlgorithm();
if (g.getNodeCount() < 2)
return 0;
for (int u = 0; u < g.getNodeCount() - 1; u++) {
for (int v = u + 1; v < g.getNodeCount(); v++) {
flow.init(g, g.getNode(u).getId(), g.getNode(v).getId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment