Boolean matrix multiplication
ID: boolean-matrix-multiplication
For Boolean matrices, replace numerical addition by logical disjunction and multiplication by logical conjunction. Applied to adjacency matrices, the product records a walk formed by following one segment represented by the first matrix and one represented by the second. For an adjacency matrix on vertices, start from . Repeated squaring then computes reflexive transitive closure once the exponent reaches : the identity entries pad shorter walks, and every reachable pair has a simple path of length at most .
New to topics? Read the docs here!