How vertex and edge properties are taken into account in clustering.motifs


Please, I would like to know if vertex and edge properties of a graph are
taken into account in clustering.motifs.

In my graph, edge properties are some int labels with two possible values
(as shown in the image

When I use clustering motifs, it returns 1 motif with 2 nodes and this motif
occurs 5 times in the original graph.

In [144]: motifs, counts, vm = gt.motifs(grafo, 2, return_maps=True)

In [145]: motifs
Out[145]: [<Graph object, undirected, with 2 vertices and 1 edge at

In [146]: counts
Out[146]: [5]

In [148]: len(vm)
Out[148]: 1

In [149]: len(vm[0])
Out[149]: 5

It seems to me that clustering.motifs does not take into account vertex and
edge properties. Is it true?

Is there any way to generate motifs that take into account the vertex and
edge properties?

In my example, I expected that there would be 2 motifs
Motif 1: 2 nodes and 1 edge with label 10, which occurs 2 times in the
original graph.
Motif 2: 2 nodes and 1 edge with label 13, which occurs 3 times in the
original graph.

Thank you for any help you can provide,


There is currently no support for labeled motifs in graph-tool. Any
properties in the vertices will be ignored.

You may open a feature-request ticket in the website if you want this
implemented in the future.