cancel
Showing results for 
Search instead for 
Did you mean: 

Join the community at Nodes 2022, our free virtual event on November 16 - 17.

Cypher has variable-length "line"-of-arrows matching, but does it have variable-size "grid" matching?

fruitfulapproac
Graph Buddy

I know you can search for "any number of arrows" using Variable-length pattern matching

So that matches a "line of arrows" if you will, of any length.

But can you match a "grid of arrows" of any size, ie. a 2D grid, possibly even 3D if it can be done for 2D?

A -> B -> C -> ... -> D
|    |    |           |
V    V    V           V
A'-> B'-> C'-> ... -> D'
.    .    .           .
.    .    .           .
.    .    .           .
|    |    |           |
V    V    V           V
A''->B''->C''-> ... ->D''

That is what I mean as a generalization of the 1D case, a 2D grid of any size. Where, for this question, each square in the grid is bounded by exactly 4 arrows or "sides".

If it Cypher doesn't directly support this, then what would be the most optimal way of implementing it using Neo4j's suite of technology?

1 REPLY 1

luiseduardo
Ninja
Ninja

Hi @fruitfulapproach !

So, if I understand correctly you want to get from A to B' by doing a 2-hop search from two directions (through B and through A')?

If this is the case, the variable-length pattern matching actually does that, it doesn't go just from A to B or from A to A' , exclusively, but from every relationship that A has.

Please let me know if this is useful or if you have more details for the case you want to solve!

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit - November 16 - 17, 2022.


Free NODES Training Series


October 19th -

Intro to Neo4j


October 20th -

Healthcare Analytics Using Neo4j


October 25th -

Handling Neo4j data with Apache Hop


October 26th -

Blazing Fast Graphs: Hands-on with Apache Arrow and Neo4j


November 2nd -

Graph EDA Using the Neo4j GDS Client