我需要使用networkx'skernighan_lin_bisection函數拆分網絡但無法初始化對象。我很尷尬地說我下面的玩具示例確實有效:import networkx as nxfrom networkx.algorithms import communityg = nx.Graph()g.add_edges_from([(1, 2), (3, 4), (3, 8), (1, 8)])blocks = community.kernighan_lin.kernighan_lin_bisection(g, partition=None, max_iter=10)blocks({3, 4}, {1, 2, 8})但是,使用我的實際數據——一個有 489 個節點和 1832 條邊的網絡,我可以打印結果元組,kernighan_lin_bisection但不能將其保存為對象。問題可能是什么?
添加回答
舉報
0/150
提交
取消