Hoshen–Kopelman algorithm: Difference between revisions

Content deleted Content added
Rmv unnecessary justified alignment per MOS:MARKUP and inappropriate numbered list
Filling in 2 references using Reflinks
Line 26:
== Pseudo-code ==
So in the raster scan of the grid in question, each time an occupied cell is encountered, a check is done to see whether this cell has any neighboring cells who have already been scanned. If so, first a <code>union</code> operation is performed, to specify that these neighboring cells are in fact members of the same equivalence class. Then a <code>find</code> operation is performed to find a representative member of that equivalence class with which to label the current cell. If on the other hand, the current cell has no neighbors, it is assigned a new, previously unused, label. The entire grid is processed in this way. The grid can be raster-scanned a second time, performing only <code>find</code> operations at each cell, to re-label the cells with their final assignment of a representative element.
Following pseudo-code is referred from one of the University of California Berkeley's projects.<ref>{{cite web|url=https://www.ocf.berkeley.edu/~fricke/projects/hoshenkopelman/hoshenkopelman.html|title=The Hoshen-Kopelman Algorithm|publisher=}}</ref>
<strong>Raster Scan and Labeling on the Grid</strong>
largest_label = 0;
Line 107:
 
== Applications ==
* Segmentation and Clustering of a Binary Image<ref>{{cite web|url=http://www.scialert.net/qredirect.php?doi=jas.2008.2474.2479&linkid=pdf |format=PDF |title=Journal of Applied Sciences |issn=1812-5654 |website=Scialert.net |accessdate=2016-09-17}}</ref>
* Determination of Nodal Domain Area and Nodal Line Lengths<ref>{{cite web|url=https://webhome.weizmann.ac.il/home/feamit/nodalweek/c_joas_nodalweek.pdf |format=PDF |title=Introduction to the Hoshen-Kopelman algorithm and its application to nodal ___domain statistics |author=Christian Joas |website=Webhome.weizmann.ac.il |accessdate=2016-09-17}}</ref>
* Nodal Connectivity Information
* Modeling of electrical conduction.