How to get which motifs each value corresponds to?

I’m using python-igraph to find the motifs in a graph with the method motifs_randesu.
And it returns a list of the number of each motif. However, I don’t know what kind of motif each number corresponds to.
For example:

g = IGraph.TupleList(edges, directed=True, vertex_name_attr='name', edge_attrs=None, weights=True)
print(g.motifs_randesu(size=4))

And I get a list:

[nan, nan, 2, nan, 4, 10, 9, 1, 0, 33, 26, 0, 4, 0, 17, 16]

What kind of motif does the number 16 represent?
Thank you.

If you have motif_count = g.motifs_randesu(size=4) then each element of motif_count gives the counts of the motif. That is, if motif_count[i] = n then isoclass i appears n times in the graph. You can construct the graph which motif i corresponds to with Graph.Isoclass(n=4, class=i). See also https://igraph.org/python/doc/igraph.GraphBase-class.html#Isoclass

It works!Thank you for you help!

1 Like

No problem, you are welcome! You can indicate that the post solves your question, so that others can find solutions more easily.