I have a large, non-cyclic directed graph.
Every node has some key/value pairs. Some of the keys can be searched by range.
Let's say all nodes have these keys:
- color - red, blue, green, etc.
- price - an integer
- size - an integer
I want to select a list of nodes from my graph such that:
- all nodes have co开发者_运维技巧lor = red
- all nodes have price >= 10 and <= 20
- the list is ordered by increasing size
- any node that meets the criteria for color and price and has no outlinks (no edges go from that node) is in the list
- no two nodes in the list share an edge
Ideally, the list would have the maximum number of nodes possibly to satisfy all those constraints.
I need to be able to search this graph very quickly.
What kind of data store (graph or otherwise) is best suited for this problem? Any hints on how to implement schema and query to get the best performance?
Do you have any size estimations on this? That would give some more hints on how you can do the computations - in memory or index or lazy graph loading. /peter neubauer
精彩评论