### sequence function: find-path-between

description:
find-path-between(ket, sp)
find the path between the ket, and the given superposition
currently, potentially quite slow! But this is fixable.
examples:
load fred-sam-friends.sw
find-inverse[friends]
find-path-between(|Fred>, |Sam>)
|op: friends> . |op: inverse-friends>
find-path-between(|Fred>, |Julie>)
|op: friends> . |op: inverse-friends> . |op: friends>
learn-map[10,10]
find-path-between(|grid: 1: 1>, |grid: 3: 7>)
|op: E> . |op: E> . |op: E> . |op: E> . |op: SE> . |op: SE>
load george.sw
find (*) #=> find-path-between(|person: George>, |_self>)
find |person: Andrew>
|op: friends>
find (|person: Sarah> + |person: David> + |person: Frank>)
|op: family>
find (|person: Emily> + |person: Fred>)
|op: family-and-friends>
find (|person: Frank> + |person: Emily>)
|op: siblings>
future:
optimize it with Dijkstra's algorithm
(since current algorithm is horrible!)
make it work with path-ways between sequences too.
see also:
finding-a-path-between-early-us-presidents worked example

Home