I am trying to solve a problem where I want to find all the combinations based on temporal relationships.
If I have graphed the following scenario:
A Person commutes to their job
by Car from 4/1 - 7/15
by bike from 7/16 - 8/2
Person has Job1 from 4/1 - 5/15
Person has Job2 from 5/16 - 7/2
Person has Job3 from 7/3 - 8/2
Person Lives at Residence1 4/1 - 5/1
Person Lives at Residence2 5/2 - 8/2
We can view the graph
With a simple where clause, I can see the combination for any given date
match (p:Person{firstName:'Mike'})-[r]-(m)
where r.startDate < date('2018-05-30') < r.endDate
return p,r,m
I want to find the complete list of different combinations so that I could determine that
For example:
4/1 - 5/1 - Car, Residence1, Job1
5/2 - 5/15 - Car, Residence2, Job1
5/16 - 7/2 Car, Residence2, Job2
7/3 - 7/15 Car, Residence2, Job3
...
My first approach would be to loop through each day and determine if the nodes that matched were the same as the previous day but am looking for any suggestions on how I could do this.