Basic Small World algorithm implementation