def _trans(g, deg): """ Given graph g, and inverse degree matrix. Returns transition matrix for g (uniform over adjacent vertices). """ adj = nx.to_scipy_sparse_matrix(g, format = "csc") return (deg * adj).T