Description Usage Arguments Value See Also Examples
Deprecated. Use allShortestPaths
. Retrieve all the shortest paths between two nodes weighted by a cost property.
1 2 | allDijkstra(fromNode, relType, toNode, cost_property = character(),
direction = "out")
|
fromNode |
A node object. |
relType |
A character string. The relationship type to traverse. |
toNode |
A node object. |
cost_property |
A character string. If retrieving a weighted shortest path, the name of the relationship property that contains the weights. |
direction |
A character string. The relationship direction to traverse. Should be "in" or "out". |
A list of path objects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
graph = startGraph("http://localhost:7474/db/data/")
clear(graph)
alice = createNode(graph, "Person", name = "Alice")
bob = createNode(graph, "Person", name = "Bob")
charles = createNode(graph, "Person", name = "Charles")
david = createNode(graph, "Person", name = "David")
elaine = createNode(graph, "Person", name = "Elaine")
r1 = createRel(alice, "KNOWS", bob, weight=1.5)
r2 = createRel(bob, "KNOWS", charles, weight=2)
r3 = createRel(bob, "KNOWS", david, weight=4)
r4 = createRel(charles, "KNOWS", david, weight=1)
r5 = createRel(alice, "KNOWS", elaine, weight=2)
r6 = createRel(elaine, "KNOWS", david, weight=2.5)
p = allDijkstra(alice, "KNOWS", david, cost_property="weight")
p[[1]]$length
p[[1]]$weight
nodes(p[[1]])
p[[2]]$length
p[[2]]$weight
nodes(p[[2]])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.