pyepo.model.omo.vrp =================== .. py:module:: pyepo.model.omo.vrp .. autoapi-nested-parse:: Capacitated vehicle routing problem Classes ------- .. autoapisummary:: pyepo.model.omo.vrp.vrpABModel pyepo.model.omo.vrp.vrpMTZModel pyepo.model.omo.vrp.vrpMTZModelRel Module Contents --------------- .. py:class:: vrpABModel(num_nodes: int, demands: list[float] | numpy.ndarray, capacity: float, num_vehicle: int, solver: str = 'glpk') Bases: :py:obj:`pyepo.model.bases.vrpABBase`, :py:obj:`pyepo.model.omo.omomodel.optOmoModel` Abstract Pyomo-backed model for the capacitated vehicle routing problem. Pyomo lacks easy callback support, so no lazy-cut RCI formulation exists for this backend — only MTZ. A single-customer route is excluded so all edge variables stay strictly binary; if a single-stop route is actually needed, duplicate the depot. :ivar solver: optimization solver in the background .. py:class:: vrpMTZModel(num_nodes: int, demands: list[float] | numpy.ndarray, capacity: float, num_vehicle: int, solver: str = 'glpk') Bases: :py:obj:`vrpABModel` CVRP formulation on a directed graph with MTZ-style capacity constraints. Cost vector is per undirected edge: cost ``c[k]`` is assigned to both ``x[i,j]`` and ``x[j,i]``. .. py:method:: solve() -> tuple[numpy.ndarray, float] A method to solve the model :returns: edge-selection vector (uint8) and objective value (float) :rtype: tuple .. py:method:: relax() -> vrpMTZModelRel A method to get linear relaxation model .. py:class:: vrpMTZModelRel(num_nodes: int, demands: list[float] | numpy.ndarray, capacity: float, num_vehicle: int, solver: str = 'glpk') Bases: :py:obj:`vrpMTZModel` LP relaxation of :class:`vrpMTZModel`. .. py:method:: solve() -> tuple[numpy.ndarray, float] A method to solve the model — returns fractional edge selections .. py:method:: relax() -> NoReturn A forbidden method to relax MIP model .. py:method:: getTour(sol: numpy.ndarray | torch.Tensor | list) -> list[list[int]] A forbidden method to get a tour from solution