一键导入
find-paths-in-falkordb
Use algo.SPpaths/algo.SSpaths procedures and variable-length patterns to find paths in read queries
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use algo.SPpaths/algo.SSpaths procedures and variable-length patterns to find paths in read queries
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Search text properties with the db.idx.fulltext.queryNodes procedure when a full-text index exists
Write predicates that let FalkorDB use indexes and avoid full scans in read queries
Prefix read queries with CYPHER parameters for plan caching and safer value handling
Find nearest-neighbor nodes with the db.idx.vector.queryNodes procedure when a vector index exists
| name | Find paths in FalkorDB |
| description | Use algo.SPpaths/algo.SSpaths procedures and variable-length patterns to find paths in read queries |
Traverse relationships with variable-length patterns and FalkorDB's path-finding functions and procedures.
Use the algo.SPpaths procedure to find the shortest path between two specific nodes (single pair),
and algo.SSpaths for shortest paths from one source to all reachable nodes. Use variable-length
relationship patterns with shortestPath/allShortestPaths only for simple unweighted pattern matching.
MATCH (a:City {name: 'Paris'}), (b:City {name: 'Berlin'})
CALL algo.SPpaths({sourceNode: a, targetNode: b, relTypes: ['ROAD'], relDirection: 'outgoing', pathCount: 1})
YIELD path
RETURN [n IN nodes(path) | n.name] AS route
algo.SPpaths() for "shortest path between X and Y" questions; it is FalkorDB's dedicated
single-pair shortest-path procedure.sourceNode, targetNode, relTypes (array), relDirection (outgoing | incoming | both),
pathCount (1 = single shortest, 0 = all shortest, n = up to n paths).weightProp (e.g. 'dist', 'time') to minimize a weighted property, and costProp/maxCost
to constrain total cost. It YIELDs path, pathWeight, and pathCost.algo.SSpaths() (single source) for all shortest paths from one node to all reachable destinations.-[:TYPE*minHops..maxHops]->; bound the hops to avoid expensive traversals.shortestPath(...)/allShortestPaths(...) are unweighted pattern helpers for simple cases.-[:TYPE]- for undirected traversal and <-[:TYPE]- to follow relationships in reverse.