RefactorFirst
RefactorFirst copied to clipboard
Prioritize cycles with the same backward / min cut edges.
trafficstars
Cycles with the same edges should be prioritized first. The highest frequency edges should be prioritized first.
Maybe do something like this?
Map<DefaultWeightedEdge, Integer> minCutEdgeCount = new HashMap<>();
rankedCycles.stream().flatMap(rankedCycle -> rankedCycle.getMinCutEdges().stream()).forEach(minCutEdge ->
minCutEdgeCount.put(minCutEdge, minCutEdgeCount.getOrDefault(minCutEdge, 0) + 1));