def test_random_graphs(gfn, n): # For several more complex graph types, make sure # the plink algo is equal to the unrolled numba version if gfn == nx.binomial_tree: n = int(math.log(n, 2)) idi, idj = to_vertex_ids(gfn(n)) idx1 = numba_mis(idi, idj) idx2 = plink_mis(idi, idj) assert idx1 == idx2
def test_unsorted_edges(): idi, idj = to_vertex_ids(nx.complete_graph(10)) idi = idi[::-1] with pytest.raises(ValueError): numba_mis(idi, idj)