This code uses the formulation from Shao & Vesel’s 2015 work, Modeling the packing coloring problem of graphs1.
Follow these steps to set up the project on your local machine:
Ensure you have the following installed:
- Python 3.10 or higher
pip(Python package manager)
-
Create a virtual environment (optional but recommended):
python3 -m venv venv source venv/bin/activate # On macOS/Linux venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
- Ensure
CPLEXis installed and configured. Setting up the CPLEX Python API
-
Run the main script:
python main.py
-
View generated graphs:
- Graph files will be saved in the
graphsdirectory.
- Graph files will be saved in the
-
Modify parameters:
- Update
P_n,B_n, orK_nvalues inmain.pyto customize the graph generation.
- Update
Footnotes
-
Z. Shao and A. Vesel, “Modeling the packing coloring problem of graphs,” Applied Mathematical Modelling, vol. 39, no. 13, pp. 3588–3595, 2015. DOI: 10.1016/j.apm.2014.11.060. ↩