n result, i want that the first trip that start at 6:00 and end at 7:36 from (JR Nara station → Kansai International Airport(KIX))
But shortest path algorithm return any randome trip start at 15:00 and end at 16:36 (any radome)
I can't add < condition as i don't know how many trip available for particular day.
I want most nearest trip should be return in result
My query -
Where s.id in ["290003_01"]
and e.id in ["290003_05"]
and st.arrival_time > "05:03:00"
and st.departure_time > "05:03:00"
and et.stop_sequence > st.stop_sequence
and et.arrival_time > st.departure_time
match path = shortestpath((st)-->(et))
WHERE ALL (r IN relationships(path) WHERE type(r) = 'PRECEDES' OR type(r) = 'LOCATED_AT' OR type(r)='PART_OF')
return path limit 1
Data is an gtfs format
and i am using following model.
Can anyone help how can i optmized my query for this case