Skip to content

Commit

Permalink
Branch and bound (RobotLocomotion#7717)
Browse files Browse the repository at this point in the history
* Start to work on bnb for MathematicalProgram.

* Add the test for the node constructor.

* Make MixedIntegerBranchAndBoundNode constructor private.

* Use unique_ptr instead of shared_ptr. Add remaining_binary_variables to the node.

* Check if optimal solution is integral.

* Add Branch method to the node.

* Add test on branching a node.

* Work on the MixedIntegerBranchAndBound class.

* Add the branching method.

* Work on IsNodeFathomed.

* When constructing a node, solve the optimization program in the node.

* Remove IsOptimalSolutionIntegral, replace it with a constant getter. Add the test for IsLeafNodeFathomed.

* Pick the deepest node.

* Add BranchAndUpdate function to update the best solutions and the lower/upper bounds.

* If a node has all binary variables fixed to either 0 or 1, the node is also fathomed.

* Add the test to pick a branching variable.

* Add Solve function, together with its tests.

* Forgot to use while loop in branch and bound solve.

* Add another example for bnb test.

* Specify the solver at the bnb construction.

* Add another test with multiple integral solutions.

* Modify the test slightly, so that it does not obtain the optimal integral solution at the root.

* Fix the gcc compiler issue.

* Add one more example on MIQP, with multiple integral solutions.

* lint.

* Address Andres' comments.

* Add setter and getter for the child nodes.

* Change GetOptimalCost and add GetSubOptimalCost()

* Add a setter for root().

* Add setter and getter for the gap tolerance.

* Address Andres' comments.

* change the wording.

* Address Andres' comments.

* Address Andres' comments.

* rename pick_variable_ to variable_selection_method_

* Address Russ's comments.

* Address reviewers' comments.

* lint

* documentation improvement.

* typo.

* typo.
  • Loading branch information
hongkai-dai authored Feb 13, 2018
1 parent 4772af9 commit 3c07aa3
Show file tree
Hide file tree
Showing 4 changed files with 2,541 additions and 0 deletions.
20 changes: 20 additions & 0 deletions solvers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,15 @@ drake_cc_library(
],
)

drake_cc_library(
name = "branch_and_bound",
srcs = ["branch_and_bound.cc"],
hdrs = ["branch_and_bound.h"],
deps = [
":mathematical_program",
],
)

drake_cc_library(
name = "non_convex_optimization_util",
srcs = ["non_convex_optimization_util.cc"],
Expand Down Expand Up @@ -689,6 +698,17 @@ drake_cc_googletest(
],
)

drake_cc_googletest(
name = "branch_and_bound_test",
tags = gurobi_test_tags(),
deps = [
":branch_and_bound",
":mathematical_program_test_util",
":mixed_integer_optimization_util",
"//drake/common/test_utilities:eigen_matrix_compare",
],
)

drake_cc_googletest(
name = "evaluator_base_test",
deps = [
Expand Down
Loading

0 comments on commit 3c07aa3

Please sign in to comment.