diff --git a/CHANGELOG.MD b/CHANGELOG.MD new file mode 100644 index 0000000..b964a9c --- /dev/null +++ b/CHANGELOG.MD @@ -0,0 +1,8 @@ +# Changelog + +## v0.1.1 +- Branching and traversing strategies take values not types + +## v0.1.0 +- BFS traverse strategy +- First and MostInfeasible branching strategies \ No newline at end of file diff --git a/Project.toml b/Project.toml index d39762f..4cefaf1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Bonobo" uuid = "f7b14807-3d4d-461a-888a-05dd4bca8bc3" authors = ["Ole Kroeger and contributors"] -version = "0.1.0" +version = "0.1.1" [deps] DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" diff --git a/src/Bonobo.jl b/src/Bonobo.jl index 8b2f316..7461702 100644 --- a/src/Bonobo.jl +++ b/src/Bonobo.jl @@ -178,8 +178,8 @@ Later it can be dispatched on `BnBTree{Node, Root, Solution}` for various method Return a [`BnBTree`](@ref) object which is the input for [`optimize!`](@ref). """ function initialize(; - traverse_strategy = BFS, - branch_strategy = FIRST, + traverse_strategy = BFS(), + branch_strategy = FIRST(), atol = 1e-6, rtol = 1e-6, Node = DefaultNode, @@ -198,7 +198,7 @@ function initialize(; get_branching_indices(root), 0, sense, - Options(traverse_strategy(), branch_strategy(), atol, rtol) + Options(traverse_strategy, branch_strategy, atol, rtol) ) end @@ -398,6 +398,6 @@ end export BnBTree, BnBNodeInfo, AbstractNode, AbstractSolution -export AbstractTraverseStrategy +export AbstractTraverseStrategy, AbstractBranchStrategy end diff --git a/test/end2end/mip.jl b/test/end2end/mip.jl index 45bd5ea..2d0a872 100644 --- a/test/end2end/mip.jl +++ b/test/end2end/mip.jl @@ -96,7 +96,7 @@ end @objective(m, Max, x[1]+1.2x[2]+3.2x[3]) bnb_model = BB.initialize(; - traverse_strategy = BB.BFS, + traverse_strategy = BB.BFS(), Node = MIPNode, root = m, sense = objective_sense(m) == MOI.MAX_SENSE ? :Max : :Min @@ -125,7 +125,7 @@ end @objective(m, Min, x[1]+1.2x[2]+3.2x[3]) bnb_model = BB.initialize(; - branch_strategy = BB.MOST_INFEASIBLE, + branch_strategy = BB.MOST_INFEASIBLE(), Node = MIPNode, root = m, sense = objective_sense(m) == MOI.MAX_SENSE ? :Max : :Min diff --git a/test/unit/add_node.jl b/test/unit/add_node.jl index 841a1d2..0723d2a 100644 --- a/test/unit/add_node.jl +++ b/test/unit/add_node.jl @@ -13,7 +13,7 @@ struct TestRoot end end bnb_model = BB.initialize(; - branch_strategy = BB.MOST_INFEASIBLE, + branch_strategy = BB.MOST_INFEASIBLE(), root = TestRoot(), sense = :Min )