Skip to content

Commit

Permalink
Merge branch 'main' of github.com:hlefebvr/idol
Browse files Browse the repository at this point in the history
  • Loading branch information
hlefebvr committed Feb 27, 2024
2 parents 242e41f + 7422bf9 commit ed956a5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ auto x = model.add_var(0, 10, Integer, "x");
auto y = model.add_var(0, 5, Integer, "y");
model.set_obj_expr(-x - 7 * y);
model.add_ctr(-3 * x + 2 * y <= 12);
model.add_ctr(x + 2 * y <= 20);
auto follower_objective = model.add_ctr(y == 0);
auto follower_c1 = model.add_ctr(2 * x - y <= 7);
auto follower_c2 = model.add_ctr(-2 * x + 4 * y <= 16);
auto c1 = model.add_ctr(-3 * x + 2 * y <= 12);
auto c2 = model.add_ctr(x + 2 * y <= 20);
auto c3 = model.add_ctr(y == 0);
auto c4 = model.add_ctr(2 * x - y <= 7);
auto c5 = model.add_ctr(-2 * x + 4 * y <= 16);
// Annotate follower variables
// * If not annotated, the default value is MasterId, i.e., leader variables and constraints
Expand All @@ -105,8 +105,8 @@ Annotation<Var> follower_variables(env, "follower_variable", MasterId);
Annotation<Ctr> follower_constraints(env, "follower_constraints", MasterId);
y.set(follower_variables, 0); // "y" is a lower level variable
follower_c1.set(follower_constraints, 0); // "follower_c1" is a lower level constraint
follower_c2.set(follower_constraints, 0); // "follower_c2" is a lower level constraint
c4.set(follower_constraints, 0); // "c4" is a lower level constraint
c5.set(follower_constraints, 0); // "c5" is a lower level constraint
// Use coin-or/MibS as external solver
model.use(BiLevel::MibS(follower_variables,
Expand Down

0 comments on commit ed956a5

Please sign in to comment.