Reputation: 1
I have a question about weighted graphs in neo4j. Is a property (like ".setProperty("cost", weight)") the only way of constructing a weighted graph. The problem is that a program, which often needs this weights by "(Double) rel.getProperty("cost")" will get too slow, because the cast takes some time;
Upvotes: 0
Views: 106
Reputation: 6331
Well, you actually could encode the weight into the relationship type which is faster, something like
create a-[:`KNOWS_0.34`]->b
http://console.neo4j.org/r/2dez98 for an example.
Upvotes: 1