smhd_graphs#

causalbase.metrics.smhd_graphs(m1, m2)[source]#

Return the number of node pairs adjacent in exactly one of two undirected graphs.

Parameters:
m1np.ndarray

Symmetric (boolean or 0/1) adjacency matrix of an undirected graph.

m2np.ndarray

Symmetric adjacency matrix of an undirected graph, same shape as m1.

Returns:
int

The number of unordered node pairs adjacent in exactly one of the two graphs.

Raises:
ValueError

If m1 and m2 have different shapes.