[graph-tool] Building (and working with) bipartite graphs
Tiago de Paula Peixoto
tiago at skewed.de
Thu Jul 9 16:45:06 CEST 2020
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, idx, adjacency[idx]]).T
edges[:,1] += edges[:,0].max() + 1 # offset bipartition
> 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.
Tiago de Paula Peixoto <tiago at skewed.de>
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: OpenPGP digital signature
More information about the graph-tool