π Paper: Bridging Pattern-Aware Complexity with NP-Hard Optimization: A Unifying Framework and Empirical Study β Olivier Saidi, 2025 Β· arXiv:2506.13810 [cs.AI]
The TSP data used in this work is from TSPLIB - University of Heidelberg, which is freely available for research purposes.
The Pattern-Aware Complexity Framework (PACF) is a Python-based framework designed to analyze and exploit structural patterns in NP-hard optimization problems, such as the Traveling Salesman Problem (TSP), genetic sequence alignment, and weather forecasting. By identifying patterns like symmetry, clustering, and repetition, PACF reduces computational complexity and enhances solver performance. This implementation focuses on TSP but is extensible to other domains with optional dependencies.
Developed and tested on a MacBook Pro M3 Max running macOS 26.3.1, the framework should work across platforms (macOS, Linux, Windows) with the appropriate setup.
pacf-framework/
βββ PACF_v1.py # Main script
βββ requirements.txt # Python dependencies (pip install -r requirements.txt)
βββ test_pacf.py # Smoke tests
βββ TSP_instances/ # 24 TSPLIB benchmark instances (ready to use)
βββ .github/
β βββ workflows/
β β βββ ci.yml # CI: Python 3.9 + 3.11 on every push/PR
β βββ ISSUE_TEMPLATE/
βββ LICENSE
βββ README.md
βββ CONTRIBUTING.md
βββ CODE_OF_CONDUCT.md
βββ SECURITY.md
PACF_v1.py: Single-file framework β run directly, no installation beyondrequirements.txt.TSP_instances/: 24 benchmark instances from TSPLIB, ready to use out of the box.- Outputs: For single-file analysis, saved alongside the input
.tspfile. For experiments, saved to the current working directory unless--output-diris specified.
- Python 3.8 or higher: Core language requirement.
Install these via requirements.txt (pip install -r requirements.txt):
- NumPy 1.20+: Numerical computations.
- Pandas 1.3+: Data manipulation and analysis.
- Matplotlib 3.5+: Visualization generation.
- NetworkX 2.6+: Graph operations for TSP.
- SciKit-learn 1.0+: Clustering (KMeans) and meta-learning (RandomForestRegressor).
Install these for additional features:
- PyTorch (Torch): Hardware acceleration (CUDA for NVIDIA GPUs, Metal for Apple Silicon).
pip install torch
- BioPython: Genetic sequence analysis.
pip install biopython
- xarray: Weather data processing (requires scipy for peak detection).
pip install xarray scipy
- psutil: Memory usage monitoring (optional for performance tracking).
pip install psutil
Follow these steps in your terminal to set up the environment:
-
Clone the Repository
git clone https://github.com/oliviersaidi/pacf-framework.git cd pacf-framework -
Install Python (if not installed)
- Ensure Python 3.8 or higher is installed. On macOS, use
brew install python@3.11or download from python.org. Verify withpython3 --version.
- Ensure Python 3.8 or higher is installed. On macOS, use
-
Create a Virtual Environment (Recommended)
python3 -m venv pacf_env
-
Activate the Virtual Environment
- macOS/Linux:
source pacf_env/bin/activate - Windows:
pacf_env\Scripts\activate
- macOS/Linux:
-
Install Dependencies
pip install -r requirements.txt
-
Install Optional Dependencies (as needed)
- For hardware acceleration:
pip install torch - For genetic sequences:
pip install biopython - For weather data:
pip install xarray scipy - For memory monitoring:
pip install psutil
- For hardware acceleration:
-
Verify Setup
python PACF_v1.py --version # β PACF v1.0 python PACF_v1.py TSP_instances/berlin52.tsp
- arXiv: https://arxiv.org/abs/2506.13810 (cs.AI)
- Cambridge Open Engage: https://doi.org/10.33774/coe-2026-qndkw
- Zenodo: https://doi.org/10.5281/zenodo.15006676
- GitHub: https://github.com/oliviersaidi/pacf-framework
@misc{saidi2025bridging,
title = {Bridging Pattern-Aware Complexity with NP-Hard Optimization: A Unifying Framework and Empirical Study},
author = {Saidi, Olivier},
year = {2025},
eprint = {2506.13810},
archivePrefix= {arXiv},
primaryClass = {cs.AI},
doi = {10.48550/arXiv.2506.13810},
url = {https://arxiv.org/abs/2506.13810},
note = {Also available at Cambridge Open Engage: \url{https://doi.org/10.33774/coe-2026-qndkw}}
}