Compute K-th power of Adjacency Matrix