Count the number of paths between all vertices in at most

steps for a directed graph:
Count the number of paths from

to

in at most

steps for a directed graph:
Compute the cocitation matrix, where the cocitation for two vertices is the number of common ancestors:
Compute the coupling matrix, where the coupling between two vertices is the number of common descendants: