0

I was wondering how to get the subgraph corresponding to a specific triad. E.g., suppose I have a graph g and that:

triad_census(g)
[1] 16  8  0 10  1  0  0  0  0  0  0  0  0  0  0  0

I'd like to extract graph corresponding to the 5th triad, is to say only triad of type 021U.

I used Igraph, but I'm ok with using another library. Thanks

Suppose I've a directed graph like the following: small directed graph "g"

The unique triad of type 021U I would like to extract using isomorphism should be "Brazil-Spain-Norway".

Umberto
  • 11
  • 5
  • Welcome to StackOverflow. A [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) would be helpful – polka Dec 13 '15 at 03:21
  • 1
    See http://igraph.org/r/doc/graph_from_isomorphism_class.html and http://igraph.org/r/doc/subgraph_isomorphisms.html – Gabor Csardi Dec 13 '15 at 09:39
  • Thank you Gabor, let me see if I've understood. You're proposing to build up a graph corresponding to the triad I'm interested in, say type 021U, passing the correct argument to `graph_from_isomorphism_class` like: `z<-graph_from_isomorphism_class(3, 5, directed = TRUE)`. Than, to build up a list of isomorphic subgraph to `z` extracted from my original graph `g` using `subgraph_isomorphisms(z, g, method = c("vf2"))`. Did I understand correctly? – Umberto Dec 13 '15 at 14:38

0 Answers0