code: def convert_to_adjacency_matrix(matrix):
      
      for i in range(matrix.shape[0]):
          
          if isspmatrix(matrix):
              col = find(matrix[:,i])[2]
          else:
              col = matrix[:,i].T.tolist()[0]
  
          coeff = max( Fraction(c).limit_denominator().denominator for c in col )
          matrix[:,i] *= coeff
  
      return matrix
docs: Converts transition matrix into adjacency matrix
  
      :param matrix: The matrix to be converted
      :returns: adjacency matrix