Skip to content

Commit ad25c2b

Browse files
authored
New function getPseudoBranchCands (#523)
* Add getPseudoBranchCands * Update CHANGELOG
1 parent fb01365 commit ad25c2b

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# CHANGELOG
22
## Unreleased
33
### Added
4+
- add SCIP function `getPseudoBranchCands`
5+
46
### Fixed
57
### Changed
68
### Removed

src/pyscipopt/scip.pyx

+19
Original file line numberDiff line numberDiff line change
@@ -3750,6 +3750,25 @@ cdef class Model:
37503750
return ([Variable.create(lpcands[i]) for i in range(nlpcands)], [lpcandssol[i] for i in range(nlpcands)],
37513751
[lpcandsfrac[i] for i in range(nlpcands)], nlpcands, npriolpcands, nfracimplvars)
37523752

3753+
def getPseudoBranchCands(self):
3754+
"""gets branching candidates for pseudo solution branching (non-fixed variables)
3755+
along with the number of candidates.
3756+
3757+
:return tuple (pseudocands, npseudocands, npriopseudocands) where
3758+
3759+
pseudocands: list of variables of pseudo branching candidates
3760+
npseudocands: number of pseudo branching candidates
3761+
npriopseudocands: number of candidates with maximal priority
3762+
3763+
"""
3764+
cdef int npseudocands
3765+
cdef int npriopseudocands
3766+
3767+
cdef SCIP_VAR** pseudocands
3768+
3769+
PY_SCIP_CALL(SCIPgetPseudoBranchCands(self._scip, &pseudocands, &npseudocands, &npriopseudocands))
3770+
3771+
return ([Variable.create(pseudocands[i]) for i in range(npseudocands)], npseudocands, npriopseudocands)
37533772

37543773
def branchVar(self, variable):
37553774
"""Branch on a non-continuous variable.

0 commit comments

Comments
 (0)