code: def _compute_transition_matrix(H,
                                 nodes_to_indices,
                                 hyperedge_ids_to_indices):
      
      M = umat.get_incidence_matrix(H,
                                    nodes_to_indices, hyperedge_ids_to_indices)
      W = umat.get_hyperedge_weight_matrix(H, hyperedge_ids_to_indices)
      D_v = umat.get_vertex_degree_matrix(M, W)
      D_e = umat.get_hyperedge_degree_matrix(M)
  
      D_v_inv = umat.fast_inverse(D_v)
      D_e_inv = umat.fast_inverse(D_e)
      M_trans = M.transpose()
  
      P = D_v_inv * M * W * D_e_inv * M_trans
  
      return P
docs: Computes the transition matrix for a random walk on the given
      hypergraph as described in the paper:
      Zhou, Dengyong, Jiayuan Huang, and Bernhard Scholkopf.
      "Learning with hypergraphs: Clustering, classification, and embedding."
      Advances in neural information processing systems. 2006.
      (http://machinelearning.wustl.edu/mlpapers/paper_files/NIPS2006_630.pdf)
  
      :param H: the hypergraph to find the transition matrix of.
      :param nodes_to_indices: for each node, maps the node to its
                              corresponding integer index.
      :param hyperedge_ids_to_indices: for each hyperedge ID, maps the hyperedge
                                      ID to its corresponding integer index.
      :returns: sparse.csc_matrix -- the transition matrix as a sparse matrix.