Added method to compute transpose of a graph