verify_simplicial() builds the clique complex of mat with
build_simplicial() and checks it against two independent references:
its simplices
against the cliques igraph::cliques() finds in the same thresholded
graph, and its Euler characteristic against the alternating sum of its
Betti numbers (the Euler-Poincare theorem). It prints the result of each
check and the Betti numbers, and is meant for testing. It needs
igraph, and raises an error without it.
Arguments
- mat
A square weight matrix, or a network object whose weight matrix
build_simplicial()reads (anetobject,tnamodel,cograph_networkornet_hon).- threshold
The smallest absolute edge weight an edge needs to enter, as in
build_simplicial(). Default0.
Value
A list, invisibly: cliques_match (whether the simplices equal
the cliques from igraph::cliques() exactly), n_simplices_ours,
n_simplices_igraph, betti, euler and f_vector. The two checks
are printed as a side effect.
Details
The complex is built with the default max_dim = 10, while
igraph::cliques() has no size limit, so a graph with a clique of more
than 11 nodes reports a mismatch, with a warning of class
nestimate_truncated_complex from betti_numbers().