On 08/04, Phil Cui wrote: > (1) it gives motifs including those are the same type as g1 and also those are > different types from g1 according to the result from > isomorphism_class; It could be the case that the issue is that you *expected* igraph to do an induced subgraph isomorphism search. For instance, consider the following pattern graph:
A --> B --> C and the following target graph in which the pattern is being searched: a --> b --> c --> a igraph will happily return the mapping A=a, B=b, C=c as well as A=b, B=c, C=a and A=c, B=a, C=b because the edges A --> B and B --> C can be mapped to some edges of the target graph and the subgraph isomorphism algorithm does not aim to map _nonexistent_ connections of the pattern graph to _nonexistent_ connections of the target graph. If you want to ensure that missing connections between a pair of vertices in the pattern graph are mapped to missing connections in the target graph, you need to use *induced* subgraph isomorphism search. subgraph_isomorphisms() in the R interface of igraph actually uses one of two algorithms behind the scenes: VF2 or LAD. The LAD algorithm supports induced subgraph isomorphisms, while VF2 does not, so if you want to search for induced subgraph isomorphisms, you need to call subgraph_isomorphisms with method="lad" and induced=T. > (2) there are many duplicated combinations of nodes which relates to > the same motif; It can probably happen if the motif is isomorphic to itself -- in such cases, multiple mappings may exist between the pattern and the target graph such that the same nodes of the target graph are mappend to the pattern but in different order. > (3) the result provided is based on the vertex name, but I prefer vertex id. > I tried unlist to get the ids, however, that will combine all > everything together. Just erase the vertex names temporarily before performing the search and add them back later. (There could be a better solution for the problem in the R interface but I'm not too familiar with R). All the best, T. _______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
