next | previous | forward | backward | up | top | index | toc | directory | Macaulay 2 web site

Graph -- a class for graphs.

Description

This class represents simple graphs. This class extends HyperGraph and hence inherits all HyperGraph methods.
i1 : R = QQ[w,x,y,z];
i2 : G = graph(R, {{w,x},{w,y},{w,z},{y,z}});
i3 : vertices G

o3 = {w, x, y, z}

o3 : List
i4 : edges G

o4 = {{w, x}, {w, y}, {w, z}, {y, z}}

o4 : List
i5 : ring G

o5 = R

o5 : PolynomialRing
Like hypergraphs, graphs are associated with a polynomial ring whose variables are the vertices of the graph.

See also

Functions and methods returning an object of class Graph :

Methods that use an object of class Graph :

For the programmer

The object Graph is a type, with ancestor classes HyperGraph < HashTable < Thing.