createSocialNetwork now uses parameter filter (instead of func), to keep compatibility with createNeighborhood.