Re: connected?

dvanhorn <[email protected]>
Newsgroups gmane.org.ballistichelmet.lambda
Message-ID <[email protected]>
dvanhorn wrote:
> David Van Horn wrote:
>>Aaron S. Hawley wrote:
>>>start at some arbitrary element in S.
>>>find it's connected set and "color" (mark as visited) each.
>>>iterate through all elements in S verifying that they are present in the
>>>connected set ("colored").
>>
>>This sounds right too.  You visit each element and accumulate the set of
>>elements it immediately touches.  If s is connected, you'll generate the same
>>set s by visiting all elements in s.
> 
> Nope, that ain't right.  Consider (connected? '((1 1) (1 2) (7 8) (8 8)))
> 
> You color them all, but they are not connected.  Mine gets this right.  Who
> would've thought set theory is your friend?

Sorry, I think you have it right originally, it's only my interpretation that
was wrong.  You generate the set connected to an arbitrary element by any
number of touching elements and compare that to the original set.  This is
exactly what I do.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.