Added row/column/elem swapping to flag_mat, swap, detach, set, remove_edge to digraph