Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % *****************************************************************************
- % ** Succesor *
- % *****************************************************************************
- % succ(+UG, -PL, -SL) *
- % First, find normalized version of UG graph G. *
- % Then find all predecessor and successors pairs. *
- % SL is a successor of PL if: *
- % i) SL is f path: [v_1, v_2, .., v_n] and PL is f path: [u_1, u_2, .., u_m], *
- % ii) m <= n, *
- % iii) for i = 1..m, there is e(u_i, v_i) in G. *
- % *****************************************************************************
- succ(UG, PL, SL) :- normalize(UG, G), nPermuting(G), lsucc(G, PL, SL).
- lsucc(G, [], SL) :- fPath(SL, G).
- lsucc(G, [V], [U]) :- graphVtx(V, G), graphVtx(U, G), e(V, U, G).
- lsucc(G, [V], [U1|[U2|SL]]) :- graphVtx(V, G), graphVtx(U1, G), graphVtx(U2, G), e(V, U1, G), f(U1, U2, G), lsucc(G, [], [U2|SL]).
- lsucc(G, [V1|[V2|PL]], [U1|[U2|SL]]) :- graphVtx(V1, G), graphVtx(U1, G), graphVtx(V2, G), graphVtx(U2, G), f(V1, V2, G), f(U1, U2, G), e(V1, U1, G), lsucc(G, [V2|PL], [U2|SL])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement