ml4co_kit.task.routing.tsp.spctsp
Stochastic Prize Collecting Traveling Salesman Problem (SPCTSP).
The SPCTSP is a variant of PCTSP where the actual prize values are revealed only when nodes are visited, making it a stochastic optimization problem.
Classes
|
- class ml4co_kit.task.routing.tsp.spctsp.SPCTSPTask(distance_type: ~ml4co_kit.task.routing.base.DISTANCE_TYPE = DISTANCE_TYPE.EUC_2D, round_type: ~ml4co_kit.task.routing.base.ROUND_TYPE = ROUND_TYPE.NO, precision: ~numpy.float32 | ~numpy.float64 = <class 'numpy.float32'>, threshold: float = 1e-05)[source]
Bases:
RoutingTaskBase- evaluate(sol: ndarray, check_constr: bool = True) floating[source]
Evaluate the total cost of the SPCTSP solution.
- from_data(depots: ndarray | None = None, points: ndarray | None = None, penalties: ndarray | None = None, expected_prizes: ndarray | None = None, actual_prizes: ndarray | None = None, required_prize: float | None = None, sol: ndarray | None = None, ref: bool = False, normalize: bool = False, name: str | None = None)[source]
Create a problem instance from raw data. To be implemented by subclasses.