我想在Gephi中的两个随机节点之间画一条路径。我写我的sudo代码请帮我。你知道吗
import random
i = random.sample(g.nodes,1) #[v76] head of path
j = random.sample(g.nodes,1) #[v71] end of path
# i = random.randint(n) #first node, head of path
# j = random.randint(n) #second node, end of path
for u in g.nodes:
head = i
for v in g.nodes:
g.addUndirectedEdge(head,v);
head = v;
if v==j: break
结果:
>>> Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: addDirectedEdge(): 1st arg can't be coerced to org.gephi.scripting.wrappers.GyNode
目前没有回答
相关问题 更多 >
编程相关推荐