pyflagser.save_unweighted_flag(fname, adjacency_matrix)

Save the adjacency matrix of a directed/undirected unweighted graph into a .flag file.

fnamefile, str, or pathlib.Path, required

Filename of extension .flag.

adjacency_matrix2d ndarray or scipy.sparse matrix of shape (n_vertices, n_vertices), required

Adjacency matrix of a directed/undirected unweighted graph. It is understood as a boolean matrix. Off-diagonal, 0 or False values denote abstent edges while non-0 or True values denote edges which are present. Diagonal values are ignored.


The input graphs cannot contain self-loops, i.e. edges that start and end in the same vertex, therefore diagonal elements of the input adjacency matrix will be ignored.



D. Luetgehetmann, “Documentation of the C++ flagser library”; GitHub: luetge/flagser.