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

vertexSet -- Returns the vertices of a graph or digraph

Synopsis

Description

The vertices of a graph are just singletons that can be indexed by numbers, letters, or even in some cases something as exotic as a monomial. These form the base of a graph; the edges are 2 member subsets of the vertex set of a graph.

i1 : D = digraph({{1,2},{2,1},{3,1}},EntryMode=>"edges");
i2 : vertexSet D;
i3 : G = completeGraph 4;
i4 : vertexSet G

o4 = {0, 1, 2, 3}

o4 : List
i5 : A = adjacencyMatrix G;

              4       4
o5 : Matrix ZZ  <-- ZZ
i6 : graph({a,b,c,d}, A)

o6 = Graph{a => {b, c, d}}
           b => {a, c, d}
           c => {a, b, d}
           d => {a, b, c}

o6 : Graph

See also

Ways to use vertexSet :

For the programmer

The object vertexSet is a method function.