The formation of economic networks: a proximity approach