Skip to content

How to get the branching scores for only one variable. #229

Answered by gasse
msublee asked this question in Questions
Discussion options

You must be logged in to vote

In theory you should be able to compute individual SB scores using PySCIPOpt and probing. Something like that:

# we want the SB score of variable var
# var = ...
var_val = var.getLPSol()
lp_val = model.getLPObjVal()

# left child LP value
model.startProbing()
model.chgVarUbProbing(var, int(math.floor(var_val)))
model.applyCutsProbing()
model.solveProbingLP()
left_lp_val = model.getLPObjVal()
left_lp_stat = model.getLPSolstat()
model.endProbing()

# right child LP value
model.startProbing()
model.chgVarLbProbing(var, int(math.ceil(var_val)))
model.applyCutsProbing()
model.solveProbingLP()
right_lp_val = model.getLPObjVal()
right_lp_stat = model.getLPSolstat()
model.endProbing()

# compute …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@msublee
Comment options

Comment options

You must be logged in to vote
1 reply
@msublee
Comment options

Answer selected by msublee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants