Friday, 15 July 2011

php - Complicated relationship properties on Neo4j database -



php - Complicated relationship properties on Neo4j database -

i developing route planner on neo4j education purpose.i developed algorithm , using both of cypher query , rest api in project.bu there problem non-fixed me.i trying calculate different routes neo4j dijkstra, shortestpath , own algorithm.

for example, there nonsense routes calculating neo4j.the output gives many times transfer bus user,when utilize dijsktra algorithm in neo4j.also, it's shortestpath.i want give 5 times transfer maximum.how can prevent problem?

also, neo4j gives output on next segment of code;

0 => array( 'stop' => '1', 'stopid' => '163', 'stopname' => 'kalihi-palama bus facility', 'routeid' => (int) **132**, 'routename' => 'kalihi via school street express', 'routeshortname' => 'w3', 'relationship' => array( 'routeid' => (int) 79, 'routetype' => 'route', 'endnode' => '1' ) ), (int) 1 => array( 'stop' => '0', 'stopid' => '4523', 'stopname' => 'kalihi transit center', 'routeid' => (int) 1, 'routename' => 'kaimuki-kalihi', 'routeshortname' => '**132**', 'relationship' => array( 'routeid' => (int) 1, 'routetype' => 'route', 'endnode' => '54' ) ), (int) 2 => array( 'stop' => '54', 'stopid' => '38', 'stopname' => 's beretania st + opp kalakaua ave', 'routeid' => (int) **2**, 'routename' => 'waikiki-school-middle', 'routeshortname' => '2', 'relationship' => array( 'routeid' => (int) 2, 'routetype' => 'route', 'endnode' => '54' ) ), (int) 3 => array( 'stop' => '53', 'stopid' => '37', 'stopname' => 'kalakaua ave + s king st', 'routeid' => (int) **132**, 'routename' => 'waikiki-school-middle limited', 'routeshortname' => '2l', 'relationship' => array( 'routeid' => (int) 132, 'routetype' => 'route', 'endnode' => '53' ) ) ...

it's no sense giving routeid=2 bus.because, when off bus, can on same buss again.it's not smarty.how can prevent this?

i utilize code in next segment;

start n=node(5), m=node(45) match p=shortestpath(n-[r:route*..100]-m) homecoming p

thanks, best regards

php algorithm neo4j cypher dijkstra

No comments:

Post a Comment