Incidence matrix from bipartite graph in python-igraph

What is the most efficient way of returning the incidence matrix of a bipartite graph in Python? I see that the R interface comes with a helper function called as_incidence_matrix, but I don’t see anything comparable in python-igraph.

(Essentially I am looking for the inverse of igraph.Graph.Incidence, which allows building a graph from an incidence matrix.)

It’s the get_incidence method.

1 Like