<?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>inducedHyperGraph -- returns the induced subgraph of a (hyper)graph</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_is__Bipartite.html">next</a> | <a href="_induced__Graph_lp..._cm_sp__Original__Ring_sp_eq_gt_sp..._rp.html">previous</a> | <a href="_is__Bipartite.html">forward</a> | <a href="_induced__Graph_lp..._cm_sp__Original__Ring_sp_eq_gt_sp..._rp.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>inducedHyperGraph -- returns the induced subgraph of a (hyper)graph</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>h = inducedHyperGraph(H, L)</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>L</tt>, <span>a <a href="../../Macaulay2Doc/html/___List.html">list</a></span>, of vertices (i.e. variables in the ring of <tt>H</tt>)</span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><tt>h</tt>, <span>a <a href="___Hyper__Graph.html">hypergraph</a></span>, the induced subgraph of <tt>H</tt> whose edges are contained in <tt>L</tt></span></li> </ul> </div> </li> <li><div class="single"><a href="../../Macaulay2Doc/html/_using_spfunctions_spwith_spoptional_spinputs.html">Optional inputs</a>:<ul><li><span><a href="_induced__Graph_lp..._cm_sp__Original__Ring_sp_eq_gt_sp..._rp.html">OriginalRing => ...</a>, -- use OriginalRing inside inducedGraph or inducedHyperGraph</span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div><p>This function returns the induced subgraph of a (hyper)graph on a specified set of vertices. This function enables the user to create subgraphs of the original (hyper)graph.</p> <p>The default option is for the ring of the induced subgraph to contain only variables in <tt>L</tt>. Then the current ring must be changed before working with the induced subgraph. We use this setup to avoid having a lot of isolated vertices in the induced (hyper)graph. However, one can set the option <a href="___Original__Ring.html" title="optional argument for inducedHyperGraph">OriginalRing</a> to <tt>true</tt> if one wants to give the induced (hyper)graph the same ring as the original (hyper)graph.</p> <div>Note: Since <a href="___Graph.html" title="a class for graphs">Graph</a> is a <a href="../../Macaulay2Doc/html/___Type.html" title="the class of all types">Type</a> of <a href="___Hyper__Graph.html" title="a class for hypergraphs">HyperGraph</a>, <tt>inducedHyperGraph</tt> can be used for graphs, but the output is a <a href="___Hyper__Graph.html" title="a class for hypergraphs">HyperGraph</a>. If one prefers to have a graph returned instead, use <a href="_induced__Graph.html" title="returns the induced subgraph of a graph">inducedGraph</a>.</div> <table class="examples"><tr><td><pre>i1 : R = QQ[a,b,c,d,e];</pre> </td></tr> <tr><td><pre>i2 : G = graph {a*b,b*c,c*d,d*e,e*a} -- graph of the 5-cycle o2 = Graph{edges => {{a, b}, {b, c}, {c, d}, {a, e}, {d, e}}} ring => R vertices => {a, b, c, d, e} o2 : Graph</pre> </td></tr> <tr><td><pre>i3 : H1 = inducedHyperGraph(G,{b,c,d,e}) o3 = HyperGraph{edges => {{b, c}, {c, d}, {d, e}}} ring => QQ[b, c, d, e] vertices => {b, c, d, e} o3 : HyperGraph</pre> </td></tr> <tr><td><pre>i4 : H2 = inducedHyperGraph(G,{a,b,d,e}) o4 = HyperGraph{edges => {{a, b}, {a, e}, {d, e}}} ring => QQ[a, b, d, e] vertices => {a, b, d, e} o4 : HyperGraph</pre> </td></tr> <tr><td><pre>i5 : use ring H1 o5 = QQ[b, c, d, e] o5 : PolynomialRing</pre> </td></tr> <tr><td><pre>i6 : inducedHyperGraph(H1,{c,d,e}) o6 = HyperGraph{edges => {{c, d}, {d, e}}} ring => QQ[c, d, e] vertices => {c, d, e} o6 : HyperGraph</pre> </td></tr> <tr><td><pre>i7 : use ring G o7 = R o7 : PolynomialRing</pre> </td></tr> <tr><td><pre>i8 : inducedHyperGraph(G,{b,c,d,e},OriginalRing=>true) --H1 but in bigger ring o8 = HyperGraph{edges => {{b, c}, {c, d}, {d, e}}} ring => R vertices => {a, b, c, d, e} o8 : HyperGraph</pre> </td></tr> </table> <div>Equivalently, one can use <a href="_change__Ring.html" title="replaces vertices with variables of a different ring">changeRing</a> to move the induced hypergraph back into the original ring.</div> <table class="examples"><tr><td><pre>i9 : R = QQ[a,b,c,d,e];</pre> </td></tr> <tr><td><pre>i10 : G = graph {a*b,b*c,c*d,d*e,e*a} -- graph of the 5-cycle o10 = Graph{edges => {{a, b}, {b, c}, {c, d}, {a, e}, {d, e}}} ring => R vertices => {a, b, c, d, e} o10 : Graph</pre> </td></tr> <tr><td><pre>i11 : H = inducedHyperGraph(G,{b,c,d}) o11 = HyperGraph{edges => {{b, c}, {c, d}}} ring => QQ[b, c, d] vertices => {b, c, d} o11 : HyperGraph</pre> </td></tr> <tr><td><pre>i12 : changeRing(H,R,{b,c,d}) o12 = HyperGraph{edges => {{d, c}, {c, b}} } ring => R vertices => {a, b, c, d, e} o12 : HyperGraph</pre> </td></tr> </table> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="_change__Ring.html" title="replaces vertices with variables of a different ring">changeRing</a> -- replaces vertices with variables of a different ring</span></li> <li><span><a href="_delete__Edges.html" title="returns the (hyper)graph with specified edges removed">deleteEdges</a> -- returns the (hyper)graph with specified edges removed</span></li> <li><span><a href="_induced__Graph.html" title="returns the induced subgraph of a graph">inducedGraph</a> -- returns the induced subgraph of a graph</span></li> </ul> </div> <div class="waystouse"><h2>Ways to use <tt>inducedHyperGraph</tt> :</h2> <ul><li>inducedHyperGraph(HyperGraph,List)</li> </ul> </div> </div> </body> </html>