Skip to content

Commit 1ada451

Browse files
committed
Fixing small bug
1 parent 0627efb commit 1ada451

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import setuptools
55

66
setup(name='coinor.grumpy',
7-
version='0.9.0',
7+
version='0.9.1',
88
description='Graphics for Understanding Mathematical Programming (GrUMPy)',
99
long_description='''GrUMPy is a class for visualizing various algorithm used in solving discrete optimization problem. It has a class for dynamically generating and visualizing branch-and-bound trees that is derived from the GiMPy graph class. Using the branch-and-bound class, a user can visualize the branch-and-bound process in a number of different ways either by building the tree dynamically through direct calls to Python from the solver or by piping the output of an instrumented solver to GrUMPy for parsing. The branch-and-bound class also includes a pure Python implementation of branch and bound that is targeted at educational use.
1010

src/grumpy/BranchAndBound.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def BranchAndBound(T, CONSTRAINTS, VARIABLES, OBJ, MAT, RHS,
157157
prob += LpConstraint(lpSum(var[branch_var]) <= rhs)
158158
print(branch_var, end=' ')
159159
pred = parent
160-
while str(pred) is not '0':
160+
while not str(pred) == '0':
161161
pred_branch_var = T.get_node_attr(pred, 'branch_var')
162162
pred_rhs = T.get_node_attr(pred, 'rhs')
163163
pred_sense = T.get_node_attr(pred, 'sense')
@@ -341,7 +341,7 @@ def BranchAndBound(T, CONSTRAINTS, VARIABLES, OBJ, MAT, RHS,
341341
if BBstatus == 'C':
342342
# Branching:
343343
# Choose a variable for branching
344-
branching_var = -1
344+
branching_var = None
345345
if branch_strategy == FIXED_BRANCHING:
346346
#fixed order
347347
for i in VARIABLES:
@@ -374,7 +374,7 @@ def BranchAndBound(T, CONSTRAINTS, VARIABLES, OBJ, MAT, RHS,
374374
else:
375375
print("Unknown branching strategy %s" %branch_strategy)
376376
exit()
377-
if branching_var >= 0:
377+
if branching_var is not None:
378378
print("Branching on variable %s" %branching_var)
379379
#Create new nodes
380380
if search_strategy == DEPTH_FIRST:

0 commit comments

Comments
 (0)