MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / test_node_promising

Function test_node_promising

tests/search/test_SearchSpace.py:156–174  ·  view source on GitHub ↗

Tests marking nodes (and their client neighbours) as promising.

(
    ok_small,
    mark: int,
    exp_marked: list[int],
    exp_unmarked: list[int],
)

Source from the content-addressed store, hash-verified

154 ],
155)
156def test_node_promising(
157 ok_small,
158 mark: int,
159 exp_marked: list[int],
160 exp_unmarked: list[int],
161):
162 """
163 Tests marking nodes (and their client neighbours) as promising.
164 """
165 route = make_search_route(ok_small, [1, 2, 3, 4])
166
167 search_space = SearchSpace(ok_small, compute_neighbours(ok_small))
168 search_space.mark_promising(route[mark])
169
170 for exp in exp_marked:
171 assert_(search_space.is_promising(exp))
172
173 for exp in exp_unmarked:
174 assert_(not search_space.is_promising(exp))
175
176
177def test_search_order_and_shuffle(ok_small_two_profiles):

Callers

nothing calls this directly

Calls 3

make_search_routeFunction · 0.90
compute_neighboursFunction · 0.90
SearchSpaceClass · 0.85

Tested by

no test coverage detected