def is_chain(edges, n_vertices):
    return (np.all(edges[:, 0] == np.arange(0, n_vertices - 1))
            and np.all(edges[:, 1] == np.arange(1, n_vertices)))
Check if edges specify a chain and are in order.
dataset/ETHPy150Open pystruct/pystruct/pystruct/inference/maxprod.py/is_chain