<graph>

<graph> encodes a graph, which is a collection of nodes, and arcs which connect the nodes. [19.1 Graphs and Digraphs]
Modulenets — Graphs, Networks, and Trees
Attributesatt.global (@xml:id, @n, @xml:lang, @xml:base, @xml:space) (att.global.rendition (@rend, @style, @rendition)) (att.global.linking (@corresp, @synch, @sameAs, @copyOf, @next, @prev, @exclude, @select)) (att.global.analytic (@ana)) (att.global.facs (@facs)) (att.global.change (@change)) (att.global.responsibility (@cert, @resp))
typedescribes the type of graph. Suggested values include: 1] undirected; 2] directed; 3] transitionNetwork; 4] transducer
Status Recommended
Datatype

<rng:ref name="data.enumerated"/>
data.enumerated
Suggested values include:
undirected
undirected graph
directed
directed graph
transitionNetwork
a directed graph with distinguished initial and final nodes
transducer
a transition network with up to two labels on each arc
Note

If type is specified as undirected, then the distinction between the to and from attributes of the arc tag is neutralized. Also, the adj attribute, rather than the adjFrom and adjTo attributes, should be used to encode pointers to the ends of the arcs. If type is specified as directed (or any other value which implies directionality), then the adjFrom and adjTo attributes should be used, instead of the adj attribute.

orderstates the order of the graph, i.e., the number of its nodes.
Status Optional
Datatype

<rng:ref name="data.count"/>
data.count
sizestates the size of the graph, i.e., the number of its arcs.
Status Optional
Datatype

<rng:ref name="data.count"/>
data.count
Member of
Contained by
May contain
Declaration

<rng:element name="graph">
 <rng:ref name="att.global.attributes"/>
 <rng:ref name="att.global.rendition.attributes"/>
 <rng:ref name="att.global.linking.attributes"/>
 <rng:ref name="att.global.analytic.attributes"/>
 <rng:ref name="att.global.facs.attributes"/>
 <rng:ref name="att.global.change.attributes"/>
 <rng:ref name="att.global.responsibility.attributes"/>
 <rng:optional>
  <rng:attribute name="type">
   <rng:choice>
    <rng:value>undirected</rng:value>
    <rng:value>directed</rng:value>
    <rng:value>transitionNetwork</rng:value>
    <rng:value>transducer</rng:value>
    <rng:data type="Name"/>
   </rng:choice>
  </rng:attribute>
 </rng:optional>
 <rng:optional>
  <rng:attribute name="order">
   <rng:ref name="data.count"/>
  </rng:attribute>
 </rng:optional>
 <rng:optional>
  <rng:attribute name="size">
   <rng:ref name="data.count"/>
  </rng:attribute>
 </rng:optional>
 <rng:group>
  <rng:optional>
   <rng:ref name="label"/>
   <rng:zeroOrMore>
    <rng:ref name="model.global"/>
   </rng:zeroOrMore>
  </rng:optional>
  <rng:choice>
   <rng:group>
    <rng:oneOrMore>
     <rng:ref name="node"/>
     <rng:zeroOrMore>
      <rng:ref name="model.global"/>
     </rng:zeroOrMore>
    </rng:oneOrMore>
    <rng:zeroOrMore>
     <rng:ref name="arc"/>
     <rng:zeroOrMore>
      <rng:ref name="model.global"/>
     </rng:zeroOrMore>
    </rng:zeroOrMore>
   </rng:group>
   <rng:group>
    <rng:oneOrMore>
     <rng:ref name="arc"/>
     <rng:zeroOrMore>
      <rng:ref name="model.global"/>
     </rng:zeroOrMore>
    </rng:oneOrMore>
    <rng:oneOrMore>
     <rng:ref name="node"/>
     <rng:zeroOrMore>
      <rng:ref name="model.global"/>
     </rng:zeroOrMore>
    </rng:oneOrMore>
   </rng:group>
  </rng:choice>
 </rng:group>
</rng:element>
element graph
{
   att.global.attributes,
   att.global.rendition.attributes,
   att.global.linking.attributes,
   att.global.analytic.attributes,
   att.global.facs.attributes,
   att.global.change.attributes,
   att.global.responsibility.attributes,
   attribute type
   {
      "undirected" | "directed" | "transitionNetwork" | "transducer" | xsd:Name
   }?,
   attribute order { data.count }?,
   attribute size { data.count }?,
   (
      ( label, model.global* )?,
      (
         ( ( node, model.global* )+, ( arc, model.global* )* )
       | ( ( arc, model.global* )+, ( node, model.global* )+ )
      )
   )
}
Example
<graph xml:id="cug1type="undirected"
 order="5size="4"
 rend="LABEL-PLACE bottom center NODE-FRAME none ARC solid line">

 <label>Airline Connections in Southwestern USA</label>
 <node xml:id="laxdegree="2">
  <label>LAX</label>
 </node>
 <node xml:id="lvgdegree="2">
  <label>LVG</label>
 </node>
 <node xml:id="phxdegree="3">
  <label>PHX</label>
 </node>
 <node xml:id="tusdegree="1">
  <label>TUS</label>
 </node>
 <node xml:id="cibdegree="0">
  <label>CIB</label>
 </node>
 <arc from="#laxto="#lvg"/>
 <arc from="#laxto="#phx"/>
 <arc from="#lvgto="#phx"/>
 <arc from="#phxto="#tus"/>
</graph>
Note

One or more nodes and zero or more arcs in any order.