Added transpose function for graphs.
Added unit tests for transpose function in graphs.