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

the variables' order in the ecole.observation.NodeBipartite() #318

Open
stardustwls opened this issue Mar 16, 2022 · 2 comments
Open

the variables' order in the ecole.observation.NodeBipartite() #318

stardustwls opened this issue Mar 16, 2022 · 2 comments
Labels
type/bug 🐛 Something isn't working

Comments

@stardustwls
Copy link

Describe the bug

when using ecole.observation.NodeBipartite(), we will get the variable features (19-dimensions) and the 13th is the incumbent. However, it seems that the order of the variable in the ecole.observation.NodeBipartite() is not coresponding to the .lp file, x1, x2, x3, x4, ...
image
for example, we display features of 17 variables, but they are not the x1-x17 in the .lp file.
Could you please tell me the coresponding relationship between them? Thank you very much!

@stardustwls stardustwls added the type/bug 🐛 Something isn't working label Mar 16, 2022
@AntoinePrv
Copy link
Member

Hi @stardustwls,

SCIP will reorder the problem during transform (even during loading).

You can try overriding the environment's dynamics set_dynamics_random_state to deactivate the randomization/permutationseed parameters.

Alternatively, you can use Pyscipopt (env.model.as_pyscipopt()) to get the names of the variables and compare that with the one from your LP file.

@LeonaireHo
Copy link

LeonaireHo commented Jun 8, 2022

Hi,
I have tried by setting randomization/permutationseed to 0 but that didn't work, and the names of the vars I get from pyscipopt are always in ascending order, like "x0, x1, etc" .

To solve this problem, I modified the code in NodeBipartiteObs and added a feature to indicate the indice in the original problem.
int i = SCIPvarGetProbindex(var); SCIP_VAR* aux = SCIPgetOrigVars(scip)[i]; out[idx(VariableFeatures::index)] = SCIPvarGetProbindex(SCIPvarGetTransVar(aux));
This is not a good solution, but it works. If anyone has any suggestions or better methods, please let me know. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants