Implementation of the Hungarian O(n^3) Algorithm in Python. Linearization method for the quadratic problem.
- python >= 3.10
- poetry >= 1.7
This is a poetry project. Poetry is used to install dependencies. So far, tests are done by editing main.py. The exec() function with parameter 0 tests the assing files and with any other parameter it tests the assingp files. The results are saved in the output.txt and output_big.txt files respectively.
git clone https://github.com/FWsantos/assignment_problem.git
cd assignment_problem
poetry shell
poetry install --no-root
python src/main.py
hungarian_n3.py
: Contains the implementation of the Hungarian O(n^3) Algorithm in Python.main.py
: This is the main file where the algorithm is executed. It imports thehungarian_n3
module and calls the necessary functions to solve the assignment problem.controller.py
: This file contains the execution flow (read data sets ant run algorithm function)general.py
: This file contains general utility functions that are used by the algorithm and the test cases.
To run the code, follow these steps:
- Clone the repository:
git clone https://github.com/FWsantos/assignment_problem.git cd assignment_problem
- Activate the virtual environment:
poetry shell
- Install the dependencies:
poetry install --no-root
- Run the algorithm:
python src/main.py