Skip to content
Group Testing via MaxSAT
Branch: master
Clone or download
Latest commit 8f66ace Nov 19, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.

MGT (MaxSAT for Group Testing)

This file contains the information for an AAAI2020 reader/attender to use the prototype of MGT, in particular the two benchmark of MGT and MGT vs LP-relax.


In order to use the python script you need to have python 3 and have installed CPlex library from IBM. You must install MaxHS solver. (You will find instruction on the web page) You must set up the Python API of CPLEX.


Open your terminal and go to the code folder.

In general the framework works with two separated modules. The first ( or, generate the group testing instance, perform the encoding and solve it generating the solution data output file (saved in data-output subfolder). The second parse the output data and then plot it using matplotlib(saved in plot-output subfolder).

You can modify the sample script or import the python module and run them. In the first case there is already a script example, so please refer to that.


There are two main function, one for each of the two process (generate data, plot it) To generate data from MGT

main_varying_maxhs(n, p, noiseless, u)

To generate data from MGT vs LP

main_comparison_maxhs_lp(n, p, noiseless, u)

n is the number of items, p is the ratio faulty/items and noiseless is True for noiseless settings and False for noisy. u is and index number to save the data. (MGT and MGTvsLP data output will be not overwritten if are saved with same u). So if you want to use the framework from the console: open the python console



import mgt_benchmark as mgt
import data_to_plot as dtp

or for comparison between MGT and LP-relax (this will plot also computation effort in terms of time, in order to visualize phase transition)

import mgt_lp_comparison as mgt_lp
import data_to_plot as dtp

You can modify the script "" or create a new if you prefer. You will find further documentation inside the python modules.

Thank You



You can’t perform that action at this time.