From eb30c23bb03579bf839189ab0d2ad172d5b07766 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Sun, 21 Feb 2016 15:41:54 -0500 Subject: Commenting of various things and minor refactoring --- BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java b/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java index 69e42e4..03bc0c2 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java +++ b/BJC-Utils2/src/main/java/bjc/utils/graph/Graph.java @@ -13,6 +13,8 @@ import java.util.Set; import java.util.function.BiConsumer; import java.util.function.BiPredicate; +import bjc.utils.data.GenHolder; + /** * A directed weighted graph, where the vertices have some arbitrary label * @@ -23,6 +25,9 @@ import java.util.function.BiPredicate; */ public class Graph { + /** + * The backing representation of the graph + */ private final Map> graph; /** @@ -165,6 +170,11 @@ public class Graph { return minEdges; } + /** + * Get the count of the vertices in this graph + * + * @return A count of the vertices in this graph + */ public int getVertexCount() { return graph.size(); } @@ -225,6 +235,13 @@ public class Graph { return aMap; } + /** + * Create a graph from a list of edges + * + * @param edges + * The list of edges to build from + * @return A graph built from the provided edge-list + */ public static Graph fromEdgeList(List> edges) { Graph g = new Graph<>(); -- cgit v1.2.3