dwave.optimization.model.ArraySymbol.maybe_equals#

ArraySymbol.maybe_equals(other)#

Compare to another symbol.

Parameters:

other – Another symbol in the model.

Returns:

True if the two symbols might be equal.

Examples

This example compares IntegerVariable symbols of different sizes.

>>> from dwave.optimization import Model
>>> model = Model()
>>> i = model.integer(3, lower_bound=0, upper_bound=20)
>>> j = model.integer(3, lower_bound=-10, upper_bound=10)
>>> k = model.integer(5, upper_bound=55)
>>> i.maybe_equals(j)
1
>>> i.maybe_equals(k)
0