简体   繁体   English

查找图形中包括顶点的所有路径

[英]finding all paths in a graph including a vertex

I have a directed simple graph (named tutti) and a list of vertex (named risultato). 我有一个有向简单图(名为tutti)和一个顶点列表(名为risultato)。

I want to find the full set of subgraph extracted by "tutti" that includes a vertex in the array risultato. 我想找到由“ tutti”提取的全套子图,其中包括数组risultato中的一个顶点。

As example in the included picture the graph tutti 例如,在包含的图片中,图tutti

在此处输入图片说明

Given the vertex 609 (that is one vertex present in risultato) (in red on the left) i need to plot the graph in picture 给定顶点609(即risultato中存在一个顶点)(左侧为红色),我需要在图片中绘制图形

在此处输入图片说明 How can i extract all those graphs? 如何提取所有这些图?

The vertexes to be taken in consideration are in the array risultato. 要考虑的顶点在数组risultato中。

return all path in "tutti" graph arriving to each element in risultato: 返回“ tutti”图中的所有路径,到达risultato中的每个元素:

sottografierrorisopra<-graph.neighborhood (tutti,vcount(tutti),risultato, "in") sottografierrorisopra <-graph.neighbourhood(tutti,vcount(tutti),risultato,“ in”)

return all path in "tutti" graph starting from the vertex in the risultato #array 从risultato #array中的顶点开始,返回“ tutti”图中的所有路径

sottografierrorisotto<-graph.neighborhood (tutti,vcount(tutti),risultato, "out") sottografierrorisotto <-graph.neighbourhood(tutti,vcount(tutti),risultato,“出”)

union of the graphs 图的并集

zz<- graph.union (sottografierrorisopra, sottografierrorisotto) zz <-graph.union(sottografierrorisopra,sottografierrorisotto)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM