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 color = 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?