Using Neo4j with geo data

neo4j-spatial

(I Vedeneev) #1

I have a question about your database. You have implemented a Dijkstra-search of paths between nodes in your database. We have this problem – each edge have its restrictions for example “the edge is disabled during weekends” or “the edge is available between 08:00 – 22:00 UTC” or “the edge is available if you started at this point X or going to the point Y, otherwise it’s closed” some other conditions.

So that means that it finds a different path on week days and weekends, after 22:00 and before 08:00.

Is it possible to implement such restrictions for our GEO-data in Neo4j?

Ivan


(Craig Taverner) #2

The question you ask related to the 'Graph Algorithms' topic where the Dijkstra algorithm is discussed. I have changed the category to increase the chances of you finding people with the knowledge to help. You might also want to change the title of the question, because Dijkstra is only distantly related to geo-spatial. In particular, the constraint you described, with an edge disabled during certain time periods, sounds more like a temporal restriction, with no spatial component at all.

I have also just reviewed the documentation at https://neo4j.com/docs/graph-algorithms/current/algorithms/shortest-path/, and I see that there is a section 6.2.7 which describes a way to restrict the path using Cypher queries, in which case you could add a relationshipQuery which takes into account the valid times of the edge.

You could either add a boolean to the edge which you change each day, or you could add an active wday range and query that dynamically in the relationshipQuery.


(I Vedeneev) #3

Thank you very much, I will check it.