filmov
tv
Competitive Programming Guide - Math #12 - Adjacency Matrix Exponentiation

Показать описание
Key fact: raising the adjacency matrix of a graph to a power gives the number of paths of that length between each pair of vertices! This is really beautiful, in my opinion.