擅长:python、mysql、java
<p>您应该能够执行以下操作:</p>
<pre><code>r69edges = g.es.select(name_eq='Route69') #Select all edges where name=='Route69'
sg = r69edges.subgraph() #Create a subgraph containing only the selected edges (and attached vertices)
village_verts = sg.vs.select(name_eq='villages') #Select the vertices where name=='villages'
</code></pre>
<p>这假设'villages'和'Route69'存储在顶点和边上名为'name'的属性中。。。适当调整以匹配您的属性。在</p>
<p>当然-如果你想的话,你可以把这些都压缩成一行:</p>
^{pr2}$
<p>不确定这是否是最有效的方法(虽然我在文档中没有看到任何捷径),但它应该能让你得到你想要的。在</p>