Add panel for WCC like SP.

This commit is contained in:
Holt59
2018-03-05 22:40:32 +01:00
parent 426867a302
commit c4b4455287
3 changed files with 198 additions and 73 deletions

View File

@@ -32,4 +32,26 @@ public class WeaklyConnectedComponentsSolution extends AbstractSolution {
return components;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
int nIsolated = 0;
int nGt10 = 0;
for (ArrayList<Node> component: components) {
if (component.size() == 1) {
nIsolated += 1;
}
else if (component.size() > 10) {
nGt10 += 1;
}
}
return "Found " + components.size() + " components (" + nGt10 + " with more than 10 nodes, "
+ nIsolated + " isolated nodes) in " + getSolvingTime().getSeconds() + " seconds.";
}
}