I need to find paths between multiple nodes where each path should contain a particular node label atleast one time.
i checked "apoc.path.expand.config" procedure with labelFilter parameter but there i couldn't find a way to do this.
example:
let's say there are 4 nodes labels called 'LabelA', 'LabelB', 'LabelC', 'LabelD'
aa1, aa2, aa3 are of 'LabelA' node Label
bb1, bb2, bb3, bb4 are of 'LabelB' node Label
cc1, cc2 are of 'LabelC' node Label
dd1, dd2, dd3 are of 'LabelD' node Label
need to find paths between aa1,dd1, dd3 which should contain 'LabelC' node labels atleast one time.
paths which sould be given as(without considering relation directions and one nodes should not traverse twice) :
- aa1--bb4--cc2--dd1
- aa1--bb4--cc1--bb2--dd1
- aa1--bb4--cc1--bb3--dd3
- aa1--bb4--aa2--bb3--cc1--bb2--dd1
resulting subgraph looks like below.
highly appreciate your valuable inputs on this.