How do you return only one cycle?

Dear all,

I look for the cypher code enable to return only one path.

I assume that I have, A->B1->C1->D1->B1 and A->B2->C2->D2->B2.
I would to retrieve the components of these 2 cycles.

I try the following code but I retrieve 6 cycles
MATCH path=(l:LEU)-[:REL*2..]->(l)
WHERE all(r in relationships(path))
RETURN relationships(path) as rel

I get
path1 : B1->C1->D1
path2 : C1->D1->B1
path3 : D1->B1->C1
path4 : B2->C2->D2
path5 : C2->D2->B2
path6 : D2->B2->C2

How can I update the code to retrieve only path1 and path4 following an order based on id of node ?

Regards,
Alexandre

Try this:

MATCH (c:B1) 
CALL apoc.path.subgraphAll(c, {maxLevel: 2}) 
YIELD nodes, relationships
RETURN nodes, relationships

MATCH (c:B2)
CALL apoc.path.subgraphAll(c, {maxLevel: 2}) 
YIELD nodes, relationships
RETURN nodes, relationships