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

Instance saving from NodeBipartite/MilpBipartite observation #160

Open
dchetelat opened this issue Apr 19, 2021 · 0 comments
Open

Instance saving from NodeBipartite/MilpBipartite observation #160

dchetelat opened this issue Apr 19, 2021 · 0 comments
Labels
type/enhancement 🚀 New feature or request

Comments

@dchetelat
Copy link
Contributor

MilpBipartiteObs contains all the information necessary to reconstruct the MILP it represents (A, b, c). NodeBipartiteObs too (although maybe it is missing the actual lhs/rhs coefficients, which could be added).

The proposal would be to add a .instance() method to those observations, that could return a scip::Model representing this MILP which could be then saved to a file, or passed to a env.reset, or modified by PySCIPOpt, or anything else we want to do with it.

That is, we would be able to do, say,

import ecole

env = ecole.environment.Branching(
    observation_function=ecole.observation.NodeBipartite()
)

obs, action_set, _, done, _ = env.reset('instance.lp')

# This is an ecole.core.scip.Model
instance = obs.instance()
instance.write_problem(f"postprocessed_instance.lp")

and this would return and save the instance at the root node, after preprocessing, for example.

@dchetelat dchetelat added the type/enhancement 🚀 New feature or request label Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement 🚀 New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant