HS algorithm. Needs to be fixed such that neighbor recognition handles ring edges properly