2026-04-22 18:44:22
[g.subgraph(c).copy() for c in sorted(nx.connected_components(g), key=lambda c: sum([l[-1] for l in g.subgraph(c).copy().edges.data('length')]), reverse=True)]
Finally came up with this one line of code.. it gives me #network components ordered by total link length. Is this pythonic? 😅 :networkx:

