The vertices adjacent to vertex V are called the neighbors of V. The neighbors of a list of vertices L are those vertices that are not in L and are adjacent to a vertex in L.
i1 : R = QQ[a..f]; |
i2 : G = graph {a*b, a*c, a*d, d*e, d*f}; |
i3 : neighbors(G,a) o3 = {b, c, d} o3 : List |
i4 : neighbors(G,0) o4 = {b, c, d} o4 : List |
i5 : neighbors(G,{a,d}) o5 = {b, c, e, f} o5 : List |
i6 : neighbors(G,{0,3}) o6 = {b, c, e, f} o6 : List |
The object neighbors is a method function.