Rough implementation, missing final dual adjustment step, and may have other bugs as well as it does not yet output a maximum weight matching

This commit is contained in:
eugenefischer
2025-04-09 10:17:13 -05:00
parent 3d302cf8ad
commit 0071cafbbd
4 changed files with 1241 additions and 76 deletions

View File

@@ -582,35 +582,35 @@ public class InteractiveInterface {
boolean backToOptions = false;
while(!backToOptions) {
System.out.println("\n---------ALGORITHM OPTIONS----------");
System.out.println("1) Use integer weight scaling algorithm by Duan and Su.");
System.out.println("2) Use Hungarian algorithm with Fibonacci heap priority queue");
System.out.println("3) Use Hungarian algorithm with pairing heap priority queue");
System.out.println("4) Use auction algorithm");
System.out.println("1) Use Hungarian algorithm with Fibonacci heap priority queue");
System.out.println("2) Use Hungarian algorithm with pairing heap priority queue");
System.out.println("3) Use auction algorithm");
System.out.println("4) Use integer weight scaling algorithm by Duan and Su. (buggy, not yet fully implemented!)");
System.out.println("0) Return to Options menu");
try {
input = sc.nextInt();
switch (input) {
case 1 -> {
BiGpairSEQ.setIntegerWeightScalingAlgorithm();
System.out.println("MWM algorithm set to integer weight scaling algorithm of Duan and Su");
backToOptions = true;
}
case 2 -> {
BiGpairSEQ.setHungarianAlgorithm();
BiGpairSEQ.setFibonacciHeap();
System.out.println("MWM algorithm set to Hungarian with Fibonacci heap");
backToOptions = true;
}
case 3 -> {
case 2 -> {
BiGpairSEQ.setHungarianAlgorithm();
BiGpairSEQ.setPairingHeap();
System.out.println("MWM algorithm set to Hungarian with pairing heap");
backToOptions = true;
}
case 4 -> {
case 3 -> {
BiGpairSEQ.setAuctionAlgorithm();
System.out.println("MWM algorithm set to auction");
}
case 4 -> {
BiGpairSEQ.setIntegerWeightScalingAlgorithm();
System.out.println("MWM algorithm set to integer weight scaling algorithm of Duan and Su");
backToOptions = true;
}
case 0 -> backToOptions = true;
default -> System.out.println("Invalid input");
}

File diff suppressed because it is too large Load Diff

View File

@@ -193,6 +193,9 @@ public class Simulator implements GraphModificationFunctions {
//create a new MaximumIntegerWeightBipartiteAuctionMatching
maxWeightMatching = new MaximumIntegerWeightBipartiteAuctionMatching<>(graph, alphas, betas);
}
case INTEGER_WEIGHT_SCALING -> {
maxWeightMatching = new MaximumIntegerWeightBipartiteMatching<>(graph, alphas, betas, new BigDecimal(highThreshold));
}
default -> { //HUNGARIAN
//use selected heap type for priority queue
HeapType heap = BiGpairSEQ.getPriorityQueueHeapType();
@@ -273,6 +276,9 @@ public class Simulator implements GraphModificationFunctions {
case AUCTION -> {
algoType = "Auction algorithm";
}
case INTEGER_WEIGHT_SCALING -> {
algoType = "Integer weight scaling algorithm from Duan and Su (not yet perfectly implemented)";
}
default -> { //HUNGARIAN
algoType = "Hungarian algorithm with heap: " + BiGpairSEQ.getPriorityQueueHeapType().name();
}