Editing Disjoint sets

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 5: Line 5:
  
 
A configuration of disjoint sets is a model of an [[equivalence relation]], with each set an equivalence class; two elements are equivalent if they are in the same set. Often, when discussing an equivalence relation, we will choose one element in each equivalence class to be the ''representative'' of that class (and we say that such an element is in ''canonical form''). Then the ''find'' operation can be understood as determining the representative of the set in which the query element is located. When we unite two sets, we either use the representative of one of the two sets as the representative of the new, united set, or we pick a new element altogether to be the representative.
 
A configuration of disjoint sets is a model of an [[equivalence relation]], with each set an equivalence class; two elements are equivalent if they are in the same set. Often, when discussing an equivalence relation, we will choose one element in each equivalence class to be the ''representative'' of that class (and we say that such an element is in ''canonical form''). Then the ''find'' operation can be understood as determining the representative of the set in which the query element is located. When we unite two sets, we either use the representative of one of the two sets as the representative of the new, united set, or we pick a new element altogether to be the representative.
 
The graph-theoretic application of disjoint sets to connectivity may illustrate the problem more clearly. We let the elements of our universe be nodes in an undirected graph, and we say two nodes belong to the same equivalence class if they are in the same connected component. Then, executing ''Find'' on a node allows us to identify which connected component it is in; so that if we have two nodes and we execute ''Find'' on each one, and the results are the same, then these two nodes are in the same connected component and are mutually reachable. If we add an edge between these two nodes, and they are not already in the same connected component, then we are uniting their respective connected components into one; this corresponds to the ''Unite'' operation.
 
  
 
==A first idea==
 
==A first idea==

Please note that all contributions to PEGWiki are considered to be released under the Attribution 3.0 Unported (see PEGWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)