LISTSERV mailing list manager LISTSERV 16.5

Help for TEI-L Archives


TEI-L Archives

TEI-L Archives


TEI-L@LISTSERV.BROWN.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Monospaced Font

LISTSERV Archives

LISTSERV Archives

TEI-L Home

TEI-L Home

TEI-L  November 1991

TEI-L November 1991

Subject:

Encoding schemes for graphs, directed graphs and trees

From:

Terry Langendoen <[log in to unmask]>

Reply-To:

Terry Langendoen <[log in to unmask]>

Date:

Tue, 26 Nov 1991 19:58:09 MST

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (297 lines)

<tei.1>
<tei.header>
<file.description>
<title.statement>
<title>Encoding of graphs, digraphs and trees</title>
<statement.of.responsibility>
<role>author</role><name>D. Terence Langendoen</name>
</statement.of.responsibility>
<extent.statement></extent.statement>
<publication.statement>
Preliminary version.
</publication.statement>
<source.description>This material is based on <citn>Gary Chartrand and
Linda Lesniak, Graphs and digraphs, second ed., Monterey, CA: Wadsworth
Brooks/Cole Advanced Books and Software, 1986</citn>.
</source.description>
</file.description>
<revision.history>
<change.note>
<who>DTL</who>
<date>24 November 1991</date>
<what>began first draft</what>
<rev.number>0</rev.number>
</change.note>
<change.note>
<who>DTL</who>
<date>25-26 November 1991</date>
<what>revised and extended tree material</what>
<rev.number>1</rev.number>
</change.note>
<change.note>
<who>Steven Zepp</who>
<date>26 November, 1991</date>
<what>fixed header and typos; checked that document and dtd parses</what>
<rev.number>2</rev.number>
</change.note>
</revision.history>
</tei.header>
<text>
<front>
<acknowledgements>
<p>This material is based on <citn>Gary Chartrand and Linda Lesniak,
Graphs and digraphs, second ed., Monterey, CA: Wadsworth and
Brooks/Cole Advanced Books and Software, 1986</citn>.
<body>
<div1 name=section id=d1>
<head>Graphs
<div2 name=subsection id=d1.0>
<head>What graphs are
<p>A graph is a collection of <term>vertices</term> together with
a collection of pairs of those vertices, called <term>edges</term>.
Each vertex in an edge is said to be <term>incident</term> with that
edge, and the two vertices which make up an edge are said to be
<term>adjacent</term>. In the encoding scheme developed here<xref
target=d1.1>, <tag>vertex</tag> is used to indicate the vertices.
Associated with each vertex (i.e., enclosed within each
<tag>vertex</tag>) are pointers to the vertices which are adjacent to
that vertex; each pointer is represented by an empty <tag>adjac</tag>.
In a fully specified encoding of a graph, each edge occurs twice, once
for each vertex that is incident with it. A graph is an appropriate
data structure for representing linkages among data points, the points
corresponding to the vertices and the linkages corresponding to the
edges.
<div2 id=d1.1>
<head>Partial DTD for graphs
<xmp n=1><![ CDATA [
<!ELEMENT graph - - (vertex)+ >
<!ATTLIST graph %global.attributes;
                order NUMBER #IMPLIED
                size NUMBER #IMPLIED >
<!ELEMENT vertex - o (fs?, (adjac)*) >
<!ATTLIST vertex %global.attributes;
                 degree NUMBER #IMPLIED >
<!ELEMENT adjac - o EMPTY >
<!ATTLIST adjac %global.attributes;
                target IDREF #REQUIRED >
</xmp>]]
<div2 id=d1.2>
<head>Sample graph to be encoded
<p>In this sketch<xref target=ex2>, the edges are represented by dashed
lines, and the <q>+</q> sign, for indicating a 90 degree bend (which is
not significant, and is used simply to overcome the inability to draw
diagonal lines).
<xmp id=ex2 n=2><![ CDATA [
          +----u----+
          | |
          v---------w-----x y
</xmp>]]
<div2 id=d1.3>
<head>Encoding of sample graph
<xmp n=3><![ CDATA [
<graph n=1 id=g1 order=5 size=4>
<vertex n=u id=g1u degree=2>
  <adjac target=g1v>
  <adjac target=g1w>
<vertex n=v id=g1v degree=2>
  <adjac target=g1u>
  <adjac target=g1w>
<vertex n=w id=g1w degree=3>
  <adjac target=g1u>
  <adjac target=g1v>
  <adjac target=g1x>
<vertex n=x id=g1x degree=1>
  <adjac target=g1w>
<vertex n=y id=g1y degree=0>
</graph>
</xmp>]]
<div1 id=d2>
<head>Digraphs
<div2 id=d2.0>
<head>What digraphs are
<p>A <term>digraph</term> or <term>directed graph</term> differs from
a graph in that the linkage between the vertices is ordered. Each
linkage is called an <term>arc</term>. We also rename
<term>vertex</term> as <term>node</term>, since the corresponding
tag has a different content model and associated attributes.
In the illustrative diagram<xref target=ex5>, the ordering is
indicated by the symbols <q>></q> and <q><</q>.
<div2 id=d2.1>
<head>Partial DTD for digraphs
<xmp n=4>><![ CDATA [
v<!ELEMENT digraph - - (node)+ >
<!ATTLIST digraph %global.attributes;
                  order NUMBER #IMPLIED
                  size NUMBER #IMPLIED >
<!ELEMENT node - o (fs?, (adjac.to* & adjac.from*)) >
<!ATTLIST node %global.attributes;
               in.degree NUMBER #IMPLIED
               out.degree NUMBER #IMPLIED >
<!ELEMENT (adjac.to, adjac.from) - o EMPTY >
<!ATTLIST (adjac.to, adjac.from)
                     %global.attributes;
                     target IDREF #REQUIRED >
</xmp>]]
<div2 id=d2.2>
<head>Sample digraph to be encoded
<xmp id=ex5 n=5><![ CDATA [
          +-<--u--<-+
          | |
          v---->----w---->----x y
                    | |
                    +----<----+
</xmp>]]
<div2 id=d2.3>
<head>Encoding of sample digraph
<xmp n=6><![ CDATA [
<digraph n=1 id=d1 order=5 size=5>
<node n=u id=d1u in.degree=1 out.degree=1>
  <adjac.to target=d1v>
  <adjac.from target=d1w>
<node n=v id=d1v in.degree=1 out.degree=1>
  <adjac.from target=d1u>
  <adjac.to target=d1w>
<node n=w id=d1w in.degree=2 out.degree=2>
  <adjac.to target=d1u>
  <adjac.to target=d1x>
  <adjac.from target=d1v>
  <adjac.from target=d1x>
<node n=x id=d1x in.degree=1 out.degree=1>
  <adjac.to target=d1w>
  <adjac.from target=d1w>
<node n=y id=d1y in.degree=0 out.degree=0>
</digraph>
</xmp>]]
<div1 id=d3>
<head>Trees
<div2 id=d3.0>
<head>What trees are
<p>A tree is a connected acyclic graph. That is, it is possible to
follow a path from any vertex to any other vertex, but there are no
loops. A rooted tree is a digraph based on a tree; that is, the
arcs in the digraph correspond to the edges of a tree such that there
is exactly one node (called the <term>root</term>) for which there is
a path (using the arcs) from that node to all other nodes. For TEI
purposes, we may ignore all trees except for rooted trees, and hence
we shall use <tag>tree</tag> for rooted trees. A node adjacent
to a given node is called a <term>child</term> of that node, and the
node adjacent from a given node is called its <term>parent</term>.
A node with both a parent and children is called an <term>internal
node</term>, for which we use <tag>i.node</tag>. A node with no
children is called a <term>leaf</term>. If the children of a node
are ordered, then we say that that node is ordered. If all the nodes
of a tree are ordered, then we say that the tree is an <term>ordered
tree</term>. If some of the nodes of a tree are ordered and others are
not, then the tree is a <term>partially ordered tree</term>. The
ordering of nodes and trees may be specified by an attribute. We
assume that trees are ordered by default. Finally, we permit nodes
to be specified as following other nodes, which (under normal ordering
circumstances) they would be assumed to precede, giving rise to crossing
arcs. An example is given below<xref target=ex10>.
<p>In <citn>TEI AI1 W10</citn> a DTD for a different formalization of
trees is given. The <tag>tree</tag> there should be renamed
<tag>h.tree</tag> or some such. The <tag>shrub</tag> should also be
retained for its usefulness for special purposes, incorporating a
change suggested by Gary Simons at the Myrdal meeting.
<div2 id=d3.1>
<head>Partial DTD for trees
<xmp n=7><![ CDATA [
<!ELEMENT tree - - (root & (leaf+ & i.node*)*) >
<!ATTLIST tree %global.attributes;
               ordered (yes | no) yes
               order NUMBER #IMPLIED
               size NUMBER #IMPLIED >
<!ELEMENT root - o (fs?, (child)*) >
<!ELEMENT i.node - o (fs?, (child)+) >
<!ATTLIST root %global.attributes;
               ordered (yes | no) yes
               out.degree NUMBER #IMPLIED >
<!ATTLIST i.node %global.attributes;
                 ordered (yes | no) yes
                 out.degree NUMBER #IMPLIED
                 parent IDREF #IMPLIED
                 follow IDREF #IMPLIED >
<!ELEMENT leaf - o (fs)? >
<!ATTLIST leaf %global.attributes;
               parent IDREF #IMPLIED
               follow IDREF #IMPLIED >
<!ELEMENT child - o EMPTY >
<!ATTLIST child %global.attributes;
                target IDREF #REQUIRED >
</xmp>]]
<div2 id=d3.2>
<head>First sample tree to be encoded
<p>In this sketch<xref target=ex8>, we leave out the arrows indicating
directionality, on the assumption that the root is at the top, and that
the direction of the arcs is from root to leaf. We also assume that
this tree is partially ordered, with the internal node v ordered and
the root node u unordered (indicated by double broken lines).
<xmp id=ex8 n=8><![ CDATA [
 
          +====u====+
          | |
     +----v----+ w
     | | |
     V V V
     x y z
 
</xmp>]]
<div2 id=d3.3>
<head>Encoding of first sample tree
<xmp n=9><![ CDATA [
<tree n=1 id=t1 ordered=no order=6 size=5>
<leaf n=x id=t1x parent=t1v>
<leaf n=y id=t1y parent=t1v>
<leaf n=z id=t1z parent=t1v>
<i.node n=v id=t1v parent=t1u ordered=yes out.degree=3>
  <child target=t1x>
  <child target=t1y>
  <child target=t1z>
<leaf n=w id=t1w parent=t1u>
<root n=u id=t1u out.degree=2>
  <child target=t1v>
  <child target=t1w>
</tree>
</xmp>]]
<div2 id=d3.4>
<head>Second sample tree to be encoded
<p>In this illustration<xref refid=ex10>, we assume that the tree is
ordered and that the node PT follows the node PN.
<xmp id=ex10 n=10><![ CDATA [
 
          +----VP---+
          | |
          | +----x----+
          | | | |
          | | PN |
     +----VB---+ | PT
    VB | |
     | | |
   look them up
 
</xmp>]]
<div2 id=d3.5>
<head>Encoding of second sample tree
<xmp n=11><![ CDATA [
<tree n=2 id=t2 order=8 size=7>
<leaf n=look id=t2look parent=t2VB2>
<leaf n=them id=t2them parent=t2PN>
<leaf n=up id=t2up parent=t2PT>
<i.node n=VB id=t2VB2 parent=t2VB1 out.degree=1>
  <child target=t2look>
<i.node n=PN id=t2PN parent=t2VP out.degree=1>
  <child target=t2them>
<i.node n=PT id=t2PT parent=t2VB1 follow=t2PN out.degree=1>
  <child target=t2up>
<i.node n=VB id=t2VB1 parent=t2VP out.degree=2>
  <child target=t2VB2>
  <child target=t2PT>
<root n=VP id=t2VP out.degree=2>
  <child target=t2VB1>
  <child target=t2PN>
</tree>
</xmp>
</body>
</text>
</tei.1>

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
January 2001
December 2000
November 2000
October 2000
September 2000
August 2000
July 2000
June 2000
May 2000
April 2000
March 2000
February 2000
January 2000
December 1999
November 1999
October 1999
September 1999
August 1999
July 1999
June 1999
May 1999
April 1999
March 1999
February 1999
January 1999
December 1998
November 1998
October 1998
September 1998
August 1998
July 1998
June 1998
May 1998
April 1998
March 1998
February 1998
January 1998
December 1997
November 1997
October 1997
September 1997
August 1997
July 1997
June 1997
May 1997
April 1997
March 1997
February 1997
January 1997
December 1996
November 1996
October 1996
September 1996
August 1996
July 1996
June 1996
May 1996
April 1996
March 1996
February 1996
January 1996
December 1995
November 1995
October 1995
September 1995
August 1995
July 1995
June 1995
May 1995
April 1995
March 1995
February 1995
January 1995
December 1994
November 1994
October 1994
September 1994
August 1994
July 1994
June 1994
May 1994
April 1994
March 1994
February 1994
January 1994
December 1993
November 1993
October 1993
September 1993
August 1993
July 1993
June 1993
May 1993
April 1993
March 1993
February 1993
January 1993
December 1992
November 1992
October 1992
September 1992
August 1992
July 1992
June 1992
May 1992
April 1992
March 1992
February 1992
January 1992
December 1991
November 1991
October 1991
September 1991
August 1991
July 1991
June 1991
May 1991
April 1991
March 1991
February 1991
January 1991
December 1990
November 1990
October 1990
September 1990
August 1990
July 1990
June 1990
April 1990
March 1990
February 1990
January 1990

ATOM RSS1 RSS2



LISTSERV.BROWN.EDU

CataList Email List Search Powered by the LISTSERV Email List Manager