Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 7ebd25ac536d248d499a3ce2acda963a > files > 1828

Macaulay2-1.3.1-8.fc15.i686.rpm

<?xml version="1.0" encoding="utf-8" ?>  <!-- for emacs: -*- coding: utf-8 -*- -->
<!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"	 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>getEdgeIndex -- finds the index of an edge in a HyperGraph</title>
<link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/>
</head>
<body>
<table class="buttons">
  <tr>
    <td><div><a href="_get__Good__Leaf.html">next</a> | <a href="_get__Edge.html">previous</a> | <a href="_get__Good__Leaf.html">forward</a> | <a href="_get__Edge.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div>

    </td>
  </tr>
</table>
<hr/>
<div><h1>getEdgeIndex -- finds the index of an edge in a HyperGraph</h1>
<div class="single"><h2>Synopsis</h2>
<ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>n = getEdgeIndex(H,E)</tt><br/><tt>n = getEdgeIndex(H,M)</tt></div>
</dd></dl>
</div>
</li>
<li><div class="single">Inputs:<ul><li><span><tt>H</tt>, <span>a <a href="___Hyper__Graph.html">hypergraph</a></span></span></li>
<li><span><tt>E</tt>, <span>a <a href="../../Macaulay2Doc/html/___List.html">list</a></span>, of vertices</span></li>
<li><span><tt>M</tt>, <span>a <a href="../../Macaulay2Doc/html/___Ring__Element.html">ring element</a></span>, a monomial that is the product of vertices</span></li>
</ul>
</div>
</li>
<li><div class="single">Outputs:<ul><li><span><tt>n</tt>, <span>an <a href="../../Macaulay2Doc/html/___Z__Z.html">integer</a></span>, the index of <tt>E</tt> as an edge of <tt>H</tt>. If <tt>E</tt> is not in <tt>H</tt>, then -1 is returned.</span></li>
</ul>
</div>
</li>
</ul>
</div>
<div class="single"><h2>Description</h2>
<div><div>This function returns the index of the edge of the (hyper)graph, where the ordering is determined by the internal ordering of the edges. Note that the internal order of the edges may not be preserved by methods that change the hypergraph (i.e., <a href="_induced__Hyper__Graph.html" title="returns the induced subgraph of a (hyper)graph">inducedHyperGraph</a>, <a href="_change__Ring.html" title="replaces vertices with variables of a different ring">changeRing</a>, <a href="_hyper__Graph.html" title="constructor for HyperGraph">hyperGraph(MonomialIdeal)</a>, etc.).</div>
<table class="examples"><tr><td><pre>i1 : S = QQ[z_1..z_8];</pre>
</td></tr>
<tr><td><pre>i2 : h = hyperGraph {z_2*z_3*z_4,z_6*z_8,z_7*z_5,z_1*z_6*z_7,z_2*z_4*z_8}

o2 = HyperGraph{edges => {{z , z , z }, {z , z }, {z , z , z }, {z , z , z }, {z , z }}}
                            2   3   4     5   7     1   6   7     2   4   8     6   8
                ring => S
                vertices => {z , z , z , z , z , z , z , z }
                              1   2   3   4   5   6   7   8

o2 : HyperGraph</pre>
</td></tr>
<tr><td><pre>i3 : edges h

o3 = {{z , z , z }, {z , z }, {z , z , z }, {z , z , z }, {z , z }}
        2   3   4     5   7     1   6   7     2   4   8     6   8

o3 : List</pre>
</td></tr>
<tr><td><pre>i4 : getEdgeIndex (h,{z_2,z_4,z_8})  -- although entered last, edge is internally stored in 4th spot (counting begins at 0)

o4 = 3</pre>
</td></tr>
<tr><td><pre>i5 : getEdge(h,3)

o5 = {z , z , z }
       2   4   8

o5 : List</pre>
</td></tr>
<tr><td><pre>i6 : getEdgeIndex (h,{z_1,z_2}) -- not in the edge list

o6 = -1</pre>
</td></tr>
</table>
</div>
</div>
<div class="single"><h2>See also</h2>
<ul><li><span><a href="_get__Edge.html" title="gets the n-th edge in a (hyper)graph">getEdge</a> -- gets the n-th edge in a (hyper)graph</span></li>
<li><span><a href="_is__Edge.html" title="determines if an edge is in a (hyper)graph">isEdge</a> -- determines if an edge is in a (hyper)graph</span></li>
</ul>
</div>
<div class="waystouse"><h2>Ways to use <tt>getEdgeIndex</tt> :</h2>
<ul><li>getEdgeIndex(HyperGraph,List)</li>
<li>getEdgeIndex(HyperGraph,RingElement)</li>
</ul>
</div>
</div>
</body>
</html>