Hoshen–Kopelman algorithm: Difference between revisions

Content deleted Content added
Piturnah (talk | contribs)
There is no reason for this link to go to specifically the page for ANNs when it is a generic network
m There were two figures labeled "Figure (a)" and two labeled "Figure (b)". To avoid confusion, the second set are now called Figure (c) and Figure (d).
Line 12:
</gallery>||<gallery>
Occupied_Grids_P_%3D_0.64.png | {{center|'''Figure (b)'''}}
</gallery>|| Consider <code>5x5</code> grids in figurefigures (a) and (b).<br /> In figure (a), the probability of occupancy is <code>p = 6/25 = 0.24</code>.<br /> In figure (b), the probability of occupancy is <code>p = 16/25 = 0.64</code>.
|}
 
Line 72:
 
== Example ==
Consider the following example. The dark cells in the grid in <code>figureFigure (ac)</code> represent that they are occupied and the white ones are empty. So by running H–K algorithm on this input we would get the output as shown in <code>figureFigure (bd)</code> with all the clusters labeled.
 
The algorithm processes the input grid, cell by cell, as follows: Let's say that grid is a two-dimensional array.
Line 103:
|-
| <gallery>
H-K algorithm Input.png | {{center|'''Figure (ac)'''}}
</gallery>||<gallery>
H-K algorithm output.png | {{center|'''Figure (bd)'''}}
</gallery>|| Consider <code>6x6</code> grids in figure (ac) and (bd).<br /> Figure (ac), This is the input to the Hoshen–Kopelman algorithm.<br /> Figure (b), This is the output of the algorithm with all the clusters labeled.
|}