A graph path of length at most either already has length at most , or consists of a prefix of length at most followed by one edge. ThereforeThe forward implication follows by removing the final edge of a nonempty graph path. Conversely, concatenating the indicated prefix and edge gives a walk of length at most , and removing repetitions if necessary gives a graph path no longer than that walk.
Writing for Boolean matrix multiplication, the formula is . Because includes the identity matrix, an equivalent formula isCompute each new matrix from an unchanged copy of the preceding matrix, so the subscript continues to specify exactly the length bound.
Articles by others on the same topic
There are currently no matching articles.