Neo4j A* with block nodes and must-have nodes (TSP)

25 views
Skip to first unread message

josch...@outlook.de

unread,
Jan 18, 2018, 6:29:20 PM1/18/18
to Neo4j
I already posted this on stackoverflow but i feel like its not just a problem. There is also stuff for broader discussion.

I want to find shortest paths in neo4j. My nodes have x and y coordinates and my relations have a property with distance.
The A* procedure works fine to find the shortest path. But I also need to be able to block some nodes or to choose nodes that have to be in the resulting path (kind of the TSP).
The block nodes and must have nodes vary for every call of the A* procedure, therefore you cant just change the data to exclude them in the A*. 

My colleagues and I feel like a Graphdatabase should be able to solve this kind of problems from scratch.
The amount of must have nodes wont be that high (probably 1-5). I'm already trying to solve this on my own but I think this is a quite popular thing and should be a part of neo4j.

Did I miss something while researching? How to solve this properly?

I already solved the block nodes with writing my own estimateEvaluator but Im not to happy with it because it's just a String of ID's I hand over at the call of my procedure. 

For the TSP I got some ideas, todo list:
- A* for (start-,end-,must-have nodes)x(start-,end-,must-have nodes)
- Create own graph(?) with start-,end-,must-have nodes and all the distances equated with the A*
- find the hamiltonian path

Michael Hunger

unread,
Jan 19, 2018, 7:14:14 AM1/19/18
to ne...@googlegroups.com
I think that would be a good feature request for the apoc procedure, can you post your request as an issue there?

e.g. to pass in an optional config of {include:[nodes], exclude:[nodes]}  to be used in an Evaluator.

Should be pretty straightforward to add. Perhaps you can send a PR. That would be great.

Cheers, Michael



--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages