<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">However, it never passes the &quot;degree == 0&quot; test, so I&#39;m assuming the<br>
graph is connected. If that is the case, why would I get this &quot;MST is<br>
a forest&quot; error? Or have I done something wrong with checking if the<br>
graph is connected (every vertex must be of degree at least 1)?<br>
<br></blockquote><div><br></div><div>It can still be disconnected with every vertex having degree at least one, e.g., a 4-vertex undirected graph with the following edges:<br></div><div><br></div><div>0--1</div><div>2--3</div>
<div><br></div><div>Jeff</div><div><br></div></div>