change neighborhood structure into dict