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

Implement GUB branching #181

Merged
merged 20 commits into from
Jun 15, 2021
Merged

Implement GUB branching #181

merged 20 commits into from
Jun 15, 2021

Conversation

AntoinePrv
Copy link
Member

@AntoinePrv AntoinePrv commented May 6, 2021

Pull request checklist

  • I have open an issue to discuss the proposed changes. Fix Multi variable branching #158
  • I have modified/added tests to cover the new changes/features.
  • I have modified/added the documentation to cover the new changes/features.
  • I have ran the tests, checks, and code formatters.

General idea

For integer variables x_i provided by the user, and their LP relaxation value x_lp_i,

  • If s := sum(x_lp_i) is fractional, then branch on sum(x_i) <= floor(s) & sum(x_i) >= ceil(s)
  • If s := sum(x_lp_i) is integer, then branch on sum(x_i) <= s - 1 & sum(x_i) == s & sum(x_i) >= s+ 1

Proposed implementation

  • When n_vars == 0, fail;
  • Otherwise (including when n_vars == 1):
    • Fail if any variable is continuous or fixed
    • if sum(x_lp_i) is infinite, what then?
    • if sum(x_lp_i) is integer, branch on three nodes
    • else branch on two nodes

@AntoinePrv AntoinePrv marked this pull request as draft May 6, 2021 21:23
@AntoinePrv AntoinePrv changed the title Feature mvb Implement GUB branching May 6, 2021
@AntoinePrv AntoinePrv force-pushed the feature-mvb branch 2 times, most recently from 539aa3d to 99b8a73 Compare May 7, 2021 18:30
@AntoinePrv
Copy link
Member Author

When given all the action set

_, action_set, _, done, _ = env.reset(next(instances))
while not done:
    _, action_set, _, done, _ = env.step(action_set)

And that their sum is integral, three nodes are created. But since no variable get fixed, they all appear again in the action_set and the code loops indefinitely.

@AntoinePrv AntoinePrv force-pushed the feature-mvb branch 2 times, most recently from 737b93d to 61f4e9d Compare May 27, 2021 15:39
@AntoinePrv AntoinePrv force-pushed the feature-mvb branch 2 times, most recently from 4dfc397 to 888bfe5 Compare June 7, 2021 20:35
@AntoinePrv AntoinePrv marked this pull request as ready for review June 8, 2021 17:18
@AntoinePrv AntoinePrv requested review from dchetelat and gasse June 8, 2021 17:18
@AntoinePrv AntoinePrv added the new/dynamics ⚙️ Ecole dynamics (for environments) label Jun 12, 2021
Copy link
Member

@gasse gasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments about variable names and a few typos. High quality PR !

libecole/include/ecole/dynamics/branching-gub.hpp Outdated Show resolved Hide resolved
SCIP_Real priority,
SCIP_Real estimate,
SCIP_VAR** vars,
SCIP_Real* ones,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this argument called ones ? Does it have to be a vector of ones ? If so, why is it an argument ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, yes it's literally a vector of ones. It's being reused between the left and right child...

python/src/ecole/core/dynamics.cpp Outdated Show resolved Hide resolved
python/src/ecole/core/dynamics.cpp Outdated Show resolved Hide resolved
python/src/ecole/core/dynamics.cpp Outdated Show resolved Hide resolved
python/src/ecole/core/dynamics.cpp Outdated Show resolved Hide resolved
python/src/ecole/core/dynamics.cpp Outdated Show resolved Hide resolved
python/src/ecole/core/dynamics.cpp Outdated Show resolved Hide resolved
python/src/ecole/core/dynamics.cpp Outdated Show resolved Hide resolved
python/src/ecole/core/dynamics.cpp Outdated Show resolved Hide resolved
@AntoinePrv AntoinePrv changed the base branch from master to dev June 15, 2021 15:13
@AntoinePrv AntoinePrv merged commit 1e3c2c2 into dev Jun 15, 2021
@AntoinePrv AntoinePrv deleted the feature-mvb branch June 15, 2021 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new/dynamics ⚙️ Ecole dynamics (for environments)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi variable branching
2 participants