Re: [graph-tool] Building (and working with) bipartite graphs

2020-07-09 Thread Davide Cittaro
Hi Tiago, thanks for the answer > On 9 Jul 2020, at 16:45, Tiago de Paula Peixoto wrote: > > In order for us to investigate further you need to provide us with a > minimal working example, not only the error message. I can give you the NestedBlockState produced from the previous message

Re: [graph-tool] Building (and working with) bipartite graphs

2020-07-09 Thread Tiago de Paula Peixoto
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

[graph-tool] Building (and working with) bipartite graphs

2020-07-09 Thread Davide Cittaro
Hi, I'm trying to build a bipartite graph from a MxN array. So far I've been able to do this: # adjacency is the original np.array S = [] E = [] W = [] for x in range(adjacency.shape[0]): for y in np.where(adjacency[x] > 0)[0]: S.append(x) E.append(y + adjacency.shape[0]) #