dealing with assigning a set of facilities to a set of locations, considering the pairwise distances and flows between them.
goal: Minimizing the total cost or distance, taking into account both the distances and the flow.
There are various types of algorithms for different problem structures, such as:
- Precise algorithms
- Approximation algorithms
- Metaheuristics like genetic algorithms and simulated annealing
- Specialized algorithms
Example Given four facilities (F1, F2, F3, F4) and four Locations (L1, L2, L3, L4). We have a cost matrix that represents the pairwise distances or costs between facilities. Additionally, we have a flow matrix that represents the interaction or flow between locations. Find the assignment that minimizes the total cost based on the interactions between facilities and locations. Each facility must be assigned to exactly one location, and each location can only accommodate one facility.
https://www.geeksforgeeks.org/quadratic-assignment-problem-qap/
-
old- Folder of outdated filesold/problem.ipynb- @Qwenty228's attempt to solve problem with Qiskitold/solvers.ipynb- Previous version of currentreport.ipynbwritten by @leomotors
-
report.ipynbandreport.pdf- @leomotors solving problem with Fixstars, Gurobi and D-Wave -
benchmark.py- Script to run benchmark (Result used byreport.ipynb) -
compare.py- Function for running three solvers and output Dataclasses of Result -
graph.py- Utility functions for graph calculaton -
model.py- Utility functions for model creation -
result_v3.json- Latest benchmark result (Seereport.pdf)
See report.pdf
Use this command from root directory
poetry run python3 QAP/benchmark.py > QAP/tmp_stdout.txt
Otherwise Gurobi License Information and Error Log will flush on your screen and you cannot track the progress.
Note: TQDM output as stderr