Scale-free network hidden in a collapsing polymer