Branching API
Coluna provides default implementations for the branching algorithm and the strong branching algorithms. Both implementations are built on top of an API that we describe here.
Candidates selection
Candidates selection is the first step (and sometimes the only step) of any branching algorithm. It chooses what are the possible branching constraints that will generate the children of the current node of the branch-and-bound tree.
Coluna provides the following function for this step:
Coluna.Branching.select!
— FunctionCandidates selection for branching algorithms.
It works as follows.
The user chooses one or several branching rules that indicate the type of branching he wants to perform. This may be on a single variable or on a linear expression of variables for instance.
The branching rule must implement apply_branching_rule
that generates the candidates. The latter are the variables or expressions on which the branch-and-bound may branch with additional information that is requested by Coluna's branching implementation through the API.
Then, candidates are sorted according to a selection criterion (e.g. most fractional). The algorithm keeps a certain number of candidates (one for classic branching, and several for strong branching). It generates the children of each candidate kept. At last, it returns the candidates kept.
Branching rule
Coluna.Branching.AbstractBranchingRule
— TypeSupertype of branching rules.
Coluna.Branching.apply_branching_rule
— FunctionReturns all candidates that satisfy a given branching rule.
Candidate
Coluna.Branching.AbstractBranchingCandidate
— TypeA branching candidate is a data structure that contain all information needed to generate children of a node.
Coluna.Branching.getdescription
— FunctionReturns a string which serves to print the branching rule in the logs.
Coluna.Branching.get_lhs
— FunctionReturns the left-hand side of the candidate.
Coluna.Branching.get_local_id
— FunctionReturns the generation id of the candidiate.
Coluna.Branching.generate_children!
— Functiongenerate_children!(branching_context, branching_candidate, lhs, env, reform, node)
This method generates the children of a node described by branching_candidate
.
Selection criterion
Coluna.Branching.AbstractSelectionCriterion
— TypeSupertype of selection criteria of branching candidates.
A selection criterion provides a way to keep only the most promising branching candidates. To create a new selection criterion, one needs to create a subtype of AbstractSelectionCriterion
and implements the method select_candidates!
.
Coluna.Branching.select_candidates!
— FunctionSort branching candidates according to the selection criterion and remove excess ones.
Branching API
Coluna.Branching.get_selection_nb_candidates
— FunctionReturns the number of candidates that the candidates selection step must return.
Coluna.Branching.branching_context_type
— FunctionReturns the type of context required by the algorithm parameters.
Coluna.Branching.new_context
— FunctionCreates a context.
Coluna.Branching.get_int_tol
— FunctionReturns integer tolerance.
Coluna.Branching.get_rules
— FunctionReturns branching rules.
Coluna.Branching.get_selection_criterion
— FunctionReturns the selection criterion.
Method advanced_select!
is part of the API but presented just below.
Advanced candidates selection
If the candidates' selection returns several candidates will all their children, advanced candidates selection must keep only one of them.
The advanced candidates' selection is the place to evaluate the children to get relevant additional key performance indicators about each branching candidate.
Coluna provides the following function for this step.
Coluna.Branching.advanced_select!
— FunctionAdvanced candidates selection that selects candidates by evaluating their children.
Coluna has two default implementations for this method:
- for the classic branching that does nothing because the candidates selection returns 1 candidate
- for the strong branching that performs several evaluations of the candidates.
Let us focus on the strong branching. Strong branching is a procedure that heuristically selects a branching constraint that potentially gives the best progress of the dual bound. The procedure selects a collection of branching candidates based on their branching rule (done in classic candidate selection) and their score (done in advanced candidate selection). Then, the procedure evaluates the progress of the dual bound in both branches of each branching candidate by solving both potential children using a conquer algorithm. The candidate that has the largest score is chosen to be the branching constraint.
However, the score can be difficult to compute. For instance, when the score is based on dual bound improvement produced by the branching constraint which is time-consuming to evaluate in the context of column generation Therefore, one can let the branching algorithm quickly estimate the score of each candidate and retain the most promising branching candidates. This is called a phase. The goal is to first evaluate a large number of candidates with a very fast conquer algorithm and retain a certain number of promising ones. Then, over the phases, it evaluates the improvement with a more precise conquer algorithm and restricts the number of retained candidates until only one is left.
Strong Branching API
Coluna.Branching.get_units_to_restore_for_conquer
— FunctionReturns the storage units that must be restored by the conquer algorithm called by the strong branching phase.
Coluna.Branching.get_phases
— FunctionReturns all phases context of the strong branching algorithm.
Coluna.Branching.get_score
— FunctionReturns the type of score used to rank the candidates at a given strong branching phase.
Coluna.Branching.get_conquer
— FunctionReturns the conquer algorithm used to evaluate the candidate's children at a given strong branching phase.
Coluna.Branching.get_max_nb_candidates
— FunctionReturns the maximum number of candidates kept at the end of a given strong branching phase.
The following methods are part of the API but have a default implementation. We advise you to not change them.
Missing docstring for Branching.perform_branching_phase!
. Check Documenter's build log for details.
Missing docstring for Branching.eval_candidate!
. Check Documenter's build log for details.
Coluna.Branching.eval_child_of_candidate!
— FunctionEvaluate children of a candidate.
Score
Coluna.Branching.AbstractBranchingScore
— TypeSupertype of branching scores.
Coluna.Branching.compute_score
— FunctionReturns the score of a candidate.