optiwindnet.baselines.hgs ========================= .. py:module:: optiwindnet.baselines.hgs Module Contents --------------- .. py:function:: hgs_cvrp(A: networkx.Graph, *, capacity: float, time_limit: float, vehicles: int | None = None, seed: int | None = None, keep_log: bool = False, complete: bool = False) -> networkx.Graph Solves the OCVRP using HGS-CVRP with links from `A` Wraps HybGenSea, which provides bindings to the HGS-CVRP library (Hybrid Genetic Search solver for Capacitated Vehicle Routing Problems). This function uses it to solve an Open-CVRP i.e., vehicles do not return to the depot. Normalization of input graph is recommended before calling this function. https://github.com/vidalt/HGS-CVRP#running-the-algorithm :param A: graph with allowed edges (if it has 0 edges, use complete graph) :param capacity: maximum vehicle capacity :param time_limit: [s] solver run time limit :param vehicles: number of vehicles (if None, let HGS-CVRP decide) :returns: Solution topology S .. py:function:: iterative_hgs_cvrp(A: networkx.Graph, *, capacity: float, time_limit: float, vehicles: int | None = None, seed: int | None = None, max_retries: int = 10, keep_log: bool = False, complete: bool = False) -> networkx.Graph Iterate until crossing-free solution is found (`hgs_cvrp()` wrapper). Each time a solution with a crossing is produced, one of the offending edges is removed from `A` and the solver is called again. In the same way as `hgs_cvrp()`, it is recommended to pass a normalized `A`. :param \*: see `hgs_cvrp()` :param max_retries: maximum number of retries to fix unrepairable crossings :returns: Solution topology S .. py:function:: hgs_multiroot(A: networkx.Graph, *, capacity: int, time_limit: float, balanced: bool = False, seed: int | None = None, keep_log: bool = False) -> networkx.Graph