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