Skip to content

Instantly share code, notes, and snippets.

View mauget's full-sized avatar

Louis E Mauget mauget

View GitHub Profile
@mauget
mauget / Neo4j shortest path
Last active March 3, 2019 23:10
Emits a Google KML stream of the shortest path between two points. A "point" is a Neo4j node having latitude and and longitude properties. The Neo4j A* algorithm does the work.
public void findShortestPath(PrintStream ps, long startNode, long endNode) {
try {
RouterService router = Initializer.getApplicationContext().getBean(RouterService.class);
router.emitShortestPathKML(ps, startNode, endNode);
} catch (Exception e) {
e.printStackTrace();
}
}
public void emitShortestPathKML(PrintStream ps, long keyValueA, long keyValueB)