Topological generalization of the rigid-nonrigid transition in soft-sphere and hard-sphere fluids.