Skip to content

make add_new_solution! more flexible #25

Description

@matbesancon
function add_new_solution!(tree::BnBTree{N,R,V,S}, node::AbstractNode) where {N,R,V,S<:DefaultSolution{N,V}}
    sol = DefaultSolution(node.ub, get_relaxed_values(tree, node), node)
    if isempty(tree.solutions)
        push!(tree.solutions, sol)
    else
        tree.solutions[1] = sol
    end
end

This assumes that the solution is computed from get_relaxed_values, the function should take other arguments for the solution itself and its value.

On example is when another subroutine (like a heuristic run at the node) is finding a feasible solution different from the relaxed vector

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions