neighbors/4¶
neighbors(+ Vertex, + Graph, - Vertices)*
Unify Vertices with the list of neighbors of vertex Vertex in Graph. If the vertice is not in the graph fail. In the next example:
?- neighbors(4,[1-[3,5],2-[4],3-[],
4-[1,2,7,5],5-[],6-[],7-[],8-[]],
NL).
NL = [1,2,7,5]