Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotating a model for Benders Decomposition #268

Closed
hdavid16 opened this issue Nov 22, 2019 · 2 comments · Fixed by #316
Closed

Annotating a model for Benders Decomposition #268

hdavid16 opened this issue Nov 22, 2019 · 2 comments · Fixed by #316

Comments

@hdavid16
Copy link

I am wondering if it is possible to use CPLEX.jl to annotate models to implement the CPLEX benders decomposition (see https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/CPLEX/UsrMan/topics/discr_optim/benders/parameterBenders.html).

I have successfully used the MOI.RawParameter as suggested in the README, to set the CPLEX benders strategy to automatic. However, I would like to specify which variables should belong to which subproblem. To do so, I need to annotate the model, but am not sure if CPLEX.jl has these capabilities included (see https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/CPLEX/UsrMan/topics/discr_optim/benders/annotatedDecomp.html).

Thank you!

@odow
Copy link
Member

odow commented Nov 22, 2019

This functionality isn't wrapped.

The first step is to wrap these C functions:
https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/CPLEX/UsrMan/topics/discr_optim/benders/annotationsC.html

And then provide MOI attributes (like RawParameter) to get/set them.

@hdavid16
Copy link
Author

hdavid16 commented Nov 27, 2019

Thank you for your response. Looking in the cpx_solve.jl file, I found that the functionality is in fact implemented already via newlongannotation and setlongannotations. I have the annotations working and benders decomposition running. However, I am getting some random strange behavior in the annotations during some runs. The last input to setlongannotations is to specify an array with long values. I am using the form [Clong(some_number)] for this input. Most of the times, the correct number is annotated, however, sometimes I get very strange behavior (see snippet of the .ann file generated by CPLEX):

<?xml version='1.0' encoding='utf-8'?> <CPLEXAnnotations> <CPLEXAnnotation name='cpxBendersPartition' type='long' default='0'> <object type='1'> <anno name='Ra[1,-1]' index='20' value='1'/> <anno name='Ra[1,0]' index='21' value='1'/> <anno name='Ra[1,1]' index='22' value='1'/> <anno name='Ra[1,2]' index='23' value='1'/> <anno name='Ra[1,3]' index='24' value='1'/> <anno name='Ra[1,4]' index='25' value='1'/> <anno name='Ra[2,-1]' index='26' value='1'/> <anno name='Ra[2,0]' index='27' value='4294967297'/> <anno name='Ra[2,1]' index='28' value='1'/> <anno name='Ra[2,2]' index='29' value='1'/> <anno name='Ra[2,3]' index='30' value='1'/> <anno name='Ra[2,4]' index='31' value='1'/>

You will notice that the variable with index 27 is annotated with 4294967297. However, I am specifying that it should be 1 (i.e. Clong(1)). When I rerun my code, a different variable is randomly annotated to some very large positive or negative number. Any idea what is going on? Is this an a problem with C.jl or IBM?

My current workaround thus far has been to use Julia to write the .ann file with the annotations and feed them to to CPLEX via CPXreadcopyannotations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants