database,neo4j,shortest-path,graph-traversal

If all relationships with the ROUTE_ID property have a specific relationship type, say 'ROUTE', then you can do this: START n=node(5), m=node(45) MATCH p=shortestPath(n-[:ROUTE*..1000]->m) RETURN p,length(p); Otherwise, you can do this: START n=node(5), m=node(45) MATCH p=shortestPath(n-[r*..1000]->m) WHERE all(x IN r WHERE has(x.ROUTE_ID)) RETURN p,length(p); The former approach should be much...

constructor,pyyaml,graph-traversal

For complex types, that might involve recursion (mappings, list, objects), the constructor cannot create the object in one go. You should therefore yield the constructed object in the constructor() function, and then update any values after thatÂ¹: def constructor(loader, data): result = Node() yield result mapping = loader.construct_mapping(data) result.child =...

One way to solve this would be to not delete anything until the traversals are complete. Instead, during the traversals, just add each node and relationship to be deleted to the corresponding HashSet. Afterwards, call Relationship.delete() on everything in the relationship Set, followed by Node.delete() on everything in the Node...