# Graph and GraphObject

The <#13368#>Graph<#13368#> class and its descendants provide the programmer with 12 different types of graph and hypergraph objects. The following three types of restriction of a graph's edge set determine the graph classes. <#13331#>

1.
  <#13332#>Multiset or not?<#13332#> This determines whether the graph is a multigraph or a simple graph.
2.
  <#13334#>Cardinality of each edge equals 2?<#13334#> This determines whether the graph is a graph (also called <#13335#>binary graph<#13335#>) or a hypergraph.
3.
  <#13337#>Directed, Undirected, or Mixed?<#13337#> In directed graphs, every edge must consist of a <#13369#>Sequence<#13369#> of vertices. In undirected graphs, each edge must consist of a <#13370#>Set<#13370#> of vertices. LINK also offers the option of defining <#13338#>mixed graphs<#13338#>, in which both directed and undirected edges may occur in the same graph.

<#13331#> Restrictions~#it:ms#13341> and #it:dum#13342> are implemented using specific objects of the <#13371#>Collection<#13371#> hierarchy as the <#13372#>Vertex<#13372#> sets of <#13373#>Edges<#13373#>. Restriction~#it:cd#13343> is implemented with simple test. Each of the classes determined by these criteria is described in detail in Section~#sec:gh#13344>. <#13374#>Graphs<#13374#>, <#13375#>Vertices<#13375#>, and <#13376#>Edges<#13376#> have some commonality in that they each have character string names and may have other attributes, and in that they each are ``owned'' by a <#13377#>Graph<#13377#> object. <#13378#>Graph<#13378#> objects may be owned by themselves, or by a parent <#13379#>Graph<#13379#> through the subgraph mechanism (see Section~#sec:subgraphs#13345>). The <#13380#>GraphObject<#13380#> class exists as an abstract parent to all three classes to avoid redefinition of common operations. It contains methods which the <#13381#>Graph<#13381#> classes call access and modify attributes, but there is a more natural for the LINK programmer to use an alternate method, which will be described in Section~#sec:attr#13346>.