aboutsummaryrefslogtreecommitdiff
path: root/src/dk.biks.bachelorizer/dk
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-04-29 14:00:50 +0200
committerJonas Smedegaard <dr@jones.dk>2025-04-29 14:00:50 +0200
commit48424d617a60b209218a98264859edc445af061d (patch)
tree5413b3e07656a8c468e3e853f6b3924f77634996 /src/dk.biks.bachelorizer/dk
parentceb68ebcf08c063d28ab77430a85e0efb52462f2 (diff)
move comment above code
Diffstat (limited to 'src/dk.biks.bachelorizer/dk')
-rw-r--r--src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java b/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java
index ec4a35d..78ade2a 100644
--- a/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java
+++ b/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java
@@ -223,13 +223,19 @@ public final class Graph {
AbstractGraph h = new AdjListGraph();
Map<Set<Vertex>, String> groupLabel = new HashMap<>();
for (Set<Vertex> groupSet : sets) {
- // create a string for each group of module selections
+
+ // stringify each group of module selections
String name = groupSet.stream()
.map(Vertex::toString)
- .sorted() // avoid differently sorted duplicates
- .collect(Collectors.joining(", ", "{", "}"));
+
+ // avoid differently sorted duplicates
+ .sorted()
+
// formatting of groups as vertices
- groupLabel.put(groupSet, name); // map group to name of group
+ .collect(Collectors.joining(", ", "{", "}"));
+
+ // map group to name of group
+ groupLabel.put(groupSet, name);
}
for (Set<Vertex> s: sets) {
@@ -237,9 +243,13 @@ public final class Graph {
if (t == s) {
continue;
}
+
+ // process each pair only once
if (s.hashCode() > t.hashCode()) {
- continue; // process each pair no more than once
+ continue;
}
+
+ // accumulate student count across set
int sum = 0;
for (Vertex v: s) {
// students with this choice