pyepo.model.predefined¶
Backend-dispatching factories for the built-in problems.
Each factory builds the requested problem on the chosen solver backend, selected
by the backend keyword (default Gurobi) rather than by importing a
backend-specific class.
Functions¶
|
Shortest path on a grid network. |
|
Multi-dimensional knapsack. |
|
Mean-variance portfolio optimization. |
|
Traveling salesperson. |
|
Capacitated vehicle routing. |
Module Contents¶
- pyepo.model.predefined.shortestPathModel(grid, *, backend='gurobi', **kwargs)¶
Shortest path on a grid network.
- pyepo.model.predefined.knapsackModel(weights, capacity, *, backend='gurobi', **kwargs)¶
Multi-dimensional knapsack.
- Parameters:
weights (ndarray) – item weights with shape
(dim, n_items)capacity (ndarray) – per-dimension capacity with length
dimbackend (str) – solver backend; one of
"gurobi","copt","pyomo","ortools","mpax"
- pyepo.model.predefined.portfolioModel(num_assets, covariance, *, backend='gurobi', **kwargs)¶
Mean-variance portfolio optimization.
- pyepo.model.predefined.tspModel(num_nodes, *, backend='gurobi', formulation='DFJ', **kwargs)¶
Traveling salesperson.
- pyepo.model.predefined.vrpModel(num_nodes, demands, capacity, num_vehicle, *, backend='gurobi', formulation='RCI', **kwargs)¶
Capacitated vehicle routing.
- Parameters:
num_nodes (int) – number of nodes, with the depot as node 0
demands (list) – per-customer demands with length
num_nodes - 1capacity (float) – vehicle capacity
num_vehicle (int) – number of vehicles
backend (str) – solver backend; one of
"gurobi","copt","pyomo"formulation (str) – ILP formulation;
"RCI"or"MTZ"("RCI"on gurobi and copt only)