subgraph_isomorphisms for considering absent edge

Hi everyone!

I’m running subgraph_isomorphisms with V2 method and get a question here:
if I query pattern:
g1 = make_graph(edges =c(1,2,2,3,1,3), directed = FALSE)
with color1 = c(1,2,3)
g2 = make_graph(edges =c(1,2,2,3), directed = FALSE)
with color2 = c(1,2,3)

in the same big graph, the result produced by g1 is actually a subset of the result of g2.
Could I ask in this case, if I do not want patterns that connect 1 and 3, how do I query with the function?
Thanks so much and please let me know if I could provide other informations!

Use the 'lad' method and set induced=TRUE

Thank you. Could I ask what if my nodes have colors? Does lad also support node color? I did not see color arguments for lad.

Yes, you can achieve the same by using an appropriate domains argument. For each vertex, give the list of other vertices with the same colour. See the documentation for details. I’m sorry, I don’t have time to write an example now.

Thanks so much!!I have several follow-up questions, could you help me with them:

  1. in igraph, the names of the vertex can be index numbers and can also be characters. But the edge information corresponding to each vertex is always the index numbers, is this correct?
  2. when I set domains argument, the names of the ‘domains’ are the names of the pattern vertex, and the information in each element of ‘domains’ should be the potential matching vertex name (not necessarily index numbers, can be characters), is this correct?
  3. could I ask what the induced argument actually means? It looks like with induced argument, the algorithm will consider all the information in the adjacent matrix, no matter 0 or 1; without the induced argument, the algorithm will only consider 1 in the adjacent matrix. It is a little different from my understanding of induced subgraphs.
    Thanks so much for your help! Please let me know if I’m not being clear.