<?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>isConnected -- determines if a (hyper)graph is connected</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_is__Connected__Graph.html">next</a> | <a href="_is__C__M.html">previous</a> | <a href="_is__Connected__Graph.html">forward</a> | <a href="_is__C__M.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>isConnected -- determines if a (hyper)graph is connected</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>b = isConnected H</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> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><tt>b</tt>, <span>a <a href="../../Macaulay2Doc/html/___Boolean.html">Boolean value</a></span>, <tt>true</tt> if <tt>H</tt> is connected, <tt>false</tt> otherwise</span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div><p>This function checks if the given (hyper)graph <tt>H</tt> is connected. A (hyper)graph is said to be connected if it has exactly one connected component.</p> <p>Isolated vertices do not count as connected components and will not make this method return <tt>false</tt>. This is in contrast to <a href="_is__Connected__Graph.html" title="determines if a graph is connected">isConnectedGraph</a> in which isolated vertices form their own connected components. See the <a href="___Connected_sp__Components_sp__Tutorial.html" title="clarifying the difference between graph and hypergraph components">Connected Components Tutorial</a> for more information.</p> <div/> <table class="examples"><tr><td><pre>i1 : S = QQ[a..e];</pre> </td></tr> <tr><td><pre>i2 : G = graph {a*b,b*c,c*d,d*e,a*e} -- the 5-cycle (connected) o2 = Graph{edges => {{a, b}, {b, c}, {c, d}, {a, e}, {d, e}}} ring => S vertices => {a, b, c, d, e} o2 : Graph</pre> </td></tr> <tr><td><pre>i3 : H = graph {a*b,b*c,c*a,d*e} -- a 3-cycle and a disjoint edge (not connected) o3 = Graph{edges => {{a, b}, {a, c}, {b, c}, {d, e}}} ring => S vertices => {a, b, c, d, e} o3 : Graph</pre> </td></tr> <tr><td><pre>i4 : isConnected G o4 = true</pre> </td></tr> <tr><td><pre>i5 : isConnected H o5 = false</pre> </td></tr> </table> <p>In the following example, the graph <tt>G</tt> has the isolated vertex <tt>d</tt>. As <tt>d</tt> is not considered to be in any connected component, this graph is connected.</p> <div/> <table class="examples"><tr><td><pre>i6 : S = QQ[a,b,c,d];</pre> </td></tr> <tr><td><pre>i7 : G = graph {a*b,b*c} o7 = Graph{edges => {{a, b}, {b, c}}} ring => S vertices => {a, b, c, d} o7 : Graph</pre> </td></tr> <tr><td><pre>i8 : isolatedVertices G o8 = {d} o8 : List</pre> </td></tr> <tr><td><pre>i9 : isConnected G o9 = true</pre> </td></tr> </table> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="___Connected_sp__Components_sp__Tutorial.html" title="clarifying the difference between graph and hypergraph components">Connected Components Tutorial</a> -- clarifying the difference between graph and hypergraph components</span></li> <li><span><a href="_is__Connected__Graph.html" title="determines if a graph is connected">isConnectedGraph</a> -- determines if a graph is connected</span></li> <li><span><a href="_connected__Components.html" title="returns the connected components of a hypergraph">connectedComponents</a> -- returns the connected components of a hypergraph</span></li> <li><span><a href="_isolated__Vertices.html" title="returns all vertices not contained in any edge">isolatedVertices</a> -- returns all vertices not contained in any edge</span></li> <li><span><a href="_num__Connected__Components.html" title="returns the number of connected components in a (hyper)graph">numConnectedComponents</a> -- returns the number of connected components in a (hyper)graph</span></li> </ul> </div> <div class="waystouse"><h2>Ways to use <tt>isConnected</tt> :</h2> <ul><li>isConnected(HyperGraph)</li> </ul> </div> </div> </body> </html>