Skip to content

Commit

Permalink
Bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhghomon committed Jan 3, 2025
1 parent 0c31c15 commit c226b16
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/content/doc-surrealql/datamodel/idioms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1205,17 +1205,14 @@ RELATE person:acquaintance3->knows->person:star;

This representation of this small network of friends allows us to visualize the issues that these three algorithms solve. Using `+path` will output all of the possible paths from `person:you`, `+collect` will collect all of the records in this network, and `+shortest=person:star` will find the shortest path.

```
┌───►person:acquaintance1
┌───────► person:friend1 │
│ │ │
│ │ ┼───►person:acquaintance2 person:star
person:you │ │ ▲
│ ▼ │ │
└────────► person:friend2──────┤ │
│ │
└───►person:acquaintance3──────────┘
```
┌───────► person:friend1 ┌───►person:acquaintance1
│ │ │
│ │ ┼───►person:acquaintance2 person:star
person:you │ │ ▲
│ ▼ │ │
└────────► person:friend2────┤ │
└───►person:acquaintance3─────────┘
```

To use these algorithms, follow them with the path that should be followed, in this case `->knows->person`.
Expand Down

0 comments on commit c226b16

Please sign in to comment.