You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a reason all edge weights get automatically rounded? Could this be optional?
Could you please emphasise the fact that the function get_weight() returns rounded values? The documentation says it returns floats, which makes the user think the precise value is returned.
The text was updated successfully, but these errors were encountered:
def euclidean(start, end, round=utils.nint):
"""Return the Euclidean distance between start and end.
This is capable of performing distance calculations for EUC_2D and
EUC_3D problems. If ``round=math.ceil`` is passed, this is suitable for
CEIL_2D problems as well.
:param tuple start: *n*-dimensional coordinate
:param tuple end: *n*-dimensional coordinate
:param callable round: function to use to round the result
:return: rounded distance
"""
if len(start) != len(end):
raise ValueError('dimension mismatch between start and end')
square_distance = sum(d * d for d in utils.deltas(start, end))
distance = math.sqrt(square_distance)
return round(distance)
Description
Is there a reason all edge weights get automatically rounded? Could this be optional?
Could you please emphasise the fact that the function
get_weight()
returns rounded values? The documentation says it returns floats, which makes the user think the precise value is returned.The text was updated successfully, but these errors were encountered: