Advances in Mixed Integer Programming
Download
Report
Transcript Advances in Mixed Integer Programming
Branching
SCIP Workshop at ZIB
October 2007
Tobias Achterberg
Konrad-Zuse-Zentrum für Informationstechnik Berlin
[email protected]
2
Branching
current solution is infeasible
3
Branching on Variables
split problems into sub problems to cut off
current solution
4
Branching
current solution is infeasible
5
Branching on Constraints
split problems into subproblems to cut off
current solution
6
Branching in SCIP
in constraint handlers and branching rules
„last resort“ for dealing with infeasible node
solutions
no domain propagation or cuts available/desired
split current problem into any number of
subproblems (children) such that
each child is „more restricted“ than current problem
(„children become smaller“)
at least one child has the same optimum value as the
current problem
(„optimal solution is not lost“)
7
Implementing Branching Rules in SCIP
1. create child node
SCIPcreateChild(scip, &node, prio);
2. modify child node
SCIPaddConsNode(scip, node, cons, NULL);
SCIPchgVarLbNode(scip, node, var, newlb);
SCIPchgVarUbNode(scip, node, var, newub);
3. if more children needed, goto 1.
4. set result code
*result = SCIP_BRANCHED;
8
Branching on Variables in SCIP
Calling
SCIPbranchVar(scip, var, ...)
is shortcut for:
SCIP_NODE* node;
SCIP_Real x = SCIPvarGetLPSol(var);
SCIPcreateChild(scip, &node,
SCIPchgVarUbNode(scip, node,
SCIPcreateChild(scip, &node,
SCIPchgVarLbNode(scip, node,
downprio);
var, floor(x));
upprio);
var, ceil(x));
node selection priorities are automatically calculated by
child selection rule
9
Example: Random Branching
SCIP_DECL_BRANCHEXECLP(branchExeclpRandom)
{
SCIP_BRANCHRULEDATA* branchruledata;
SCIP_VAR** lpcands;
int nlpcands;
int k;
branchruledata = SCIPbranchruleGetData(branchrule);
SCIP_CALL(SCIPgetLPBranchCands(scip, &lpcands,
NULL, NULL, NULL, &nlpcands));
k = SCIPgetRandomInt(0, nlpcands-1,
&branchruledata->randseed);
SCIP_CALL(SCIPbranchVar(scip, lpcands[k],
NULL, NULL, NULL));
*result = SCIP_BRANCHED;
return SCIP_OKAY;
}
10
Branching Rules for MIP
most common MIP branching rules branch on
variables:
two children
split domain of single variable into two parts
choose variable with fractional LP value such that LP
solution changes in both children
remaining choices:
which fractional variable to branch on?
which of the two children to process next
related to node selection strategy
11
Branching Variable Selection
most fractional branching
choose variable with fractional value closest to 0.5
full strong branching
solve the LP relaxations for all possible branchings
choose the variable that yields largest LP objectives
strong branching
only apply strong branching on some candidates
only perform a limited number of simplex iterations
12
Pseudo Costs
c=2
LP relaxation yields lower bound
13
Pseudo Costs
x3 = 7.3
c=2
LP relaxation yields lower bound
integer variable has fractional LP value
14
Pseudo Costs
x3 ≤ 7
x3 = 7.3
c=2
x3 8
LP relaxation yields lower bound
integer variable has fractional LP value
branching decomposes problem into subproblems
15
Pseudo Costs
c=5
x3 ≤ 7
x3 = 7.3
c=2
x3 8
LP relaxation yields lower bound
integer variable has fractional LP value
branching decomposes problem into subproblems
LP relaxation is solved for subproblems
16
Pseudo Costs
c=5
x3 ≤ 7
x3 = 7.3
c=2
x3 8
history of objective changes caused by branching
on specific variable
objective gain per unit:
52
3
10
7.3 7 0.3
3
down/upwards pseudo costs j-, j+:
average of all objective gains per unit
17
Pseudo Cost Branching
choose variable with largest estimated LP
objective gain:
j f j j , j 1 f j j
What to do if pseudo costs are uninitialized?
pure pseudo cost branching
use average pseudo costs over all variables, or
j 1
pseudo cost with strong branching initialization
apply strong branching to initialize pseudo costs
18
Reliability Branching
choose variable with largest estimated LP
objective gain:
j f j j , j 1 f j j
pseudo costs are unreliable, if number of
updates is small: min j , j rel
apply strong branching on unreliable candidates
psc with strong branching initialization: rel 1
(full) strong branching:
reasonable value:
rel
rel 8
19
Branching in SAT
„Strong Branching“ equivalent:
apply domain propagation on all potential
subproblems
choose variable which leads to largest number of
inferences
Conflict Activity
choose variable that is contained in many recently
generated conflict clauses
„recently“: exponentially decreasing importance of
older conflict clauses
20
Hybrid Reliability/Inference Branching
Reliability Value
pseudo costs
strong branching on unreliable candidates
Inference History
like pseudo costs, but for number of inferences due to
branching on a variable
Conflict Score
number of conflicts for which branching on this
variable was part of the conflict reason
exponentially decreasing weight for older conflicts
21
Computational Results: nodes
1200
244 instances
shifted geometric nodes
ratio to „hybrid“ in percent
100
317
127
198
0
35
200
25
400
528
600
643
800
109
1076
1000
random
most inf
least inf
full strong
strong
pseudo cost
psc str init
reliability
inference
hybrid
22
Computational Results: time
441
450
400
250
319
300
326
350
244 instances
shifted geometric time
ratio to „hybrid“ in percent
100
106
195
0
108
50
133
100
144
150
195
200
random
most inf
least inf
full strong
strong
pseudo cost
psc str init
reliability
inference
hybrid
23
Branching Score Functions
pseudo costs yield LP objective gain estimates
for both branching directions
how to combine the two values into a single
score?
current approach: weighted sum
s j min j , j 1 max j , j
new approach: product
s j max j , max j ,
24
Computational Results
180
175
160
60
40
20
0
137
100
80
129
100
114
120
129
140
min (1)
weighted (1/6)
weighted (1/3)
average (1/2)
max (0)
product
25
Comparison to CPLEX and CBC
387.1
400
350
300
250
CPLEX
SCIP/CPX
SCIP/SPX
CBC
62.5
41.7
170.1
150.4
50
26.3
100
27.0
150
40.3
200
0
nodes (x100)
ratios to CPLEX 10.1
time (s)
nodes
time
SCIP/CPX
0.67
1.50
1.5x slower
SCIP/Soplex
0.65
3.61
3.6x slower
CBC/CLP
4.22
9.28
9.3x slower