Macaulay2 » Documentation
Packages » Graphs :: nonneighbors
next | previous | forward | backward | up | index | toc

nonneighbors -- returns the non-neighbors of a vertex in a graph

Synopsis

Description

The non-neighbors of a vertex v are all the vertexSet of G that are not adjacent to v. That is, if u is a non-neighbor to v, {u,v} is not an edge in G.

i1 : G = graph({1,2,3,4},{{2,3},{3,4}});
i2 : nonneighbors(G,2)

o2 = set {1, 4}

o2 : Set

See also

Ways to use nonneighbors :

For the programmer

The object nonneighbors is a method function.