iqm.benchmarks.utils.split_into_disjoint_pairs#
- iqm.benchmarks.utils.split_into_disjoint_pairs(pairs: Sequence[Tuple[int, int]]) List[List[Tuple[int, int]]] #
Split a Sequence of pairs of integers into a List of a minimal number of Lists of disjoint pairs. Example: input [(0,3), (2,3), (3,8), (8,13), (13,17), (17,18)] gives output [[(0, 3), (8, 13), (17, 18)], [(2, 3), (13, 17)], [(3, 8)]].
# TODO: enable specifying a max split size of Lists of disjoint pairs. # pylint: disable=fixme