I am using the following neo4j cypher query on my graph:
MATCH (start:N1{id:'xyz'})
CALL apoc.path.expandConfig(start, {sequence:'N1, a>, N2, b>, N3, c>,
N4', maxLevel:3}) YIELD path
RETURN path
ORDER BY length(path) DESC
This returns all paths like
X-a->Y-b->Z-c->**A**
X-a->Y-b->Z-c->**B**
X-a->Y-b->Z-c->**C**
X-a->Y-b->Z
X-a->Y
X
X-a->V
X-a->W
But all I want to return is paths having no duplicate shorter paths because they are already included in a longer path.
Here is the output I want:
X-a->Y-b->Z-c->**A**
X-a->Y-b->Z-c->**B**
X-a->Y-b->Z-c->**C**
X-a->V
X-a->W
Can someone please help? I am new to Neo4j