aboutsummaryrefslogtreecommitdiff
path: root/src/com.example.portfolio3/com/example/portfolio3/AdjListGraph.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com.example.portfolio3/com/example/portfolio3/AdjListGraph.java')
-rw-r--r--src/com.example.portfolio3/com/example/portfolio3/AdjListGraph.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com.example.portfolio3/com/example/portfolio3/AdjListGraph.java b/src/com.example.portfolio3/com/example/portfolio3/AdjListGraph.java
index 8484d58..d9a5d19 100644
--- a/src/com.example.portfolio3/com/example/portfolio3/AdjListGraph.java
+++ b/src/com.example.portfolio3/com/example/portfolio3/AdjListGraph.java
@@ -8,7 +8,8 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-/// Adjecency List Graph - A map from vertices to set of outedges from the vertex
+/// Adjecency List Graph - A map from vertices
+/// to set of outedges from the vertex
public class AdjListGraph extends AbstractGraph {
/// foo
@@ -18,7 +19,9 @@ public class AdjListGraph extends AbstractGraph {
private Map<Vertex, Set<Edge>> outEdge = new HashMap<>();
/// foo
- public final void insertEdge(final Vertex v1, final Vertex v2, final int w) {
+ public final void insertEdge(
+ final Vertex v1, final Vertex v2, final int w
+ ) {
Edge e = new Edge(v1, v2, w);
if (!outEdge.containsKey(e.from())) {
outEdge.put(e.from(), new HashSet<Edge>());
@@ -46,7 +49,9 @@ public class AdjListGraph extends AbstractGraph {
}
/// foo
- public final Integer getWeight(final Vertex v1, final Vertex v2) {
+ public final Integer getWeight(
+ final Vertex v1, final Vertex v2
+ ) {
// linear in number of outedges from vertices
if (!outEdge.containsKey(v1)) {