pylibmgm.GMLocalSearcherParallel
- class pylibmgm.GMLocalSearcherParallel
Parallel version of GM local search.
Similar to GMLocalSearcher but tries the re-matche for all graphs in parallel. Ranking the results by improvement, it applies the best improvement and stops if merge_all = False. If merge_all = True, it further checks all other improving re-matches iteratively and merges them as well, if they still improve the solution after. Provides faster optimization.
Methods
__init__(model[, merge_all])Initialize parallel GM local searcher.
search(solution)Perform parallel local search to improve the solution.
- __init__(model: pylibmgm.MgmModel, merge_all: bool = True) None
Initialize parallel GM local searcher.
- Parameters:
model (MgmModel) – The MGM model.
merge_all (bool, optional) – Whether to merge all parallel results at once (default: True).
- search(solution: pylibmgm.MgmSolution) bool
Perform parallel local search to improve the solution.
- Parameters:
solution (MgmSolution) – Solution to improve (modified in-place).
- Returns:
True if solution was improved.
- Return type:
bool