In gls.py, the penalty matrix is initialized to zero within the _guided_local_search() and _guided_local_search_with_time() functions.
However, when the default update_edge_distance() function (located in template.py and evaluation.py) is called, this penalty (passed as edge_n_used) is used as a denominator:
combined_factor = (1 / edge_n_used) + (1 / edge_n_used)
Since NumPy is used for these operations, it triggers the following warning:
RuntimeWarning: divide by zero encountered in divide
Perhaps the default update_edge_distance() function should handle cases where edge_n_used is zero to avoid these division-by-zero warnings.
In
gls.py, thepenaltymatrix is initialized to zero within the_guided_local_search()and_guided_local_search_with_time()functions.However, when the default
update_edge_distance()function (located intemplate.pyandevaluation.py) is called, thispenalty(passed asedge_n_used) is used as a denominator:Since NumPy is used for these operations, it triggers the following warning:
RuntimeWarning: divide by zero encountered in dividePerhaps the default
update_edge_distance()function should handle cases whereedge_n_usedis zero to avoid these division-by-zero warnings.