From 83217c41f0bbc2378391553460564702f1e24067 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 1 May 2025 13:23:49 +0200 Subject: rename functions goodSolution() -> solveManyTimes(), solution() -> solve() --- src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java b/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java index dde2a24..303a4a0 100644 --- a/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java +++ b/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Graph.java @@ -249,11 +249,11 @@ public final class Graph extends Storage { /// /// @param g sets of disjoint choices as a graph /// @return best path among many random ones - public static int goodSolution(final AbstractGraph g) { + public static int solveManyTimes(final AbstractGraph g) { // number higher than total students int bestPathCost = Integer.MAX_VALUE; for (int i = 0; i < DEMO_ITERATIONS; i++) { - int cost = solution(g); + int cost = solve(g); if (cost < bestPathCost) { // store shortest path bestPathCost = cost; @@ -266,7 +266,7 @@ public final class Graph extends Storage { /// /// @param g sets of disjoint choices as a graph /// @return weight of final random path - private static int solution(final AbstractGraph g) { + private static int solve(final AbstractGraph g) { List path = new ArrayList<>(g.vertices()); // order of list contents becomes path order @@ -317,6 +317,6 @@ public final class Graph extends Storage { System.out.print( "\n\nSolution with disjoint choices found: "); System.out.println( - goodSolution(h)); + solveManyTimes(h)); } } -- cgit v1.2.3