Am 09.07.20 um 14:37 schrieb Davide Cittaro:> I'm pretty sure this is not the most efficient way to go, but gt.is_bipartite(g) returns True. Can anybody suggest a more straightforward approach? Also, is it necessary to specify a VertexPropertyMap with node type (i.e. M or N)? You're probably better off with doing something like: idx = adjacency.nonzero() edges = array([idx[0], idx[1], adjacency[idx]]).T edges[:,1] += edges[:,0].max() + 1 # offset bipartition g.add_edge_list(edges, eprops=[weight])
Anyhow, after I had the graph and the final model, I tried to draw:
gt.draw_hierarchy(state, layout='bipartite')
but I get this error
In order for us to investigate further you need to provide us with a minimal working example, not only the error message. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>