Multilevel Approaches for the Critical Node Problem
Code for the paper
The code was developed in python 2.7.
In the folder Instances/, it can be found the instances used in the paper as well as extra information on the instances' solution.
There are three folders for the randomly generated instances. In all these folders the instances under the same name are equal, but the computational information might vary as they were solved with different methods (see paper). In tables_MNC.rar all instances can be found, while in the other folders some instances might not exist because the associated approach did not solved them within the imposed time limit.
Generate_Instances.py enables the generation of new instances (running this script may overwrite files in Instances/) and it also provides the code to gather statistics on the solution approaches. For the files with the resultsfor our heuristic (VA_AP), #optDA-AD corresponds to the obtained solution, #tmDA was the time for solving Vaccination-Attack, #tmAD was the time for solving Attack-Protection and #tmAD_AD is the total time for applying the heuristic, all other parameters must be discarded.
DAD.py corresponds to the approach MCN of the paper and makes use of AD.py and D.py.
DAD_MIX.py implements both MCN
To run AD_MIX.py, it is necessary to install the following bilevel solver: https://msinnl.github.io/pages/bilevel.html
All the python scripts depend on an instalation of CPLEX.