I have searched for a similar topic and did not find one, so here goes:
System: MacBookPro, OS 11.5.1, Intel Chipset
Neo4J: Enterprise v4.3.2
GDS: v1.6
I have meticulously (copied) the GDS 1.6 Examples (Section 3) for:
Dijkstra Source Target
Dijkstra Single Source
Yens
And all is well, until the last step when writing from the mutated graph projection to the database. All have failed with the following error:
Hello @skerr ,
thank you for reporting the error!
I could verify the error and it seems to occur when running Yens multiple times with different modes.
Running f.i. only write mode works.
I hope this can be a workaround for now and we will investigate further in the meantime.
Update: Using mutate + writeRelationship worked for me.
The problem lies in the chained execution of the examples.
On mutate, you create a new relationship type in the in-memory graph. The created PATH relationships only have the property totalCost but not cost.
When you execute the write example afterwards, GDS checks if all relationships have a cost property defined. This is not the case for the newly created PATH relationships.
To exclude the newly created PATH relationships, specify relationshipTypes: ['ROAD'].
Florentin: Thank you for verifying the issue. My follow-up question:
I thought the entire point of the chained execution is the ability to write the optimized relationship PATH and the relevant properties between the sourceNode and targetNode back in the Neo4J database. In your comment you note to exclude the PATH relationship. Why?
We have three main modes for our algorithms: stream, mutate, write.
Stream - Directly returns the results, easy to inspect but inefficient to persist.
Mutate - Writes the result into the GDS in-memory graph (not persisted on the neo4j db). The results can be used in following GDS algorithm/procedure calls.
Write - Writes the result into the neo4j db. Not usable in GDS without projecting a new graph.