diff options
-rw-r--r-- | src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java b/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java index 5131b83..a7689f8 100644 --- a/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java +++ b/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java @@ -88,7 +88,7 @@ public final class Graph extends Storage { GraphAlgorithms.readGraph(g, path); } - /// utility function to check that a graph is connected + /// check that a graph is connected /// /// If check fails, throw an unchecked exception, /// since it occurs at runtime and is unrecoverable. @@ -97,10 +97,9 @@ public final class Graph extends Storage { /// where n is the amount of vertices, /// since visitDepthFirst() recurses out-edges of all vertices. /// - /// @param g Graph to inspect /// @throws IllegalArgumentException /// https://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html - public static void assertConnected(final AbstractGraph g) { + public void assertConnected() { // collect all vertices in the graph Collection<Vertex> c = g.vertices(); @@ -294,7 +293,7 @@ public final class Graph extends Storage { GraphAlgorithms.printGraph(g); // ensure the graph is connected - assertConnected(g); + assertConnected(); System.out.println( "\n\nGraph is connected" + " (otherwise an exception was thrown)"); |