ware_ops_algos.algorithms

Submodules

Attributes

Classes

Order

ResolvedOrderPosition

OrderPosition

Resource

AlgorithmSolution

PickPosition

WarehouseOrder

ItemAssignmentSolution

BatchObject

BatchingSolution

PickList

PickerAssignment

AssignmentSolution

NodeType

Create a collection of name/value pairs.

RouteNode

Route

PickTour

TourStates

str(object='') -> str

TourPlanningState

Thin wrapper around a Route object.

RoutingSolution

CombinedRoutingSolution

Sequencing

Assignment

Job

SchedulingSolution

OrderSelectionSolution

PlanningState

Algorithm

Abstract base class for all algorithms (routing, batching, etc.).

Algorithm

Abstract base class for all algorithms (routing, batching, etc.).

RoutingSolution

Route

PickPosition

RouteNode

NodeType

Create a collection of name/value pairs.

CombinedRoutingSolution

Resource

OrderPosition

Article

StorageLocations

Helper class that provides a standard way to create an ABC using

Routing

Abstract base class for all algorithms (routing, batching, etc.).

HeuristicRouting

Base class for heuristic routing algorithms.

SShapeRouting

Implements S-shape routing.

ReturnRouting

Implements Return routing.

MidpointRouting

Implements Midpoint routing.

LargestGapRouting

Implements Largest Gap Routing for order picking in a warehouse.

NearestNeighbourhoodRouting

A class to perform nearest neighbourhood routing for order picking in a warehouse using Dijkstra's algorithm.

PickListRouting

Base class for heuristic routing algorithms.

ExactRouting

Base class for exact routing algorithms.

ExactTSPRouting

Implements the exact routing algorithm for the Traveling Salesman Problem (TSP).

ExactTSPRoutingDistance

Implements the exact routing algorithm for the Traveling Salesman Problem (TSP) using distance as the objective.

ExactTSPRoutingDistanceWithWeightPrecedence

Implements the exact routing algorithm for TSP with weight-based precedence constraints.

ExactTSPRoutingTime

Implements the exact routing algorithm for the Traveling Salesman Problem (TSP) using time as the objective.

ExactTSPRoutingMaxCompletionTime

Implements the exact routing algorithm for the Traveling Salesman Problem (TSP) using maximum completion time as the objective.

RatliffRosenthalRouting

Dynamic Programming based approach to solve the picker routing problem in a single-block, parallel-aisle warehouse.

RatliffRosenthalScatteredRouting

Dynamic Programming based approach to solve the picker routing problem in a single-block,

CapacityChecker

Routing

Abstract base class for all algorithms (routing, batching, etc.).

BatchingSolution

BatchObject

WarehouseOrder

Order

PickCart

Articles

Helper class that provides a standard way to create an ABC using

DimensionType

str(object='') -> str

Box

Batching

Batching class to batch orders

PriorityBatching

Priority batching class to batch orders based on sorting criterion.

OrderNrFifoBatching

First in First out batching based on order number.

FifoBatching

First in First out batching class to batch orders

RandomBatching

First in First out batching class to batch orders

DueDateBatching

First in First out batching class to batch orders

SavingsBatching

Base class for savings-based batching algorithms.

ClarkAndWrightBatching

Base class for savings-based batching algorithms.

SeedCriteria

str(object='') -> str

SimilarityMeasure

str(object='') -> str

SeedBatching

Batching class to batch orders

LocalSearchBatching

Order batching via local search with swap and shift neighborhoods.

Order

ResolvedOrderPosition

StorageLocations

Helper class that provides a standard way to create an ABC using

Location

ItemAssignment

Abstract base class for all algorithms (routing, batching, etc.).

GreedyItemAssignment

Greedy item assignment heuristic. Assigns items from locations with the highest inventory level first

NearestNeighborItemAssignment

Simple nearest neighborhood based item assignment heuristic. Selects closest to the current location until demand

PriorityItemAssignment

Base class for Weidinger item assignment algorithms.

SinglePositionItemAssignment

Base class for Weidinger item assignment algorithms.

MinMaxItemAssignment

Algorithm 1: MinMax

MinMinItemAssignment

Algorithm 1: MinMin

SchedulingSolution

Job

Route

AlgorithmSolution

PickList

OrdersDomain

Helper class that provides a standard way to create an ABC using

Resources

Helper class that provides a standard way to create an ABC using

Resource

Order

SequencingInput

Sequencing

SequencingSolution

PickListSequencer

Performs sequencing of pick list: takes pick list, returns them in sorted order.

EDDSequencer

Performs sequencing of pick list: takes pick list, returns them in sorted order.

SchedulingInput

Minimal info the scheduler needs.

PriorityScheduling

Schedule by: sort jobs once using a rule, then assign to earliest-free picker.

SPTScheduling

Shortest Processing Time first.

LPTScheduling

Longest Processing Time first (often better for makespan).

EDDScheduling

Earliest Due Date first (good for tardiness).

ERDScheduling

Earliest Release Date first (start as soon as available).

FIFOScheduling

By smallest order number in batch (proxy for input order).

Resource

Assigner

Abstract base class for all algorithms (routing, batching, etc.).

RoundRobinAssigner

Abstract base class for all algorithms (routing, batching, etc.).

RoutingSolution

Route

CombinedRoutingSolution

PickPosition

WarehouseOrder

Resource

Routing

Abstract base class for all algorithms (routing, batching, etc.).

RoutingBatchingAssigning

Base class for routing algorithms.

ExactTSPBatchingAndRoutingDistance

Implements the exact routing algorithm for the Traveling Salesman Problem (TSP) with batching.

ExactTSPBatchingAndRoutingMaxCompletionTime

Implements the exact routing algorithm for the Traveling Salesman Problem (TSP) with batching.

ExactCombinedBatchingRouting

Exact MIP for the joint Order-Batching and Picker-Routing Problem (OBRP)

Resource

ResourceType

str(object='') -> str

OrderSelection

Abstract base class for all algorithms (routing, batching, etc.).

DummyOrderSelection

Abstract base class for all algorithms (routing, batching, etc.).

GreedyOrderSelection

Abstract base class for all algorithms (routing, batching, etc.).

MinDistOrderSelection

Abstract base class for all algorithms (routing, batching, etc.).

MinAisleOrderSelection

Abstract base class for all algorithms (routing, batching, etc.).

MinMaxArticlesCobotSelection

Abstract base class for all algorithms (routing, batching, etc.).

MinMaxAisleOrderSelection

Abstract base class for all algorithms (routing, batching, etc.).

TimeIndexedMinConflictSelection

Select order that minimizes predicted time-indexed aisle conflicts

Functions

plot_route(network_graph, route)

Visualizes a picker route

plot_route_with_directions(network_graph, route)

Visualizes a picker route with direction arrows, including repeated edges.

build_pick_lists(orders)

Package Contents

class ware_ops_algos.algorithms.Order[source]
order_id: int
due_date: datetime.datetime | float | None = None
order_date: datetime.datetime | float | None = None
order_positions: list[OrderPosition] = []
static from_dict(order_number: int, data: dict) Order[source]
class ware_ops_algos.algorithms.ResolvedOrderPosition[source]
position: OrderPosition
pick_node: tuple[int, int]
fulfilled: int | None = None
picked: bool | None = None
class ware_ops_algos.algorithms.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.Resource[source]
id: int
capacity: int | None = None
speed: float | None = None
time_per_pick: float | None = None
pick_cart: PickCart | None = None
tpe: ResourceType
tour_setup_time: float = None
occupied: bool | None = None
current_location: tuple[float, float] | None = None
ware_ops_algos.algorithms.I[source]
ware_ops_algos.algorithms.O[source]
class ware_ops_algos.algorithms.AlgorithmSolution[source]
algo_name: str = ''
execution_time: float = 0.0
provenance: dict[str, Any]
class ware_ops_algos.algorithms.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.WarehouseOrder[source]
order_id: int
due_date: float | None = None
order_date: float | None = None
pick_positions: list[PickPosition] | None = None
fulfilled: bool | None = None
class ware_ops_algos.algorithms.ItemAssignmentSolution[source]

Bases: AlgorithmSolution

resolved_orders: list[WarehouseOrder] = []
class ware_ops_algos.algorithms.BatchObject[source]
batch_id: int
orders: list[WarehouseOrder]
class ware_ops_algos.algorithms.BatchingSolution[source]

Bases: AlgorithmSolution

batches: list[BatchObject] | None = None
pick_lists: list[PickList] = None
class ware_ops_algos.algorithms.PickList[source]
pick_positions: list[PickPosition]
orders: list[WarehouseOrder]
release: float | None = None
earliest_due_date: float | None = None
id: int
property order_numbers: list[int]
class ware_ops_algos.algorithms.PickerAssignment[source]
picker: ware_ops_algos.domain_models.Resource
pick_list: PickList
class ware_ops_algos.algorithms.AssignmentSolution[source]

Bases: AlgorithmSolution

assignments: list[PickerAssignment] = []
class ware_ops_algos.algorithms.NodeType(*args, **kwds)[source]

Bases: enum.Enum

Create 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.RouteNode[source]

Bases: NamedTuple

position: tuple[int, int]
node_type: NodeType
class ware_ops_algos.algorithms.Route[source]
route: list[tuple[int, int]] | None = None
item_sequence: list[tuple[int, int]] | None = None
distance: float = 0.0
pick_list: PickList | None = None
annotated_route: list[RouteNode] | None = None
class ware_ops_algos.algorithms.PickTour[source]
pick_list: PickList
route: Route
assigned_picker: ware_ops_algos.domain_models.Resource
starts_after: int | None = None
starts_before: int | None = None
planned_start: float | None = None
planned_end: float | None = None
ware_ops_algos.algorithms.Node[source]
class ware_ops_algos.algorithms.TourStates[source]

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

PLANNED = 'planned'
ASSIGNED = 'assigned'
SCHEDULED = 'scheduled'
PENDING = 'pending'
STARTED = 'started'
DONE = 'done'
class ware_ops_algos.algorithms.TourPlanningState[source]

Thin wrapper around a Route object. Keeps track of the planning state for a single tour.

  • route_nodes / pick_sequence are copies from the plan (immutable intent).

  • cursor / picks_left / version are the mutable execution state.

  • original_route is kept only for debugging/inspection (do not mutate).

tour_id: int
order_numbers: list[int]
original_route: Route
pick_list: PickList
annotated_route: list[RouteNode]
assigned_resource: int | None = None
start_time: float | None = None
end_time: float | None = None
end_time_planned: float | None = None
cursor: int = 0
picks_left: Deque[Node]
open_pick_positions: list = []
status: str
current_node() RouteNode[source]
at_end() bool[source]

True if cursor is on the final node (typically the depot).

next_node() RouteNode[source]
class ware_ops_algos.algorithms.RoutingSolution[source]

Bases: AlgorithmSolution

route: Route | None = None
class ware_ops_algos.algorithms.CombinedRoutingSolution[source]

Bases: AlgorithmSolution

routes: list[Route] | None = None
class ware_ops_algos.algorithms.Sequencing[source]
pick_list_sequence: list[int]
class ware_ops_algos.algorithms.Assignment[source]
tour_id: int
picker_id: int
class ware_ops_algos.algorithms.Job[source]
batch_idx: int
picker_id: int
start_time: float
end_time: float
release_time: float
distance: float
n_picks: int
travel_time: float
handling_time: float
route: Route
class ware_ops_algos.algorithms.SchedulingSolution[source]

Bases: AlgorithmSolution

jobs: list[Job] | None = None
class ware_ops_algos.algorithms.OrderSelectionSolution[source]

Bases: AlgorithmSolution

selected_orders: list[WarehouseOrder] = []
class ware_ops_algos.algorithms.PlanningState[source]
item_assignment: ItemAssignmentSolution | None = None
batching_solutions: BatchingSolution | None = None
assignment_solutions: AssignmentSolution | None = None
routing_solutions: list[RoutingSolution] | None = []
sequencing_solutions: SchedulingSolution | None = None
order_selection_solutions: OrderSelectionSolution | None = None
provenance: dict[str, Any]
class ware_ops_algos.algorithms.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
solve(input_data: I) O[source]
class ware_ops_algos.algorithms.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
solve(input_data: I) O[source]
class ware_ops_algos.algorithms.RoutingSolution[source]

Bases: AlgorithmSolution

route: Route | None = None
class ware_ops_algos.algorithms.Route[source]
route: list[tuple[int, int]] | None = None
item_sequence: list[tuple[int, int]] | None = None
distance: float = 0.0
pick_list: PickList | None = None
annotated_route: list[RouteNode] | None = None
class ware_ops_algos.algorithms.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.RouteNode[source]

Bases: NamedTuple

position: tuple[int, int]
node_type: NodeType
class ware_ops_algos.algorithms.NodeType(*args, **kwds)[source]

Bases: enum.Enum

Create 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.CombinedRoutingSolution[source]

Bases: AlgorithmSolution

routes: list[Route] | None = None
class ware_ops_algos.algorithms.Resource[source]
id: int
capacity: int | None = None
speed: float | None = None
time_per_pick: float | None = None
pick_cart: PickCart | 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.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.Article[source]
article_id: int
article_name: str | None = None
weight: float | None = None
volume: float | None = None
to_dict() dict[str, Any][source]
class ware_ops_algos.algorithms.StorageLocations[source]

Bases: ware_ops_algos.domain_models.BaseDomainObject

Helper class that provides a standard way to create an ABC using inheritance.

tpe: StorageType
locations: list[Location] | None = None
storage_slots: list[StorageLocation] | None = None
article_location_mapping: dict[int, list[Location]] | None
location_article_mapping: dict[tuple[int | float, int | float], int] | None
build_article_location_mapping()[source]
get_locations_by_article_id(article_id: int) list[Location][source]
get_features() dict[str, Any][source]
ware_ops_algos.algorithms.equivalence_classes = [('U', 'U', '1C'), ('E', '0', '1C'), ('0', 'E', '1C'), ('E', 'E', '1C'), ('E', 'E', '2C'), ('0',...[source]
ware_ops_algos.algorithms.cross_aisle_mapping[source]
ware_ops_algos.algorithms.table_I[source]
ware_ops_algos.algorithms.table_II[source]
ware_ops_algos.algorithms.aisle_mapping[source]
class ware_ops_algos.algorithms.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.ABC

Abstract 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
reset_parameters()[source]
class ware_ops_algos.algorithms.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.ABC

Base class for heuristic routing algorithms.

fixed_depot = True
class ware_ops_algos.algorithms.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: HeuristicRouting

Implements S-shape routing.

algo_name = 'SShapeRouting'
class ware_ops_algos.algorithms.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: HeuristicRouting

Implements Return routing.

algo_name = 'ReturnRouting'
class ware_ops_algos.algorithms.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: HeuristicRouting

Implements 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.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: HeuristicRouting

Implements Largest Gap Routing for order picking in a warehouse.

algo_name = 'LargestGapRouting'
class ware_ops_algos.algorithms.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: HeuristicRouting

A class to perform nearest neighbourhood routing for order picking in a warehouse using Dijkstra’s algorithm.

algo_name = 'NearestNeighbourhoodRouting'
class ware_ops_algos.algorithms.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: HeuristicRouting

Base class for heuristic routing algorithms.

algo_name = 'PickListRouting'
class ware_ops_algos.algorithms.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.ABC

Base 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.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: ExactRouting

Implements the exact routing algorithm for the Traveling Salesman Problem (TSP).

T = None
C_max = None
x = None
x_start = None
x_end = None
construct_route_and_item_sequence()[source]

Generates the route for the exact routing algorithm from solution variables.

class ware_ops_algos.algorithms.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: ExactTSPRouting

Implements the exact routing algorithm for the Traveling Salesman Problem (TSP) using distance as the objective.

algo_name = 'ExactTSPRoutingDistance'
class ware_ops_algos.algorithms.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: ExactTSPRouting

Implements 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.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: ExactTSPRouting

Implements 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.ExactTSPRoutingMaxCompletionTime(batched_list, distance_matrix, tour_matrix, picker, big_m, objective, **kwargs)[source]

Bases: ExactTSPRouting

Implements 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.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: Routing

Dynamic 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
build_state_space()[source]
static largest_gap(order_list: list[ware_ops_algos.algorithms.algorithm.PickPosition])[source]
one_pass()[source]
two_pass()[source]
top(pick_node_y: int)[source]
bottom(pick_node_y: int)[source]
gap(gap_size: int)[source]
void()[source]
cross_aisle_cost(cross_aisle_action: tuple[int, int])[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]

plot_picker_tour(T: networkx.MultiGraph)[source]

Visualizes the picker tour graph T as a 2D warehouse layout. Nodes are (aisle, pick_y) positions.

class ware_ops_algos.algorithms.RatliffRosenthalScatteredRouting(storage_locations: ware_ops_algos.domain_models.StorageLocations, *args, **kwargs)[source]

Bases: RatliffRosenthalRouting

Dynamic 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]]
class ware_ops_algos.algorithms.CapacityChecker(pick_cart: ware_ops_algos.domain_models.PickCart, articles: ware_ops_algos.domain_models.Articles)[source]
pick_cart
can_add_order(current_batch: list[ware_ops_algos.algorithms.WarehouseOrder], new_order: ware_ops_algos.algorithms.WarehouseOrder) bool[source]
orders_fit(orders: list[ware_ops_algos.algorithms.WarehouseOrder]) bool[source]
get_item_consumption(article_id: int, quantity: int = 1) list[float][source]

Get consumption for an article.

Parameters:
  • article_id – Article ID

  • quantity – Number of units (default: 1)

Returns:

Consumption vector [dim0, dim1, …]

class ware_ops_algos.algorithms.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.ABC

Abstract 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
reset_parameters()[source]
class ware_ops_algos.algorithms.BatchingSolution[source]

Bases: AlgorithmSolution

batches: list[BatchObject] | None = None
pick_lists: list[PickList] = None
class ware_ops_algos.algorithms.BatchObject[source]
batch_id: int
orders: list[WarehouseOrder]
class ware_ops_algos.algorithms.WarehouseOrder[source]
order_id: int
due_date: float | None = None
order_date: float | None = None
pick_positions: list[PickPosition] | None = None
fulfilled: bool | None = None
class ware_ops_algos.algorithms.Order[source]
order_id: int
due_date: datetime.datetime | float | None = None
order_date: datetime.datetime | float | None = None
order_positions: list[OrderPosition] = []
static from_dict(order_number: int, data: dict) Order[source]
class ware_ops_algos.algorithms.PickCart[source]
n_dimension: int | None = None
capacities: list[float] | None = None
dimensions: list[DimensionType] | None = None
n_boxes: int | None = None
box_can_mix_orders: bool | None = None
class ware_ops_algos.algorithms.Articles[source]

Bases: ware_ops_algos.domain_models.base_domain_object.BaseDomainObject

Helper class that provides a standard way to create an ABC using inheritance.

tpe: ArticleType
articles: list[Article] | None = None
get_features() dict[str, Any][source]
class ware_ops_algos.algorithms.DimensionType[source]

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

WEIGHT = 'weight'
ITEMS = 'items'
VOLUME = 'volume'
ORDERS = 'orders'
ORDERLINES = 'orderline'
class ware_ops_algos.algorithms.Box[source]
box_id: int
order_ids: set[int]
items: list[tuple[int, int]] = []
consumption: list[float] = []
class ware_ops_algos.algorithms.Batching(pick_cart: ware_ops_algos.domain_models.PickCart, articles: ware_ops_algos.domain_models.Articles, **kwargs)[source]

Bases: ware_ops_algos.algorithms.Algorithm[list[ware_ops_algos.algorithms.algorithm.WarehouseOrder], ware_ops_algos.algorithms.algorithm.BatchingSolution], abc.ABC

Batching class to batch orders

execution_time = None
pick_cart
articles
capacity_checker
class ware_ops_algos.algorithms.PriorityBatching(pick_cart: ware_ops_algos.domain_models.PickCart, articles: ware_ops_algos.domain_models.Articles, **kwargs)[source]

Bases: Batching

Priority batching class to batch orders based on sorting criterion.

class ware_ops_algos.algorithms.OrderNrFifoBatching(pick_cart: ware_ops_algos.domain_models.PickCart, articles: ware_ops_algos.domain_models.Articles, **kwargs)[source]

Bases: PriorityBatching

First in First out batching based on order number.

algo_name = 'OrderNrFiFoBatching'
class ware_ops_algos.algorithms.FifoBatching(pick_cart: ware_ops_algos.domain_models.PickCart, articles: ware_ops_algos.domain_models.Articles, **kwargs)[source]

Bases: PriorityBatching

First in First out batching class to batch orders

algo_name = 'FiFoBatching'
class ware_ops_algos.algorithms.RandomBatching(pick_cart: ware_ops_algos.domain_models.PickCart, articles: ware_ops_algos.domain_models.Articles, seed=44)[source]

Bases: PriorityBatching

First in First out batching class to batch orders

algo_name = 'RandomBatching'
seed = 44
batch_number = 0
class ware_ops_algos.algorithms.DueDateBatching(pick_cart: ware_ops_algos.domain_models.PickCart, articles: ware_ops_algos.domain_models.Articles)[source]

Bases: PriorityBatching

First in First out batching class to batch orders

algo_name = 'DueDateBatching'
class ware_ops_algos.algorithms.SavingsBatching(pick_cart: ware_ops_algos.domain_models.PickCart, articles: ware_ops_algos.domain_models.Articles, routing_class: Type[ware_ops_algos.algorithms.routing.routing.Routing], routing_class_kwargs, time_limit: float | None = None)[source]

Bases: Batching, abc.ABC

Base class for savings-based batching algorithms.

routing_class
routing_class_kwargs
time_limit = None
algo_name
class ware_ops_algos.algorithms.ClarkAndWrightBatching(pick_cart: ware_ops_algos.domain_models.PickCart, articles: ware_ops_algos.domain_models.Articles, routing_class: Type[ware_ops_algos.algorithms.routing.routing.Routing], routing_class_kwargs, time_limit: float | None = None)[source]

Bases: SavingsBatching

Base class for savings-based batching algorithms.

class ware_ops_algos.algorithms.SeedCriteria[source]

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

RANDOM = 'random'
FEWEST_POSITIONS = 'fewest_positions'
MOST_POSITIONS = 'most_positions'
CLOSEST_TO_DEPOT = 'closest_to_depot'
class ware_ops_algos.algorithms.SimilarityMeasure[source]

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

SHARED_ARTICLES = 'shared_articles'
MIN_DISTANCE = 'min_distance'
class ware_ops_algos.algorithms.SeedBatching(pick_cart: ware_ops_algos.domain_models.PickCart, articles: ware_ops_algos.domain_models.Articles, distance_matrix: pandas.DataFrame | None = None, seed_criterion: SeedCriteria = SeedCriteria.RANDOM, similarity_measure: SimilarityMeasure = SimilarityMeasure.SHARED_ARTICLES, start_node: tuple[int, int] | None = None)[source]

Bases: Batching

Batching class to batch orders

distance_matrix = None
similarity_measure
seed_criterion
start_node = None
algo_name = 'random_shared_articles_SeedBatching'
static shared_article_similarity(seed_order: ware_ops_algos.algorithms.algorithm.WarehouseOrder, other_order: ware_ops_algos.algorithms.algorithm.WarehouseOrder)[source]
min_distance_similarity(seed_order: ware_ops_algos.algorithms.algorithm.WarehouseOrder, other_order: ware_ops_algos.algorithms.algorithm.WarehouseOrder)[source]
static rand_seed_order(candidate_orders: list[ware_ops_algos.algorithms.algorithm.WarehouseOrder]) ware_ops_algos.algorithms.algorithm.WarehouseOrder[source]
static most_positions_seed_order(candidate_orders: list[ware_ops_algos.algorithms.algorithm.WarehouseOrder]) ware_ops_algos.algorithms.algorithm.WarehouseOrder[source]
static fewest_positions_seed_order(candidate_orders: list[ware_ops_algos.algorithms.algorithm.WarehouseOrder]) ware_ops_algos.algorithms.algorithm.WarehouseOrder[source]
closest_to_depot_seed_order(candidate_orders: list[ware_ops_algos.algorithms.algorithm.WarehouseOrder]) ware_ops_algos.algorithms.algorithm.WarehouseOrder[source]
similarity(seed_order: ware_ops_algos.algorithms.algorithm.WarehouseOrder, other_order: ware_ops_algos.algorithms.algorithm.WarehouseOrder)[source]
get_seed_order(seed_criterion: SeedCriteria, candidate_orders: list[ware_ops_algos.algorithms.algorithm.WarehouseOrder])[source]
class ware_ops_algos.algorithms.LocalSearchBatching(pick_cart: ware_ops_algos.domain_models.PickCart, articles: ware_ops_algos.domain_models.Articles, routing_class: type[ware_ops_algos.algorithms.routing.routing.Routing], routing_class_kwargs: dict, start_batching_class: type[Batching], start_batching_kwargs: dict = None, time_limit: float = 120.0)[source]

Bases: Batching

Order batching via local search with swap and shift neighborhoods.

Generates an initial solution using a configurable start batching algorithm, then iteratively improves it by swapping orders between batches and shifting orders from one batch to another until no improvement is found or the time limit is exceeded.

Based on:

Henn, S., Koch, S., Doerner, K.F. et al. Metaheuristics for the Order Batching Problem in Manual Order Picking Systems. Bus Res 3, 82–105 (2010). https://doi.org/10.1007/BF03342717

Note: While Henn et al. present an iterated local search approach, we only implemented the local search component.

routing_class
routing_class_kwargs
start_batching_class
start_batching_kwargs
time_limit = 120.0
algo_name
class ware_ops_algos.algorithms.Order[source]
order_id: int
due_date: datetime.datetime | float | None = None
order_date: datetime.datetime | float | None = None
order_positions: list[OrderPosition] = []
static from_dict(order_number: int, data: dict) Order[source]
class ware_ops_algos.algorithms.ResolvedOrderPosition[source]
position: OrderPosition
pick_node: tuple[int, int]
fulfilled: int | None = None
picked: bool | None = None
class ware_ops_algos.algorithms.StorageLocations[source]

Bases: ware_ops_algos.domain_models.BaseDomainObject

Helper class that provides a standard way to create an ABC using inheritance.

tpe: StorageType
locations: list[Location] | None = None
storage_slots: list[StorageLocation] | None = None
article_location_mapping: dict[int, list[Location]] | None
location_article_mapping: dict[tuple[int | float, int | float], int] | None
build_article_location_mapping()[source]
get_locations_by_article_id(article_id: int) list[Location][source]
get_features() dict[str, Any][source]
class ware_ops_algos.algorithms.Location[source]
x: int | float
y: int | float
article_id: int
amount: int | float
ware_ops_algos.algorithms.plot_route(network_graph: networkx.Graph, route: list[tuple[int, int]])[source]

Visualizes a picker route

ware_ops_algos.algorithms.plot_route_with_directions(network_graph: networkx.Graph, route: list[tuple[int, int]])[source]

Visualizes a picker route with direction arrows, including repeated edges.

class ware_ops_algos.algorithms.ItemAssignment(storage_locations: ware_ops_algos.domain_models.StorageLocations, **kwargs)[source]

Bases: ware_ops_algos.algorithms.Algorithm[list[ware_ops_algos.domain_models.Order], ware_ops_algos.algorithms.ItemAssignmentSolution]

Abstract base class for all algorithms (routing, batching, etc.). Handles timing, algo naming, and ensures consistent result metadata.

storage_locations
class ware_ops_algos.algorithms.GreedyItemAssignment(storage_locations: ware_ops_algos.domain_models.StorageLocations, **kwargs)[source]

Bases: ItemAssignment

Greedy item assignment heuristic. Assigns items from locations with the highest inventory level first until demand is satisfied.

algo_name = 'GIA'
class ware_ops_algos.algorithms.NearestNeighborItemAssignment(storage_locations: ware_ops_algos.domain_models.StorageLocations, distance_matrix: pandas.DataFrame, start_node: tuple[int, int] = (0, 0), **kwargs)[source]

Bases: ItemAssignment

Simple nearest neighborhood based item assignment heuristic. Selects closest to the current location until demand is satisfied.

Based on:

Weidinger, F., Boysen, N., & Schneider, M. (2019). Picker routing in the mixed-shelves warehouses of e-commerce retailers. European Journal of Operational Research, 274(2), 501-515. https://doi.org/10.1016/j.ejor.2018.10.021

algo_name = 'NNIA'
distance_matrix
start_node = (0, 0)
class ware_ops_algos.algorithms.PriorityItemAssignment(storage_locations: ware_ops_algos.domain_models.StorageLocations, distance_matrix: pandas.DataFrame, **kwargs)[source]

Bases: ItemAssignment

Base class for Weidinger item assignment algorithms.

Based on:

Weidinger, F. (2018). Picker routing in rectangular mixed shelves warehouses. Computers & Operations Research, 95, 139-150. https://doi.org/10.1016/j.cor.2018.03.012

storage_locations
distance_matrix
q_max
class ware_ops_algos.algorithms.SinglePositionItemAssignment(storage_locations: ware_ops_algos.domain_models.StorageLocations, distance_matrix: pandas.DataFrame, routing_class: Type[ware_ops_algos.algorithms.Routing], routing_class_kwargs: dict, **kwargs)[source]

Bases: PriorityItemAssignment

Base class for Weidinger item assignment algorithms.

Based on:

Weidinger, F. (2018). Picker routing in rectangular mixed shelves warehouses. Computers & Operations Research, 95, 139-150. https://doi.org/10.1016/j.cor.2018.03.012

algo_name = 'SPIA'
routing_class
routing_class_kwargs
start_node
class ware_ops_algos.algorithms.MinMaxItemAssignment(storage_locations: ware_ops_algos.domain_models.StorageLocations, distance_matrix: pandas.DataFrame, start_node: tuple[float, float], **kwargs)[source]

Bases: PriorityItemAssignment

Algorithm 1: MinMax

Process SKUs by fewest locations first. Priority = MAX distance to any already-selected position.

algo_name = 'MinMaxIA'
start_node
class ware_ops_algos.algorithms.MinMinItemAssignment(storage_locations: ware_ops_algos.domain_models.StorageLocations, distance_matrix: pandas.DataFrame, start_node: tuple[float, float], **kwargs)[source]

Bases: PriorityItemAssignment

Algorithm 1: MinMin

Process SKUs by fewest locations first. Priority = MIN distance to any already-selected position.

algo_name = 'MinMinIA'
start_node
ware_ops_algos.algorithms.PROJECT_ROOT[source]
class ware_ops_algos.algorithms.SchedulingSolution[source]

Bases: AlgorithmSolution

jobs: list[Job] | None = None
class ware_ops_algos.algorithms.Job[source]
batch_idx: int
picker_id: int
start_time: float
end_time: float
release_time: float
distance: float
n_picks: int
travel_time: float
handling_time: float
route: Route
class ware_ops_algos.algorithms.Route[source]
route: list[tuple[int, int]] | None = None
item_sequence: list[tuple[int, int]] | None = None
distance: float = 0.0
pick_list: PickList | None = None
annotated_route: list[RouteNode] | None = None
class ware_ops_algos.algorithms.AlgorithmSolution[source]
algo_name: str = ''
execution_time: float = 0.0
provenance: dict[str, Any]
class ware_ops_algos.algorithms.PickList[source]
pick_positions: list[PickPosition]
orders: list[WarehouseOrder]
release: float | None = None
earliest_due_date: float | None = None
id: int
property order_numbers: list[int]
class ware_ops_algos.algorithms.OrdersDomain[source]

Bases: ware_ops_algos.domain_models.BaseDomainObject

Helper class that provides a standard way to create an ABC using inheritance.

tpe: OrderType
orders: list[Order] | None = None
get_features() dict[str, any][source]
class ware_ops_algos.algorithms.Resources[source]

Bases: ware_ops_algos.domain_models.BaseDomainObject

Helper class that provides a standard way to create an ABC using inheritance.

tpe: ResourceType
resources: list[Resource] | None = None
get_features() dict[str, any][source]
class ware_ops_algos.algorithms.Resource[source]
id: int
capacity: int | None = None
speed: float | None = None
time_per_pick: float | None = None
pick_cart: PickCart | 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.Order[source]
order_id: int
due_date: datetime.datetime | float | None = None
order_date: datetime.datetime | float | None = None
order_positions: list[OrderPosition] = []
static from_dict(order_number: int, data: dict) Order[source]
class ware_ops_algos.algorithms.SequencingInput[source]
pick_lists: list[ware_ops_algos.algorithms.algorithm.PickList]
routes: list[ware_ops_algos.algorithms.algorithm.Route]
class ware_ops_algos.algorithms.Sequencing[source]
sequenced_pick_lists: list[ware_ops_algos.algorithms.algorithm.Route]
class ware_ops_algos.algorithms.SequencingSolution[source]

Bases: ware_ops_algos.algorithms.algorithm.AlgorithmSolution

sequencing: list[ware_ops_algos.algorithms.algorithm.PickList] | None = None
class ware_ops_algos.algorithms.PickListSequencer(orders: ware_ops_algos.domain_models.OrdersDomain, resources: ware_ops_algos.domain_models.Resources)[source]

Bases: ware_ops_algos.algorithms.Algorithm[list[ware_ops_algos.algorithms.algorithm.PickList], SequencingSolution], abc.ABC

Performs sequencing of pick list: takes pick list, returns them in sorted order.

orders_domain
resource_domain
class ware_ops_algos.algorithms.EDDSequencer(orders: ware_ops_algos.domain_models.OrdersDomain, resources: ware_ops_algos.domain_models.Resources)[source]

Bases: PickListSequencer

Performs sequencing of pick list: takes pick list, returns them in sorted order.

class ware_ops_algos.algorithms.SchedulingInput[source]

Minimal info the scheduler needs.

routes: list[ware_ops_algos.algorithms.algorithm.Route]
orders: ware_ops_algos.domain_models.OrdersDomain
resources: ware_ops_algos.domain_models.Resources
class ware_ops_algos.algorithms.PriorityScheduling(seed: int | None = None)[source]

Bases: ware_ops_algos.algorithms.Algorithm[SchedulingInput, ware_ops_algos.algorithms.algorithm.SchedulingSolution], abc.ABC

Schedule by: sort jobs once using a rule, then assign to earliest-free picker. Subclasses implement _sorted_jobs.

class ware_ops_algos.algorithms.SPTScheduling(seed: int | None = None)[source]

Bases: PriorityScheduling

Shortest Processing Time first.

class ware_ops_algos.algorithms.LPTScheduling(seed: int | None = None)[source]

Bases: PriorityScheduling

Longest Processing Time first (often better for makespan).

class ware_ops_algos.algorithms.EDDScheduling(seed: int | None = None)[source]

Bases: PriorityScheduling

Earliest Due Date first (good for tardiness).

class ware_ops_algos.algorithms.ERDScheduling(seed: int | None = None)[source]

Bases: PriorityScheduling

Earliest Release Date first (start as soon as available).

class ware_ops_algos.algorithms.FIFOScheduling(seed: int | None = None)[source]

Bases: PriorityScheduling

By smallest order number in batch (proxy for input order).

class ware_ops_algos.algorithms.Resource[source]
id: int
capacity: int | None = None
speed: float | None = None
time_per_pick: float | None = None
pick_cart: PickCart | 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.Assigner(resources: list[ware_ops_algos.domain_models.Resource])[source]

Bases: ware_ops_algos.algorithms.Algorithm[list[ware_ops_algos.algorithms.PickList], ware_ops_algos.algorithms.AssignmentSolution], abc.ABC

Abstract base class for all algorithms (routing, batching, etc.). Handles timing, algo naming, and ensures consistent result metadata.

resources
class ware_ops_algos.algorithms.RoundRobinAssigner(resources: list[ware_ops_algos.domain_models.Resource])[source]

Bases: Assigner

Abstract base class for all algorithms (routing, batching, etc.). Handles timing, algo naming, and ensures consistent result metadata.

class ware_ops_algos.algorithms.RoutingSolution[source]

Bases: AlgorithmSolution

route: Route | None = None
class ware_ops_algos.algorithms.Route[source]
route: list[tuple[int, int]] | None = None
item_sequence: list[tuple[int, int]] | None = None
distance: float = 0.0
pick_list: PickList | None = None
annotated_route: list[RouteNode] | None = None
class ware_ops_algos.algorithms.CombinedRoutingSolution[source]

Bases: AlgorithmSolution

routes: list[Route] | None = None
class ware_ops_algos.algorithms.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.WarehouseOrder[source]
order_id: int
due_date: float | None = None
order_date: float | None = None
pick_positions: list[PickPosition] | None = None
fulfilled: bool | None = None
ware_ops_algos.algorithms.build_pick_lists(orders: list[ware_ops_algos.algorithms.WarehouseOrder])[source]
class ware_ops_algos.algorithms.Resource[source]
id: int
capacity: int | None = None
speed: float | None = None
time_per_pick: float | None = None
pick_cart: PickCart | 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(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.ABC

Abstract 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
reset_parameters()[source]
class ware_ops_algos.algorithms.RoutingBatchingAssigning(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: bool = False, gen_item_sequence: bool = False, time_limit: int | None = None, **kwargs)[source]

Bases: ware_ops_algos.algorithms.routing.Routing, abc.ABC

Base class for routing algorithms. :param network_graph: the network graph :param order_list: list of orders or just one order, each order is a dictionary with at least keys ‘batch_number’ or ‘order_number’ :param distance_matrix: the distance matrix :param picker_list: list[{‘id’: int, ‘speed’: m/sec, ‘time_to_pick’: sec, ‘capacity’: int}], can be a list of pickers or a single picker :param kwargs: additional keyword arguments

item_sequence = []
route = []
distance_per_batch = None
solution = None
current_order = None
pick_list = None
routing_algo = None
list_item_pick_locations = None
list_item_numbers = None
list_item_amounts = None
list_order_numbers = None
x_start = None
x_end = None
x = None
w = None
T = None
y = None
z = None
C_bp = None
C_max = None
C_max_p = None
range_item_number = None
set_order_numbers = None
set_batch_numbers = None
gen_tour = False
gen_item_sequence = False
time_limit = None
construct_route_and_sequence(b)[source]

Generates the route and/or item sequence from solution variables.

class ware_ops_algos.algorithms.ExactTSPBatchingAndRoutingDistance(start_node, end_node, distance_matrix, predecessor_matrix, picker, gen_tour, gen_item_sequence, big_m, **kwargs)[source]

Bases: RoutingBatchingAssigning, abc.ABC

Implements the exact routing algorithm for the Traveling Salesman Problem (TSP) with batching. This class extends ExactTSPRouting to handle batching of orders.

big_m
routing_algo = 'ExactTSPBatchingAndRouting'
mdl
class ware_ops_algos.algorithms.ExactTSPBatchingAndRoutingMaxCompletionTime(start_node, end_node, distance_matrix, predecessor_matrix, picker, gen_tour, gen_item_sequence, big_m: int, **kwargs)[source]

Bases: RoutingBatchingAssigning

Implements the exact routing algorithm for the Traveling Salesman Problem (TSP) with batching. This class extends ExactTSPRouting to handle batching of orders.

algo_name = 'ExactTSPBatchingAndRouting'
mdl
big_m
class ware_ops_algos.algorithms.ExactCombinedBatchingRouting(start_node: tuple[int, int], end_node: tuple[int, int], distance_matrix: pandas.DataFrame, predecessor_matrix: numpy.ndarray, picker: list[ware_ops_algos.domain_models.Resource], gen_tour: bool = False, gen_item_sequence: bool = False, time_limit: int | None = None, **kwargs)[source]

Bases: RoutingBatchingAssigning

Exact MIP for the joint Order-Batching and Picker-Routing Problem (OBRP) with homogeneous pickers.

algo_name = 'ExactCombinedBatchingRouting'
mdl
a = None
t = None
orders: list[ware_ops_algos.algorithms.algorithm.WarehouseOrder] | None = None
class ware_ops_algos.algorithms.Resource[source]
id: int
capacity: int | None = None
speed: float | None = None
time_per_pick: float | None = None
pick_cart: PickCart | 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.ResourceType[source]

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

HUMAN = 'human'
ROBOT = 'robot'
COBOT = 'cobot'
MIXED = 'mixed'
class ware_ops_algos.algorithms.OrderSelection(**kwargs)[source]

Bases: ware_ops_algos.algorithms.Algorithm[list[ware_ops_algos.algorithms.WarehouseOrder], ware_ops_algos.algorithms.OrderSelectionSolution]

Abstract base class for all algorithms (routing, batching, etc.). Handles timing, algo naming, and ensures consistent result metadata.

class ware_ops_algos.algorithms.DummyOrderSelection(**kwargs)[source]

Bases: OrderSelection

Abstract base class for all algorithms (routing, batching, etc.). Handles timing, algo naming, and ensures consistent result metadata.

class ware_ops_algos.algorithms.GreedyOrderSelection(**kwargs)[source]

Bases: OrderSelection

Abstract base class for all algorithms (routing, batching, etc.). Handles timing, algo naming, and ensures consistent result metadata.

class ware_ops_algos.algorithms.MinDistOrderSelection(picker_position: tuple[float, float], dima: pandas.DataFrame, **kwargs)[source]

Bases: OrderSelection

Abstract base class for all algorithms (routing, batching, etc.). Handles timing, algo naming, and ensures consistent result metadata.

picker_position
dima
class ware_ops_algos.algorithms.MinAisleOrderSelection(congestion_info: dict, **kwargs)[source]

Bases: OrderSelection

Abstract base class for all algorithms (routing, batching, etc.). Handles timing, algo naming, and ensures consistent result metadata.

congestion_info
static get_order_aisles(order: ware_ops_algos.algorithms.WarehouseOrder) set[source]
class ware_ops_algos.algorithms.MinMaxArticlesCobotSelection(resource: ware_ops_algos.domain_models.Resource, **kwargs)[source]

Bases: OrderSelection

Abstract base class for all algorithms (routing, batching, etc.). Handles timing, algo naming, and ensures consistent result metadata.

resource
static get_order_aisles(order: ware_ops_algos.algorithms.WarehouseOrder) set[source]
class ware_ops_algos.algorithms.MinMaxAisleOrderSelection(congestion_info: dict, resource: ware_ops_algos.domain_models.Resource, **kwargs)[source]

Bases: OrderSelection

Abstract base class for all algorithms (routing, batching, etc.). Handles timing, algo naming, and ensures consistent result metadata.

congestion_info
resource
static get_order_aisles(order: ware_ops_algos.algorithms.WarehouseOrder) set[source]
class ware_ops_algos.algorithms.TimeIndexedMinConflictSelection(active_tours: list[ware_ops_algos.algorithms.TourPlanningState], resource: ware_ops_algos.domain_models.Resource, resources: list[ware_ops_algos.domain_models.Resource], picker_position: ware_ops_algos.algorithms.RouteNode, distance_matrix: pandas.DataFrame, routing_class: Type[ware_ops_algos.algorithms.Routing], routing_class_kwargs: dict, current_time: float = 0.0, slot_duration: float = 1.0, **kwargs)[source]

Bases: OrderSelection

Select order that minimizes predicted time-indexed aisle conflicts

active_tours
resource
resources
picker_position
distance_matrix
routing_class
routing_class_kwargs
current_time = 0.0
slot_duration = 1.0