=========== Module misc =========== .. lua:module:: misc misc Collection of tools that don't fit anywhere else. See :lua:meth:`dbus `, :lua:meth:`evdev `, :lua:meth:`event `, :lua:meth:`file `, :lua:meth:`hwinfo `, :lua:meth:`log `, :lua:meth:`lua `, :lua:meth:`misc `, :lua:meth:`os `, :lua:meth:`spawn `, :lua:meth:`udev `, :lua:meth:`xorg ` for more information about this type Methods ========== .. list-table:: :header-rows: 0 * - :lua:meth:`bipartite_match(graph) ` - Find maximum unweighted bipartite match. * - :lua:meth:`difference_constraints(constraints) ` - Solve a system of difference constraints. .. lua:method:: bipartite_match(graph) -> [int] :rtype: [int] :type graph: [[int]] :param graph: Find maximum unweighted bipartite match. The input is a list of edges. There is one list for each node on the left, containing the indices of the nodes on the right that it is connected to. Returns a list of integers, the indices of the nodes on the right that each node on the left is matched to. Or -1 if it is not matched .. lua:method:: difference_constraints(constraints) -> [int] :rtype: [int] :type constraints: [[int]] :param constraints: Solve a system of difference constraints. The input is a list of constraints, which are formatted as a array of arrays of integers, array of integers at index :math:`i` describes the constraints for :math:`x_i`. Each constraint is a pair of integers, the first being the index of the other variable, and the second being the difference between the two variables. e.g. if the first is :math:`j` and the second is :math:`k`, then the constraint is :math:`x_j - x_i < = k`, note the order of the variables. Returns a list of integers, the values of the variables that satisfy the constraints.