Skip to content

Commit 5de89ae

Browse files
committed
highs: add comments about confusion between BINARY and INTEGER
1 parent 3a4bd7b commit 5de89ae

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

mip/highs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ def __init__(self, model: mip.Model, name: str, sense: str):
720720
# Buffer string for storing names
721721
self._name_buffer = ffi.new(f"char[{self._lib.kHighsMaximumStringLength}]")
722722

723-
# type conversion maps
723+
# type conversion maps (can not distinguish binary from integer!)
724724
self._var_type_map = {
725725
mip.CONTINUOUS: self._lib.kHighsVarTypeContinuous,
726726
mip.BINARY: self._lib.kHighsVarTypeInteger,
@@ -815,6 +815,8 @@ def add_var(
815815
if name:
816816
check(self._lib.Highs_passColName(self._model, col, name.encode("utf-8")))
817817
if var_type != mip.CONTINUOUS:
818+
# Note that HiGHS doesn't distinguish binary and integer variables
819+
# by type. There is only a boolean flag for "integrality".
818820
self._num_int_vars += 1
819821
check(
820822
self._lib.Highs_changeColIntegrality(

0 commit comments

Comments
 (0)