discrete_optimization.gpdp package
Subpackages
- discrete_optimization.gpdp.builders package
- discrete_optimization.gpdp.solvers package
- Submodules
- discrete_optimization.gpdp.solvers.gpdp_solver module
- discrete_optimization.gpdp.solvers.lp_iterative module
BaseLinearFlowGpdpSolver
BaseLinearFlowGpdpSolver.add_order_constraints()
BaseLinearFlowGpdpSolver.convert_temporaryresults()
BaseLinearFlowGpdpSolver.convert_to_variable_values()
BaseLinearFlowGpdpSolver.init_model()
BaseLinearFlowGpdpSolver.init_order_variables()
BaseLinearFlowGpdpSolver.lazy
BaseLinearFlowGpdpSolver.one_visit_per_clusters()
BaseLinearFlowGpdpSolver.one_visit_per_node()
BaseLinearFlowGpdpSolver.problem
BaseLinearFlowGpdpSolver.resources_constraint()
BaseLinearFlowGpdpSolver.retrieve_current_solution()
BaseLinearFlowGpdpSolver.retrieve_current_temporaryresult()
BaseLinearFlowGpdpSolver.set_warm_start()
BaseLinearFlowGpdpSolver.simple_capacity_constraint()
BaseLinearFlowGpdpSolver.solve()
BaseLinearFlowGpdpSolver.solve_iterative()
BaseLinearFlowGpdpSolver.solve_one_iteration()
BaseLinearFlowGpdpSolver.time_evolution()
BaseLinearFlowGpdpSolver.warm_start
ConstraintHandlerOrWarmStart
GurobiLazyConstraintLinearFlowGpdpSolver
GurobiLinearFlowGpdpSolver
MathOptLinearFlowGpdpSolver
SubtourAddingConstraint
TemporaryResult
TemporaryResultGurobiCallback
TemporaryResultMathOptCallback
build_graph_solution()
build_graph_solutions()
build_path_from_vehicle_type_flow()
build_the_cycles()
construct_edges_in_out_dict()
convert_temporaryresult_to_gpdpsolution()
rebuild_routine()
rebuild_routine_variant()
reevaluate_result()
retrieve_current_solution()
update_model_generic()
- discrete_optimization.gpdp.solvers.ortools_routing module
FirstSolutionStrategy
FirstSolutionStrategy.ALL_UNPERFORMED
FirstSolutionStrategy.AUTOMATIC
FirstSolutionStrategy.BEST_INSERTION
FirstSolutionStrategy.CHRISTOFIDES
FirstSolutionStrategy.EVALUATOR_STRATEGY
FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE
FirstSolutionStrategy.GLOBAL_CHEAPEST_ARC
FirstSolutionStrategy.LOCAL_CHEAPEST_ARC
FirstSolutionStrategy.LOCAL_CHEAPEST_COST_INSERTION
FirstSolutionStrategy.LOCAL_CHEAPEST_INSERTION
FirstSolutionStrategy.PARALLEL_CHEAPEST_INSERTION
FirstSolutionStrategy.PARALLEL_SAVINGS
FirstSolutionStrategy.PATH_CHEAPEST_ARC
FirstSolutionStrategy.PATH_MOST_CONSTRAINED_ARC
FirstSolutionStrategy.SAVINGS
FirstSolutionStrategy.SEQUENTIAL_CHEAPEST_INSERTION
FirstSolutionStrategy.SWEEP
FirstSolutionStrategy.UNSET
LocalSearchMetaheuristic
NodePosition
OrtoolsGpdpSolver
ParametersCost
RoutingMonitor
RoutingSearchStatus
RoutingSearchStatus.ROUTING_FAIL
RoutingSearchStatus.ROUTING_FAIL_TIMEOUT
RoutingSearchStatus.ROUTING_INFEASIBLE
RoutingSearchStatus.ROUTING_INVALID
RoutingSearchStatus.ROUTING_NOT_SOLVED
RoutingSearchStatus.ROUTING_OPTIMAL
RoutingSearchStatus.ROUTING_PARTIAL_SUCCESS_LOCAL_OPTIMUM_NOT_REACHED
RoutingSearchStatus.ROUTING_SUCCESS
apply_cost()
convert_to_gpdpsolution()
status_description
- Module contents
Submodules
discrete_optimization.gpdp.plot module
- discrete_optimization.gpdp.plot.plot_gpdp_solution(sol: GpdpSolution, problem: GpdpProblem) tuple[Figure, Axes] [source]
discrete_optimization.gpdp.problem module
- class discrete_optimization.gpdp.problem.GpdpProblem(number_vehicle: int, nodes_transportation: set[Hashable], nodes_origin: set[Hashable], nodes_target: set[Hashable], list_pickup_deliverable: list[tuple[list[Hashable], list[Hashable]]], origin_vehicle: dict[int, Hashable], target_vehicle: dict[int, Hashable], resources_set: set[str], capacities: dict[int, dict[str, tuple[float, float]]], resources_flow_node: dict[Hashable, dict[str, float]], resources_flow_edges: dict[tuple[Hashable, Hashable], dict[str, float]], distance_delta: dict[Hashable, dict[Hashable, float]], time_delta: dict[Hashable, dict[Hashable, float]], time_delta_node: dict[Hashable, float] | None = None, coordinates_2d: dict[Hashable, tuple[float, float]] | None = None, clusters_dict: dict[Hashable, Hashable] | None = None, list_pickup_deliverable_per_cluster: list[tuple[list[Hashable], list[Hashable]]] | None = None, mandatory_node_info: dict[Hashable, bool] | None = None, cumulative_constraints: list[tuple[set[Hashable], int]] | None = None, time_windows_nodes: dict[Hashable, tuple[int | None, int | None]] | None = None, time_windows_cluster: dict[Hashable, tuple[int | None, int | None]] | None = None, group_identical_vehicles: dict[int, list[int]] | None = None, slack_time_bound_per_node: dict[Hashable, tuple[int, float]] | None = None, node_vehicle: dict[Hashable, list[int]] | None = None, compute_graph: bool = False)[source]
Bases:
Problem
- MAX_VALUE = 10000000000.0
- evaluate(variable: GpdpSolution) dict[str, float] [source]
Evaluate a given solution object for the given problem.
This method should return a dictionnary of KPI, that can be then used for mono or multiobjective optimization.
- Parameters:
variable (Solution) – the Solution object to evaluate.
Returns: dictionnary of float kpi for the solution.
- get_attribute_register() EncodingRegister [source]
Returns how the Solution should be encoded.
Returns (EncodingRegister): content of the encoding of the solution
- get_objective_register() ObjectiveRegister [source]
Returns the objective definition.
Returns (ObjectiveRegister): object defining the objective criteria.
- get_solution_type() type[Solution] [source]
Returns the class implementation of a Solution.
Returns (class): class object of the given Problem.
- satisfy(variable: GpdpSolution) bool [source]
Computes if a solution satisfies or not the constraints of the problem.
- Parameters:
variable – the Solution object to check satisfability
Returns (bool): boolean true if the constraints are fulfilled, false elsewhere.
- class discrete_optimization.gpdp.problem.GpdpSolution(problem: GpdpProblem, trajectories: dict[int, list[Hashable]], times: dict[Hashable, float], resource_evolution: dict[Hashable, dict[Hashable, list[int]]])[source]
Bases:
Solution
- change_problem(new_problem: Problem) None [source]
If relevant to the optimisation problem, change the underlying problem instance for the solution.
This method can be used to evaluate a solution for different instance of problems.
- Parameters:
new_problem (Problem) – another problem instance from which the solution can be evaluated
Returns: None
- copy() GpdpSolution [source]
Deep copy of the solution.
The copy() function should return a new object containing the same input as the current object, that respects the following expected behaviour: -y = x.copy() -if do some inplace change of y, the changes are not done in x.
Returns: a new object from which you can manipulate attributes without changing the original object.
- class discrete_optimization.gpdp.problem.ProxyClass[source]
Bases:
object
- static from_tsp_to_gpdp(tsp_model: Point2DTspProblem, compute_graph: bool = False) GpdpProblem [source]
- static from_vrp_to_gpdp(vrp_problem: Customer2DVrpProblem, compute_graph: bool = False) GpdpProblem [source]
- discrete_optimization.gpdp.problem.build_matrix_distance(problem: GpdpProblem) ndarray[Any, dtype[float64]] [source]
- discrete_optimization.gpdp.problem.build_matrix_time(problem: GpdpProblem) ndarray[Any, dtype[float64]] [source]
- discrete_optimization.gpdp.problem.build_pruned_problem(problem: GpdpProblem, undirected: bool = True, compute_graph: bool = False) GpdpProblem [source]
- discrete_optimization.gpdp.problem.max_distance(problem: GpdpProblem) float [source]
- discrete_optimization.gpdp.problem.max_time(problem: GpdpProblem) float [source]