I want to solve a MILP with Dantzig-Wolfe reformulation using PyCGCOpt in my research.
In the following code, I try to compute a solution of a MIP 'n13-3' (https://miplib.zib.de/instance_details_n13-3.html) for each decomposition obtained by pygcgopt.Model.detect() with reference to
https://scipopt.github.io/PyGCGOpt/examples/cpmp/cpmp.html.
I succeeded in obtaining a solution for some DW decompositions, but I got 'Segmentation fault: 11' for others.
Could you please tell me how to perform the optimization for all identified decomposition patterns?
An mpz file and output results of my code are also attached.
[Environment]:
OS: MacOS 12.6.7
Python: 3.9.16
gcc: Apple clang version 14.0.0 (clang-1400.0.29.202)
pyscipopt: 4.3.0
scip: 8.0.3
gcg: 3.5.3
pygcgopt: 0.1.4
[Code]:
`import os
from pygcgopt import Model, SCIP_PARAMSETTING
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--problem', help='name of problem data',
default='n13-3.mps.gz', type=str)
parser.add_argument('-t', '--timelimit', help='solving time limit in seconds',
default=60.0, type=str)
args = parser.parse_args()
target = args.problem
timelimit = args.timelimit
filepath = os.path.join(os.path.dirname(file), target)
""" get the number of decompositions """
model = Model("")
model.readProblem(filepath)
model.setPresolve(SCIP_PARAMSETTING.OFF)
model.detect()
decomps = model.listDecompositions()
ndec = len(decomps)
print("GCG found {} finnished decompositions.".format(len(decomps)))
model.freeProb()
""" optimize each decomposition pattern """
for i in range(ndec):
print(f"########## {i}th decomposition ##########")
model = Model(f"{i}")
model.readProblem(filepath)
model.setPresolve(SCIP_PARAMSETTING.OFF)
model.setParam("limits/time", timelimit)
model.setLongintParam("limits/nodes", 1000000)
model.setBoolParam("pricing/masterpricer/abortpricingint", False)
model.detect()
decomps = model.listDecompositions()
decomps[i].isSelected = True
decomps[i].displayInfo(1)
if decomps[i].getNBlocks() >= 50:
continue
model.optimize()
model.printStatistics()
print(model.getStatus())
model.freeProb()`
Thank you for providing a great tool, PyGCGOpt.
I want to solve a MILP with Dantzig-Wolfe reformulation using PyCGCOpt in my research. In the following code, I try to compute a solution of a MIP 'n13-3' (https://miplib.zib.de/instance_details_n13-3.html) for each decomposition obtained by pygcgopt.Model.detect() with reference to https://scipopt.github.io/PyGCGOpt/examples/cpmp/cpmp.html. I succeeded in obtaining a solution for some DW decompositions, but I got 'Segmentation fault: 11' for others. Could you please tell me how to perform the optimization for all identified decomposition patterns?
An mpz file and output results of my code are also attached.
[Environment]: OS: MacOS 12.6.7 Python: 3.9.16 gcc: Apple clang version 14.0.0 (clang-1400.0.29.202) pyscipopt: 4.3.0
scip: 8.0.3
gcg: 3.5.3
pygcgopt: 0.1.4
[Code]: `import os
from pygcgopt import Model, SCIP_PARAMSETTING import argparse parser = argparse.ArgumentParser() parser.add_argument('-p', '--problem', help='name of problem data', default='n13-3.mps.gz', type=str) parser.add_argument('-t', '--timelimit', help='solving time limit in seconds', default=60.0, type=str) args = parser.parse_args() target = args.problem timelimit = args.timelimit filepath = os.path.join(os.path.dirname(file), target)
""" get the number of decompositions """ model = Model("") model.readProblem(filepath) model.setPresolve(SCIP_PARAMSETTING.OFF) model.detect() decomps = model.listDecompositions() ndec = len(decomps) print("GCG found {} finnished decompositions.".format(len(decomps))) model.freeProb()
""" optimize each decomposition pattern """ for i in range(ndec): print(f"########## {i}th decomposition ##########") model = Model(f"{i}") model.readProblem(filepath) model.setPresolve(SCIP_PARAMSETTING.OFF) model.setParam("limits/time", timelimit) model.setLongintParam("limits/nodes", 1000000) model.setBoolParam("pricing/masterpricer/abortpricingint", False) model.detect() decomps = model.listDecompositions() decomps[i].isSelected = True
decomps[i].displayInfo(1) if decomps[i].getNBlocks() >= 50: continue model.optimize() model.printStatistics() print(model.getStatus()) model.freeProb()`
log.txt n13-3.mps.gz