A Mixed Integer Linear Programming implementation of the Divisor Graph Longest Path problem.
Implemented using the PuLP Python library to call the COIN-OR CBC solver.
This arc-based model uses an artificial depot (node "0") and then looks for the longest tour that starts and ends in that node.
Variables:
Constraints:
The implementation also adds subtour elimination constraints for subtours of arbitrary size iteratively:
- Solve the problem
- If the solution has a subtour: add the corresponding subtour elimination constraint and start again
- Otherwise: print the solution
Inspired by this discussion: https://twitter.com/elprofefriki/status/1633138512491937792