This repository contains two Python scripts implementing the Branch-and-Bound algorithm to solve linear optimization problems. The two scripts utilize different libraries to solve the optimization problems:
- branch-and-bound-scipy.py: This script uses the
scipy.optimize.linprog
function from theSciPy
library. - branch-and-bound-xpress.py: This script uses the
xpress
library.
Both scripts also include functionalities for visualizing the solution process using the networkx
and matplotlib
libraries.
- Python 3.x
- SciPy
- Matplotlib
- NetworkX
- Xpress (only for
branch-and-bound-xpress.py
)
You can install the necessary packages using pip
:
pip install scipy matplotlib networkx xpress
You can execute each script from the command line:
python3 branch-and-bound-scipy.py
or
python3 branch-and-bound-xpress.py
The scripts also generate a visualization of the Branch-and-Bound process, showing the search tree and the solutions found.