The neighbors of a vertex v are all the vertexSet of G adjacent to v. That is, if u is a neighbor to v, {v,u} is an edge of G.
i1 : G = graph({1,2,3,4},{{2,3},{3,4}}); |
i2 : neighbors(G,3) o2 = set {2, 4} o2 : Set |
The object neighbors is a method function.