diff --git a/src/heuristics.jl b/src/heuristics.jl index 16e672399..daeca1e2e 100644 --- a/src/heuristics.jl +++ b/src/heuristics.jl @@ -2,3 +2,23 @@ ## Have a general interface for heuristics ## so that the user can link in custom heuristics. +""" + Boscia Heuristic + +Interface for heuristics in Boscia. +`h` is the heuristic function receiving as input .. +`prob` is the probability with which it will be called. +""" +# Would 'Heuristic' also suffice? Or might we run into Identifer conflicts with other packages? +struct BosciaHeuristic + h::Function + prob::Float64 +end + +BosciaHeuristic() = BosciaHeuristic(x -> nothing, 0.0) + +""" +Chooses heuristic by rolling a dice. +""" +function pick_heuristic(heuristic_list) +end diff --git a/src/interface.jl b/src/interface.jl index 03e8aaa7b..1fe1f4f3c 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -51,6 +51,7 @@ fw_verbose - if true, FrankWolfe logs are printed use_shadow_set - The shadow set is the set of discarded vertices which is inherited by the children nodes. It is used to avoid recomputing of vertices in case the LMO is expensive. In case of a cheap LMO, performance might improve by disabling this option. +heuristic - Custom heuristic from the user. """ function solve( f, @@ -84,6 +85,7 @@ function solve( start_solution=nothing, fw_verbose=false, use_shadow_set=true, + heuristic=BosciaHeuristic(), kwargs..., ) if verbose @@ -189,6 +191,7 @@ function solve( :usePostsolve => use_postsolve, :variant => variant, :use_shadow_set => use_shadow_set, + :heurtics => [heuristic], # Is a vector/list sufficent or would a dictonary be better? ), ), branch_strategy=branching_strategy,