33from functools import partial
44from multiprocessing import cpu_count
55from pathlib import Path
6- from typing import Optional
76
87import numpy as np
98import tomli
@@ -115,10 +114,10 @@ def _solve(
115114 time_limit : float ,
116115 display : bool ,
117116 num_workers_per_instance : int ,
118- config_loc : Optional [ Path ] ,
119- sol_dir : Optional [ Path ] ,
117+ config_loc : Path | None ,
118+ sol_dir : Path | None ,
120119 permutation_max_jobs : int ,
121- ) -> Optional [ tuple [str , str , float , float , float ]] :
120+ ) -> tuple [str , str , float , float , float ] | None :
122121 """
123122 Solves a single problem instance.
124123 """
@@ -128,11 +127,12 @@ def _solve(
128127 else :
129128 params = {}
130129
131- data = read (instance_loc , problem_variant )
132- if data .constraints .same_sequence :
130+ data = read (instance_loc , problem_variant , solver )
131+ if data .constraints .same_sequence and problem_variant != ProblemVariant . NW_PFSP :
133132 # For permutation problems we skip instances that are too large.
134133 # We have to recompute the number of jobs because we no longer
135134 # create jobs if they are not relevant to the problem.
135+ # NW-PFSP is exempt: it is solved at all sizes regardless of solver.
136136 num_factories = data .num_modes // data .num_tasks
137137 num_stages = data .num_machines // num_factories
138138 num_jobs = data .num_tasks // num_stages
@@ -161,7 +161,7 @@ def _solve(
161161
162162
163163def _check_cpu_usage (
164- num_parallel_instances : int , num_workers_per_instance : Optional [ int ]
164+ num_parallel_instances : int , num_workers_per_instance : int | None
165165):
166166 """
167167 Warns if the number of workers per instance times the number of parallel
0 commit comments