G = graph(R,E)
G = graph(I)
G = graph(J)
G = graph(E)
G = graph(H)
The function graph is a constructor for Graph, a type of HyperGraph. The user can input a graph in a number of different ways, which we describe below. The information describing the graph is stored in a hash table.
For the first possibility, the user inputs a polynomial ring, which specifies the vertices of graph, and a list of the edges of the graph. The edges are represented as lists.
|
|
|
As long as the edge list is not empty, the ring can be omitted. When a ring is not passed to the constructor, the underlying hypergraph takes its ring from the first variable found.
|
|
|
|
|
The list of edges could also be entered as a list of square-free quadratic monomials.
|
|
|
Another option for defining an graph is to use an ideal or monomialIdeal.
|
|
|
|
|
A graph can be made from any hypergraph whose edges are all of size two.
|
|
|
Not all graph constructors are able to make the empty graph, that is, the graph with no edges. Specifically, the constructors that take only a list cannot make the empty graph because the underlying ring is not given. To define the empty graph, give an explicit polynomial ring, or give the (monomial) ideal.
|
|
|
|
The object graph is a method function.