I have lists of integers :
[[1,2,3,4,5,6,7,8,9],
[1,2,-7,-6,-5,-4,-3,10,11,12],
[3,4,-5,6,7,8,11,12,2,2],
[etc]]
- a number can be found 0, 1 or multiple times in each list
- the sign can be negative
I need to find the motifs that are conserved in all the lists. Here, the result would be only one motif (which I found manually) :
[[3,4,5,6,7],
[-7,-6,-5,-4,-3],
[3,4,-5,6,7]]
By "motif", I mean a sequence of numbers (at least 2 digits) that is found in all the lists : here for an example, the numbers 3,4,5,6,7 are found in this consecutive order in all the lists, though the order is reversed in the second list. Ideally, the detection of the motifs would allows a small number of differences
Any ideas ?
I thought that using networkX could help me identify "cliques" but I do not find a function that would help me solve this problem.
a is your list