I am new to using graph tech . Below is one sample data i have , i want to put this in redis graph and find the shortest distance between 2 points .
{"Entry":{"Reception":152},"Reception":{"Corner":176,"Exit":153},"Corner":{"Gate":41,"Reception":176},"Gate":{"LiftLobby":53,"Corner":41},"LiftLobby":{"Gate":53}}
For example in this json object distance between Entry and Reception point is 152 units . What are the redisgraph queries i should use to
- Add data to the redisgraph.
- To Find shortest distance between 2 points .
If I understand your problem correctly, that's how I would model this data in RedisGraph:
Locentities withnameproperty: Entry, Reception, Corner, Exit, Gate, LiftLobyWayrelationships between pairs of entities withdistpropertyTo find the shortest path between two places - use RedisGraph 2.10
algo.SPpathsprocedure (see "Single-Pair minimal-weight bounded-cost bounded-length paths" here).Creating the graph:
Querying for the shortest path between Entry and Gate: