Using the Warshall algorithm to find the reachability matrix of graphs