Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-07-2020 11:07 AM
I am using Yen’s K-Shortest Paths algorithm. I have a situation when I have multiple 'redundant' paths, which I'd like to reduce to only one. Supplier (node) FILLS (relationship) multiple PurchaseOrders (node) and PurchaseOrders USED (relationship) by an Organization (node). There could be dozens or even hundreds of PurchaseOrders between a specific Supplier and a specific Organization, but for my purpose it's only path. It seems like the natural thing to use here is Virtual Relationships, which I have used for other types of queries.
However, the ShortestPath algorithms do not recognize Virtual Relationships, here is the error message I'm getting (PURCHASES_FROM is the name of the Virtual Relationship I created)
Failed to invoke procedure `gds.alpha.kShortestPaths.stream`: Caused by: java.lang.IllegalArgumentException: Invalid relationship projection, one or more relationship types not found: 'PURCHASES_FROM|...'
Is there a way I can get around this problem?
Thank you.
08-17-2020 03:05 AM
I don't think the library supports virtual relationships, but you should be able to achieve the same thing using a Cypher projection. See https://neo4j.com/docs/graph-data-science/current/management-ops/cypher-projection/
if you share the way that you create the virtual relationships, I can translate that into the appropriate Cypher projection code.
10-28-2020 04:13 PM
cypher projection doesn't return the result that can be used for visualization. Though I don't know if the author has already figured out the way to solve it, I am wondering what I can do to find the shortest path over virtual relationships or virtual graph.
11-22-2021 01:45 AM
Can you provide an example for- how to use projections for ShortestPath algorithms using virtual relationships?
Thanks
All the sessions of the conference are now available online