The problem is described below: http://people.brunel.ac.uk/~mastjjb/jeb/orlib/mknapinfo.html
The
In this expression
A Gomory cutting plane (Gilmore and Gomory 1961) is expressed by :
This is guaranteed to be a valid cut of the LP relaxation of an integer programming problem.
We use the Python implementation of CPLEX, to get the final tableau. We formulate the problem in standard form, with explicit slack variables, then we let CPLEX solve it and extract the final tableau, as well as the final right-hand-side vector
Finally, we count the number of possible cuts, leveraging the fact that one cut can be generated for each variable (whether it is a slack variable or not) that has a fractional value in the final solution.
We leverage the initial tableau, which contains a solution with only slack variables in the basis, in a useful configuration: row
The tests : http://people.brunel.ac.uk/~mastjjb/jeb/orlib/files/
*this code only supports the files mknap1.txt format.
Inspired by the form of previous tests, we created a function that generates mknap problems randomly in .txt format.
-
Make sure you have IBM ILOG installed in your machine and the python interface for CPLEX. What is CPLEX: https://www.ibm.com/products/ilog-cplex-optimization-studio Getting started: https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/CPLEX/GettingStarted/topics/set_up/Python_setup.html
-
Python3
-
Clone this repository
In order to solve pseudo-randomically generated instances, we provide a config.ini file, in which it is possible to change generation parameters. After set the .ini file as desired, from the main root execute:
-
In order to solve all possible instances:
python main.py -all
-
In order to solve a single cluster of instances:
python main.py -c cluster_type
-
In order to solve a single instance:
python main.py -s instance_name.txt
-
It will generate files in solutions/[test_name] and lp/[test_name]
-
All the resolution is readable in resolution.log
In order to plot the statistics :
- Run :
python /plots/stat_plotter.py
Caprara, A., Fischetti, M.
- Martina Salvati (0292307)
- Matteo Ferretti (0300049)