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 igraph.GraphBase

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.

[quote=“vtraag, post:2, topic:96”]
https://igraph.org/python/doc/igraph.GraphBase-class.html
[/quote] is not a vaild webseit, could you tell me the new one?

The new link is igraph.GraphBase. I will also edit the post.

Thanks!Could you please clarify why “None” appeared in the list? Additionally, I would appreciate it if you could explain what “None” means in this context. Thank you for your assistance!

Only connected (to be precise: weakly connected) motifs are counted.

For example, numbers 1, 2 and 4 in the following list are excluded as they are not connected:

image

These are the ones that you get None for.