Documentation
¶
Overview ¶
Package paths provides APOC advanced path operations.
This package implements all apoc.paths.* functions for advanced path finding and analysis (plural of path package).
Index ¶
- Variables
- func Count(start, end *Node, relType string, maxLength int) int
- func Distance(start, end *Node, relType string) int
- func Exists(start, end *Node, relType string, maxLength int) bool
- type Node
- type Path
- func All(start, end *Node, relType string, maxLength int) []*Path
- func Cycles(start *Node, relType string, maxLength int) []*Path
- func Disjoint(start, end *Node, relType string, maxLength, count int) []*Path
- func EdgeDisjoint(start, end *Node, relType string, maxLength, count int) []*Path
- func Elementary(start, end *Node, relType string, maxLength int) []*Path
- func Eulerian(start, end *Node) []*Path
- func Hamiltonian(nodes []*Node, start, end *Node) []*Path
- func KShortest(start, end *Node, relType string, maxLength, k int) []*Path
- func Longest(start, end *Node, relType string, maxLength int) []*Path
- func Merge(paths []*Path) *Path
- func Reverse(path *Path) *Path
- func Shortest(start, end *Node, relType string, maxLength int) []*Path
- func Simple(start, end *Node, relType string, maxLength int) []*Path
- func Slice(path *Path, start, end int) *Path
- func WithLength(start, end *Node, relType string, length int) []*Path
- func WithinLength(start, end *Node, relType string, minLength, maxLength int) []*Path
- type Relationship
Constants ¶
This section is empty.
Variables ¶
var Storage storage.Storage = storage.NewInMemoryStorage()
Storage is the interface for database operations.
Functions ¶
func Count ¶
Count counts paths between nodes.
Example:
apoc.paths.count(start, end, 'KNOWS', 10) => count
Types ¶
type Node ¶
Node represents a graph node.
type Path ¶
Path represents a path through the graph.
func All ¶
All finds all paths between two nodes.
Example:
apoc.paths.all(start, end, 'KNOWS', 5) => all paths
func Cycles ¶
Cycles finds all cycles starting from a node.
Example:
apoc.paths.cycles(start, 'KNOWS', 10) => cycles
func Disjoint ¶
Disjoint finds node-disjoint paths.
Example:
apoc.paths.disjoint(start, end, 'KNOWS', 10, 3) => disjoint paths
func EdgeDisjoint ¶
EdgeDisjoint finds edge-disjoint paths.
Example:
apoc.paths.edgeDisjoint(start, end, 'KNOWS', 10, 3) => edge-disjoint paths
func Elementary ¶
Elementary finds elementary paths (no repeated edges).
Example:
apoc.paths.elementary(start, end, 'KNOWS', 10) => elementary paths
func Eulerian ¶
Eulerian finds Eulerian paths (visiting all edges once).
Example:
apoc.paths.eulerian(start, end) => Eulerian paths
func Hamiltonian ¶
Hamiltonian finds Hamiltonian paths (visiting all nodes once).
Example:
apoc.paths.hamiltonian(nodes, start, end) => Hamiltonian paths
func KShortest ¶
KShortest finds k shortest paths.
Example:
apoc.paths.kShortest(start, end, 'KNOWS', 10, 5) => 5 shortest paths
func Longest ¶
Longest finds longest paths between two nodes.
Example:
apoc.paths.longest(start, end, 'KNOWS', 10) => longest paths
func Merge ¶
Merge merges multiple paths into one.
Example:
apoc.paths.merge([path1, path2]) => merged path
func Shortest ¶
Shortest finds shortest paths between two nodes.
Example:
apoc.paths.shortest(start, end, 'KNOWS', 10) => shortest paths
func Simple ¶
Simple finds simple paths (no repeated nodes).
Example:
apoc.paths.simple(start, end, 'KNOWS', 10) => simple paths
func WithLength ¶
WithLength finds paths of specific length.
Example:
apoc.paths.withLength(start, end, 'KNOWS', 3) => paths of length 3
type Relationship ¶
type Relationship = storage.Relationship
Relationship represents a graph relationship.