def set_marridged_edge_free(dag, i, j, colliders):
    """SETMARRIEDEDGEFREE Summary of this function goes here
       suppose the edge (i, j) is a married edge brought by colliders, then
       set it free and configure the correct direction to colliders

    Args:
      dag: DAG adjacent matrix
      i: node i
      j: node j
      colliders: list of collider indices

    Returns:
      untangled adjacent matrix

    """

    dag[i, j] = dag[j, i] = 0
    for c in colliders:
        dag[i, c] = 1
        dag[c, i] = 0
        dag[j, c] = 1
        dag[c, j] = 0
    return dag