Comment out old MWM algorithm, add auction algorithm
This commit is contained in:
@@ -185,28 +185,32 @@ public class Simulator implements GraphModificationFunctions {
|
||||
//Find Maximum Weight Matching
|
||||
//using jheaps library class PairingHeap for improved efficiency
|
||||
if(verbose){System.out.println("Finding maximum weight matching");}
|
||||
MaximumWeightBipartiteMatching maxWeightMatching;
|
||||
//Use correct heap type for priority queue
|
||||
String heapType = BiGpairSEQ.getPriorityQueueHeapType();
|
||||
switch (heapType) {
|
||||
case "PAIRING" -> {
|
||||
maxWeightMatching = new MaximumWeightBipartiteMatching(graph,
|
||||
alphas,
|
||||
betas,
|
||||
i -> new PairingHeap(Comparator.naturalOrder()));
|
||||
}
|
||||
case "FIBONACCI" -> {
|
||||
maxWeightMatching = new MaximumWeightBipartiteMatching(graph,
|
||||
alphas,
|
||||
betas,
|
||||
i -> new FibonacciHeap(Comparator.naturalOrder()));
|
||||
}
|
||||
default -> {
|
||||
maxWeightMatching = new MaximumWeightBipartiteMatching(graph,
|
||||
alphas,
|
||||
betas);
|
||||
}
|
||||
}
|
||||
|
||||
//NON-AUCTION ALGORITHM
|
||||
// MaximumWeightBipartiteMatching maxWeightMatching;
|
||||
// //Use correct heap type for priority queue
|
||||
// String heapType = BiGpairSEQ.getPriorityQueueHeapType();
|
||||
// switch (heapType) {
|
||||
// case "PAIRING" -> {
|
||||
// maxWeightMatching = new MaximumWeightBipartiteMatching(graph,
|
||||
// alphas,
|
||||
// betas,
|
||||
// i -> new PairingHeap(Comparator.naturalOrder()));
|
||||
// }
|
||||
// case "FIBONACCI" -> {
|
||||
// maxWeightMatching = new MaximumWeightBipartiteMatching(graph,
|
||||
// alphas,
|
||||
// betas,
|
||||
// i -> new FibonacciHeap(Comparator.naturalOrder()));
|
||||
// }
|
||||
// default -> {
|
||||
// maxWeightMatching = new MaximumWeightBipartiteMatching(graph,
|
||||
// alphas,
|
||||
// betas);
|
||||
// }
|
||||
// }
|
||||
//Auction algorithm version
|
||||
MaximumWeightBipartiteAuctionMatching maxWeightMatching = new MaximumWeightBipartiteAuctionMatching(graph, alphas, betas);
|
||||
//get the matching
|
||||
MatchingAlgorithm.Matching<String, DefaultWeightedEdge> graphMatching = maxWeightMatching.getMatching();
|
||||
if(verbose){System.out.println("Matching completed");}
|
||||
@@ -267,7 +271,8 @@ public class Simulator implements GraphModificationFunctions {
|
||||
}
|
||||
|
||||
//Metadata comments for CSV file
|
||||
String algoType = "LEDA book with heap: " + heapType;
|
||||
// String algoType = "LEDA book with heap: " + heapType;
|
||||
String algoType = "Basic Auction Algorithm";
|
||||
int min = Math.min(graphAlphaCount, graphBetaCount);
|
||||
//matching weight
|
||||
BigDecimal totalMatchingWeight = maxWeightMatching.getMatchingWeight();
|
||||
|
||||
Reference in New Issue
Block a user