Reputation: 513
I have successfully used the following to get the shortest path using A* in the APOC library.
apoc.algo.aStar("A", "B", 'Link', 'Length','X','Y') YIELD path, weight
apoc.algo.aStar("A", "B", 'Link', {weight:'Length',default:1, x:'X',y:'Y'}) YIELD path, weight
How would I go about adding a filter so that it only uses edges where "Value" is true. The documentation doesn't provide an example.
public class Node{
public long Id {get;set;}
public string Name {get;set;}
public long X {get;set;}
public long Y {get;set;}
}
public class Link{
public bool Value {get;set;}
public long Length {get;set;}
}
Upvotes: 0
Views: 185
Reputation: 7478
There is no example because this feature is not available.
So you have three choices :
Length
value very high on relationships where "Value" is trueLink_On
and Link_value_Off
), so you can use the apoc procedure.Upvotes: 2