pylibmgm.solver.synchronize_solution
- pylibmgm.solver.synchronize_solution(model, solution, feasible=True, iterations=3, opt_level=OptimizationLevel.EXHAUSTIVE)
Use GREEDA as a synchronization algorithm
The algorithm takes in a cycle inconsistent solution and returns a consistent one.
- Parameters:
model (
pylibmgm.MgmModel) – Model to be optimized over.solution (
pylibmgm.MgmSolution) – Initial (cycle-inconsistent) solution of the given model.feasible (bool, optional) – If True, the synchronization problem will not consider forbidden matchings i.e. unspecified costs of model. As such, a solution remains valid under sparsity assumptions and contain only matchings for which a cost factor is contained in the model. However, most other synchronization algorithms can not account for sparsity. As such, setting feasible to False allows the algorithm to consider the same unrestricted search space as other synchronization algorithms.
iterations (int, optional) – Specify, how often to run the algorithm. Only the best solution of the specified number of iterations will be returned.
opt_level (
pylibmgm.solver.OptimizationLevel, optional) – Choose an optimization level to balance speed against solution quality.
- Return type: