diff options
author | Jonas Smedegaard <dr@jones.dk> | 2025-04-29 08:40:12 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2025-04-29 08:40:12 +0200 |
commit | ee6931fb82c04aa94ceaab76e91925adcb493998 (patch) | |
tree | b8431ce4485c6e941f3e5ab38d1b78d487530246 /src/com.example.portfolio3/com/example/portfolio3/GraphAlgorithms.java | |
parent | 56362295799741bec6ffe5c7713dbc2f1ee86dd7 (diff) |
tidy whitespace
Diffstat (limited to 'src/com.example.portfolio3/com/example/portfolio3/GraphAlgorithms.java')
-rw-r--r-- | src/com.example.portfolio3/com/example/portfolio3/GraphAlgorithms.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com.example.portfolio3/com/example/portfolio3/GraphAlgorithms.java b/src/com.example.portfolio3/com/example/portfolio3/GraphAlgorithms.java index 0fbc3ed..4d8a8c2 100644 --- a/src/com.example.portfolio3/com/example/portfolio3/GraphAlgorithms.java +++ b/src/com.example.portfolio3/com/example/portfolio3/GraphAlgorithms.java @@ -57,7 +57,7 @@ public class GraphAlgorithms { public static Integer pathLength(final Graph g, final List<Vertex> path) { int length = 0; for (int i = 1; i < path.size(); i++) { - Integer w = g.getWeight(path.get(i - 1),path.get(i)); + Integer w = g.getWeight(path.get(i - 1), path.get(i)); if (w == null) { return null; } @@ -292,8 +292,8 @@ public class GraphAlgorithms { // create table for done, prev and weight from start int maxint = Integer.MAX_VALUE; HashSet<Vertex> done = new HashSet<>(); - HashMap<Vertex,Edge> prev = new HashMap<>(); - HashMap<Vertex,Integer> weight = new HashMap<>(); + HashMap<Vertex, Edge> prev = new HashMap<>(); + HashMap<Vertex, Integer> weight = new HashMap<>(); for (Vertex w: g.vertices()) { weight.put(w, maxint); } @@ -337,8 +337,8 @@ public class GraphAlgorithms { } } done.add(nearest); - prev.put(nearest,done2near); - weight.put(nearest,neardist); + prev.put(nearest, done2near); + weight.put(nearest, neardist); } return new HashSet<Edge>(prev.values()); |