Am 14.04.20 um 09:32 schrieb Tanguy Fardet:
From what I understand, then, it seems that, when using undirected=True, graph-tool considers reciprocal edges as two different ones and considers the possible triangles between parallel edges as distinct.
Is this desired behavior, and if so, why?> I know it stems from the mathematical formula, but I think this one was derived from simple graphs and I'm not sure I see the physical meaning of the "extension" to parallel edges, besides the fact that it would perhaps give the same result as weighting the edges by their number.
Yes, it's desired behavior. Ignoring parallel edges would have complicated and slowed down the code, and in any case can be easily implemented by the user (see below), who should have something specific in mind when attempting to compute the value for multigraphs.
If this is indeed desired, is there a quick way to do the equivalent of setting the graph to undirected and removing the parallel edges in "view-mode" (i.e. making the removal temporary, like a filter)?
Yes, just use: u = GraphView(g, directed=False) GraphView(u, efilt=label_parallel_edges(u).fa == 0) Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>