flagser_count_weighted(adjacency_matrix, max_edge_weight=None, directed=True)¶
Compute the cell count per dimension of a directed/undirected filtered flag complex.
From an adjacency matrix construct a filtered flag complex as a sequence of its cells associated to their filtration values and compute the number of cells per dimension at the end of the filtration.
- adjacency_matrix2d ndarray or scipy.sparse matrix, required
Matrix representation of a directed/undirected weighted graph. Diagonal elements are vertex weights. The way zero values are handled depends on the format of the matrix. If the matrix is a dense
numpy.ndarray, zero values denote zero-weighted edges. If the matrix is a sparse
scipy.sparsematrix, explicitly stored off-diagonal zeros and all diagonal zeros denote zero-weighted edges. Off-diagonal values that have not been explicitely stored are treated by
scipy.sparseas zeros but will be understood as infinitely-valued edges, i.e., edges absent from the filtration.
- max_edge_weightint or float or
None, optional, default:
Maximum edge weight to be considered in the filtration. All edge weights greater than that value will be considered as infinitely-valued, i.e., absent from the filtration. If
None, all finite edge weights are considered.
- directedbool, optional, default:
True, computes persistent homology for the directed filtered flag complex determined by adjacency_matrix. If
False, computes persistent homology for the undirected filtered flag complex obtained by considering all weighted edges as undirected, and if two directed edges corresponding to the same undirected edge are explicitly assigned different weights and neither exceeds max_edge_weight, only the one in the upper triangular part of the adjacency matrix is considered. Therefore:
if max_edge_weight is
numpy.inf, it is sufficient to pass a (dense or sparse) upper-triangular matrix;
if max_edge_weight is finite, it is recommended to pass either a symmetric dense matrix, or a sparse upper-triangular matrix.
- outlist of int
Cell counts (number of simplices) at filtration value max_edge_weight, per dimension.
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 store vertex weights.
D. Luetgehetmann, “Documentation of the C++ flagser library”; GitHub: luetge/flagser.