optiwindnet.baselines.utils =========================== .. py:module:: optiwindnet.baselines.utils Module Contents --------------- .. py:function:: length_matrix_single_depot_from_G(A: networkx.Graph, *, scale: float, complete: bool = False) -> tuple[numpy.ndarray, float] Edge length matrix for VRP-based solvers. It is assumed that the problem has been pre-scaled, such that multiplying all lengths by `scale` will place them within a numerically stable range. Length of return to depot from all nodes is set to 0 (i.e. Open-VRP). Order of nodes in the returned matrix is depot, clients (required by some VRP methods), which differs from optiwindnet order (i.e clients, depot). :param A: Must contain graph attributes `R`, 'T', `VertexC` and 'd2roots'. A's edges must have the 'length' attribute. :param scale: Factor to multiply all lengths by. :param complete: make the full graph over A available (links not in A assumed direct) :returns: Matrix of lengths and maximum length value (below +inf). :rtype: L, len_max