0

I have a directed simple graph (named tutti) and a list of vertex (named risultato).

I want to find the full set of subgraph extracted by "tutti" that includes a vertex in the array risultato.

As example in the included picture the graph tutti

enter image description here

Given the vertex 609 (that is one vertex present in risultato) (in red on the left) i need to plot the graph in picture

enter image description here How can i extract all those graphs?

user20650
  • 24,654
  • 5
  • 56
  • 91
Alex Fort
  • 93
  • 6
  • 1
    Hi Alex, thanks for providing a figure. It is still a little unclear what you need. Can you try and produce a small example of a graph and how you want to extract some nodes giving your expected output. Your previous question [here](http://stackoverflow.com/questions/27968678/get-node-descendants-in-a-tree-graph/27969283#comment44361509_27969283) gives details on how to make a reproducible example. – user20650 Jan 19 '15 at 18:58
  • 1
    Hi, in the mean while i succeeded in solving in a very rude and not elegant way my problem. Starting from the vertex to study (in the array "risultato") i used the following statement: sottografierrorisotto<-graph.neighborhood (tutti,vcount(tutti),risultato, "in") and then the other sottografierrorisopra<-graph.neighborhood (tutti,vcount(tutti),risultato, "out") so i unified them with graph.union to have the upper and lower sides of the vertexes .... and that was all – Alex Fort Jan 20 '15 at 15:38

1 Answers1

0

The vertexes to be taken in consideration are in the array risultato.

return all path in "tutti" graph arriving to each element in risultato:

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

return all path in "tutti" graph starting from the vertex in the risultato #array

sottografierrorisotto<-graph.neighborhood (tutti,vcount(tutti),risultato, "out")

union of the graphs

zz<- graph.union (sottografierrorisopra, sottografierrorisotto)

Community
  • 1
  • 1
Alex Fort
  • 93
  • 6