ware_ops_algos.algorithms.routing¶
Submodules¶
Attributes¶
Classes¶
Abstract base class for all algorithms (routing, batching, etc.). |
|
Create a collection of name/value pairs. |
|
Helper class that provides a standard way to create an ABC using |
|
Abstract base class for all algorithms (routing, batching, etc.). |
|
Base class for heuristic routing algorithms. |
|
Implements S-shape routing. |
|
Implements Return routing. |
|
Implements Midpoint routing. |
|
Implements Largest Gap Routing for order picking in a warehouse. |
|
A class to perform nearest neighbourhood routing for order picking in a warehouse using Dijkstra's algorithm. |
|
Base class for heuristic routing algorithms. |
|
Base class for exact routing algorithms. |
|
Implements the exact routing algorithm for the Traveling Salesman Problem (TSP). |
|
Implements the exact routing algorithm for the Traveling Salesman Problem (TSP) using distance as the objective. |
|
Implements the exact routing algorithm for TSP with weight-based precedence constraints. |
|
Implements the exact routing algorithm for the Traveling Salesman Problem (TSP) using time as the objective. |
|
Implements the exact routing algorithm for the Traveling Salesman Problem (TSP) using maximum completion time as the objective. |
|
Dynamic Programming based approach to solve the picker routing problem in a single-block, parallel-aisle warehouse. |
|
Dynamic Programming based approach to solve the picker routing problem in a single-block, |
Package Contents¶
- class ware_ops_algos.algorithms.routing.Algorithm(seed: int | None = None)[source]¶
Bases:
abc.ABC,Generic[I,O]Abstract base class for all algorithms (routing, batching, etc.). Handles timing, algo naming, and ensures consistent result metadata.
- algo_name: str = 'Algorithm'¶
- logger¶
- class ware_ops_algos.algorithms.routing.Route[source]¶
- route: list[tuple[int, int]] | None = None¶
- item_sequence: list[tuple[int, int]] | None = None¶
- distance: float = 0.0¶
- class ware_ops_algos.algorithms.routing.PickPosition[source]¶
- order_number: int¶
- article_id: int¶
- amount: int¶
- pick_node: tuple[int, int]¶
- in_store: int¶
- article_name: str | None = None¶
- picked: bool | None = None¶
- class ware_ops_algos.algorithms.routing.RouteNode[source]¶
Bases:
NamedTuple- position: tuple[int, int]¶
- class ware_ops_algos.algorithms.routing.NodeType(*args, **kwds)[source]¶
Bases:
enum.EnumCreate a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- PICK¶
- ROUTE¶
- class ware_ops_algos.algorithms.routing.Resource[source]¶
- id: int¶
- capacity: int | None = None¶
- speed: float | None = None¶
- time_per_pick: float | None = None¶
- tpe: ResourceType¶
- tour_setup_time: float = None¶
- occupied: bool | None = None¶
- current_location: tuple[float, float] | None = None¶
- class ware_ops_algos.algorithms.routing.OrderPosition[source]¶
- order_number: int¶
- article_id: int¶
- amount: int¶
- article_name: str | None = None¶
- static from_dict(order_number: int, data: dict) OrderPosition[source]¶
- class ware_ops_algos.algorithms.routing.Article[source]¶
- article_id: int¶
- article_name: str | None = None¶
- weight: float | None = None¶
- volume: float | None = None¶
- class ware_ops_algos.algorithms.routing.StorageLocations[source]¶
Bases:
ware_ops_algos.domain_models.BaseDomainObjectHelper class that provides a standard way to create an ABC using inheritance.
- tpe: StorageType¶
- storage_slots: list[StorageLocation] | None = None¶
- location_article_mapping: dict[tuple[int | float, int | float], int] | None¶
- ware_ops_algos.algorithms.routing.equivalence_classes = [('U', 'U', '1C'), ('E', '0', '1C'), ('0', 'E', '1C'), ('E', 'E', '1C'), ('E', 'E', '2C'), ('0',...[source]¶
- class ware_ops_algos.algorithms.routing.Routing(start_node: tuple[int, int], end_node: tuple[int, int], closest_node_to_start: tuple[int, int], min_aisle_position: int, max_aisle_position: int, picker: list[ware_ops_algos.domain_models.Resource], gen_tour: bool = False, gen_item_sequence: bool = False, node_list: list[tuple[float, float]] = None, node_to_idx: dict = None, idx_to_node: dict = None, distance_matrix: pandas.DataFrame | None = None, predecessor_matrix: numpy.array = None, **kwargs)[source]¶
Bases:
ware_ops_algos.algorithms.algorithm.Algorithm[list[ware_ops_algos.algorithms.algorithm.PickPosition]| list[ware_ops_algos.domain_models.OrderPosition],ware_ops_algos.algorithms.algorithm.RoutingSolution],abc.ABCAbstract base class for all algorithms (routing, batching, etc.). Handles timing, algo naming, and ensures consistent result metadata.
- start_node¶
- end_node¶
- closest_node_to_start¶
- min_aisle_position¶
- max_aisle_position¶
- pick_list: list[ware_ops_algos.algorithms.algorithm.PickPosition] | None = None¶
- distance_matrix = None¶
- predecessor_matrix = None¶
- node_list: list[tuple[float, float]] = None¶
- node_to_idx = None¶
- idx_to_node = None¶
- gen_item_sequence = False¶
- gen_tour = False¶
- item_sequence = []¶
- route = []¶
- annotated_route: list[ware_ops_algos.algorithms.algorithm.RouteNode] = []¶
- distance = 0¶
- current_order: list[ware_ops_algos.algorithms.algorithm.PickPosition] | None = None¶
- picker¶
- execution_time = None¶
- class ware_ops_algos.algorithms.routing.HeuristicRouting(start_node: tuple[int, int], end_node: tuple[int, int], closest_node_to_start: tuple[int, int], min_aisle_position: int, max_aisle_position: int, distance_matrix, predecessor_matrix, picker, fixed_depot=True, **kwargs)[source]¶
Bases:
Routing,abc.ABCBase class for heuristic routing algorithms.
- fixed_depot = True¶
- class ware_ops_algos.algorithms.routing.SShapeRouting(start_node: tuple[int, int], end_node: tuple[int, int], closest_node_to_start: tuple[int, int], min_aisle_position: int, max_aisle_position: int, distance_matrix, predecessor_matrix, picker, fixed_depot=True, **kwargs)[source]¶
Bases:
HeuristicRoutingImplements S-shape routing.
- algo_name = 'SShapeRouting'¶
- class ware_ops_algos.algorithms.routing.ReturnRouting(start_node: tuple[int, int], end_node: tuple[int, int], closest_node_to_start: tuple[int, int], min_aisle_position: int, max_aisle_position: int, distance_matrix, predecessor_matrix, picker, fixed_depot=True, **kwargs)[source]¶
Bases:
HeuristicRoutingImplements Return routing.
- algo_name = 'ReturnRouting'¶
- class ware_ops_algos.algorithms.routing.MidpointRouting(start_node: tuple[int, int], end_node: tuple[int, int], closest_node_to_start: tuple[int, int], min_aisle_position: int, max_aisle_position: int, distance_matrix, predecessor_matrix, picker, fixed_depot=True, **kwargs)[source]¶
Bases:
HeuristicRoutingImplements Midpoint routing.
- algo_name = 'MidpointRouting'¶
- static split_orders_by_pickzone(resolved_positions, mid_point: int) tuple[list[ware_ops_algos.algorithms.algorithm.PickPosition], list[ware_ops_algos.algorithms.algorithm.PickPosition]][source]¶
- class ware_ops_algos.algorithms.routing.LargestGapRouting(start_node: tuple[int, int], end_node: tuple[int, int], closest_node_to_start: tuple[int, int], min_aisle_position: int, max_aisle_position: int, distance_matrix, predecessor_matrix, picker, fixed_depot=True, **kwargs)[source]¶
Bases:
HeuristicRoutingImplements Largest Gap Routing for order picking in a warehouse.
- algo_name = 'LargestGapRouting'¶
- class ware_ops_algos.algorithms.routing.NearestNeighbourhoodRouting(start_node: tuple[int, int], end_node: tuple[int, int], closest_node_to_start: tuple[int, int], min_aisle_position: int, max_aisle_position: int, distance_matrix, predecessor_matrix, picker, fixed_depot=True, **kwargs)[source]¶
Bases:
HeuristicRoutingA class to perform nearest neighbourhood routing for order picking in a warehouse using Dijkstra’s algorithm.
- algo_name = 'NearestNeighbourhoodRouting'¶
- class ware_ops_algos.algorithms.routing.PickListRouting(start_node: tuple[int, int], end_node: tuple[int, int], closest_node_to_start: tuple[int, int], min_aisle_position: int, max_aisle_position: int, distance_matrix, predecessor_matrix, picker, **kwargs)[source]¶
Bases:
HeuristicRoutingBase class for heuristic routing algorithms.
- algo_name = 'PickListRouting'¶
- class ware_ops_algos.algorithms.routing.ExactRouting(start_node: tuple[int, int], end_node: tuple[int, int], distance_matrix: pandas.DataFrame, predecessor_matrix: dict, picker: list[ware_ops_algos.domain_models.Resource], big_m, set_time_limit, **kwargs)[source]¶
Bases:
Routing,abc.ABCBase class for exact routing algorithms.
- big_m¶
- time_limit¶
- length = None¶
- pick_nodes = None¶
- mdl = None¶
- amount_at_pick_nodes = None¶
- class ware_ops_algos.algorithms.routing.ExactTSPRouting(start_node: tuple[int, int], end_node: tuple[int, int], distance_matrix: pandas.DataFrame, predecessor_matrix: dict, picker: list[ware_ops_algos.domain_models.Resource], big_m, set_time_limit, **kwargs)[source]¶
Bases:
ExactRoutingImplements the exact routing algorithm for the Traveling Salesman Problem (TSP).
- T = None¶
- C_max = None¶
- x = None¶
- x_start = None¶
- x_end = None¶
- class ware_ops_algos.algorithms.routing.ExactTSPRoutingDistance(start_node: tuple[int, int], end_node: tuple[int, int], distance_matrix: pandas.DataFrame, predecessor_matrix: numpy.array, picker: list[ware_ops_algos.domain_models.Resource], gen_tour, gen_item_sequence, big_m=1000, set_time_limit=300, **kwargs)[source]¶
Bases:
ExactTSPRoutingImplements the exact routing algorithm for the Traveling Salesman Problem (TSP) using distance as the objective.
- algo_name = 'ExactTSPRoutingDistance'¶
- class ware_ops_algos.algorithms.routing.ExactTSPRoutingDistanceWithWeightPrecedence(start_node: tuple[int, int], end_node: tuple[int, int], distance_matrix: pandas.DataFrame, predecessor_matrix: numpy.array, picker: list[ware_ops_algos.domain_models.Resource], gen_tour, gen_item_sequence, articles: list[ware_ops_algos.domain_models.Article], big_m=1000, set_time_limit=300, **kwargs)[source]¶
Bases:
ExactTSPRoutingImplements the exact routing algorithm for TSP with weight-based precedence constraints. Heavy items must be picked before lighter items.
- algo_name = 'ExactTSPRoutingDistanceWithWeightPrecedence'¶
- articles¶
- weights = []¶
- class ware_ops_algos.algorithms.routing.ExactTSPRoutingTime(start_node: tuple[int, int], end_node: tuple[int, int], distance_matrix: pandas.DataFrame, predecessor_matrix: dict, picker: list[ware_ops_algos.domain_models.Resource], gen_tour, gen_item_sequence, big_m, set_time_limit, **kwargs)[source]¶
Bases:
ExactTSPRoutingImplements the exact routing algorithm for the Traveling Salesman Problem (TSP) using time as the objective.
- algo_name = 'ExactTSPRouting'¶
- travel_time_matrix¶
- class ware_ops_algos.algorithms.routing.ExactTSPRoutingMaxCompletionTime(batched_list, distance_matrix, tour_matrix, picker, big_m, objective, **kwargs)[source]¶
Bases:
ExactTSPRoutingImplements the exact routing algorithm for the Traveling Salesman Problem (TSP) using maximum completion time as the objective.
- algo_name = 'ExactTSPRoutingMaxCompletionTime'¶
- class ware_ops_algos.algorithms.routing.RatliffRosenthalRouting(start_node: tuple[int, int], end_node: tuple[int, int], closest_node_to_start: tuple[int, int], min_aisle_position: int, max_aisle_position: int, picker: list[ware_ops_algos.domain_models.Resource], n_aisles: int, n_pick_locations: int, dist_aisle: float, dist_pick_locations: float, dist_aisle_location: float, dist_start: float, dist_end: float, gen_tour: bool = False, gen_item_sequence: bool = False, **kwargs)[source]¶
Bases:
RoutingDynamic Programming based approach to solve the picker routing problem in a single-block, parallel-aisle warehouse.
- Based on:
Katrin Heßler, Stefan Irnich (2024) Exact Solution of the Single-Picker Routing Problem with Scattered Storage. INFORMS Journal on Computing 36(6):1417-1435. https://doi.org/10.1287/ijoc.2023.0075
- algo_name = 'RatliffRosenthalRouting'¶
- state_graph¶
- n_aisles¶
- n_pick_locations¶
- dist_aisle¶
- dist_pick_locations¶
- dist_aisle_location¶
- dist_start¶
- dist_end¶
- depot¶
- static largest_gap(order_list: list[ware_ops_algos.algorithms.algorithm.PickPosition])[source]¶
- cost_fn_wrapper(order_subset: list[ware_ops_algos.algorithms.algorithm.PickPosition], transition: str, node=None)[source]¶
- get_item_sequence_from_path() list[ware_ops_algos.algorithms.algorithm.PickPosition][source]¶
Extracts the ordered pick sequence from the dynamic programming path (self.path). :returns: ordered item sequence along the optimal tour. :rtype: list[PickPosition]
- class ware_ops_algos.algorithms.routing.RatliffRosenthalScatteredRouting(storage_locations: ware_ops_algos.domain_models.StorageLocations, *args, **kwargs)[source]¶
Bases:
RatliffRosenthalRoutingDynamic Programming based approach to solve the picker routing problem in a single-block, parallel-aisle warehouse with scattered storage.
- Based on:
Katrin Heßler, Stefan Irnich (2024) Exact Solution of the Single-Picker Routing Problem with Scattered Storage. INFORMS Journal on Computing 36(6):1417-1435. https://doi.org/10.1287/ijoc.2023.0075
- algo_name = 'RatliffRosenthalScattered'¶
- storage_locations¶
- state_graph: networkx.MultiDiGraph¶
- demand: dict[int, int]¶
- aisle_content: dict[int, list[dict]]¶
- total_warehouse_supply: dict[int, int]¶
- aisle_total_supply: dict[int, dict[int, int]]¶