I need to calculate shortest paths with conditions (conditions may be very hard). I've tried next sample query but it takes me a lot of time
FOR p IN ANY K_SHORTEST_PATHS
'graph_vertices/1' TO 'graph_vertices/2'
graph_edges
OPTIONS {
weightAttribute: 'weight',
defaultWeight: 1
}
FILTER p.edges[*]._key NONE IN ['736023', '659112', '695090', '731912', '680907', '699903']
LIMIT 3
RETURN {name: CONCAT_SEPARATOR(' -> ', p.edges[*]._key), weight: sum(p.edges[*].weight)}
Is there any way to make pre filtration? I mean filter edges collection and then start finding shortest path. May be some other tips which can help me?
p.s. I can't use traversal because I don't know about length of path and also I need shortest paths according to weights. Graph size ~ 50 000 vertices and 450 000 edges