title: Need to create a list of sets, from a list of sets whose members may be connected
body: <p>I'm dealing with polygonal data in realtime here, but the problems quite simple.
  I have a huge list containing thousands of sets of polygon Indecies (Integers) and I need to simplify the list as "fast" as possible into a list of sets of "connected" Indecies.
  i.e. Any sets containing integers that are also in another set become one set in the result. I've read several possible solutions involving sets &amp; graphs etc. All i'm after are a final list of sets which had any degree of commonality.</p>
  
  <p>I'm dealing with lots of data here, but for simplicities sake here's some sample data:</p>
  
  <pre><code>setA = set([0,1,2])
  setB = set([6,7,8,9])
  setC = set([4,5,6])
  setD = set([3,4,5,0])
  setE = set([10,11,12])
  setF = set([11,13,14,15])
  setG = set([16,17,18,19])
  
  listOfSets = [setA,setB,setC,setD,setE,setF,setG]
  </code></pre>
  
  <p>In this case I'm after a list with a result like this, although ordering is irrelevant:</p>
  
  <p>connectedFacesListOfSets = [ set([0,1,2,3,4,5,6,7,8,9]), set([10,11,12,13,14,15]), set([16,17,18,19])]</p>
  
  <p>I've looked for similar solutions, but the one with the highest votes gave incorrect results on my large test data.</p>
  
  <p><a href="https://stackoverflow.com/questions/4842613/merge-lists-that-share-common-elements">Merge lists that share common elements</a></p>