In this work, we study the influence of polymer chain length (m), based on Lennard-Jones potential, and nanoparticle (NP)-polymer interaction strength (ɛnp) on aggregation and dispersion of soft repulsive spherically structured NPs in polymer melt using coarse-grain molecular dynamics simulations. A phase diagram is proposed where transitions between different structures in the NP-polymer system are shown to depend on m and ɛnp. At a very weak interaction strength ɛnp = 0.1, a transition from dispersed state to collapsed state of NPs is found with increasing m, due to the polymer's excluded volume effect. NPs are well dispersed at intermediate interaction strengths (0.5 ⩽ ɛnp ⩽ 2.0), independent of m. A transition from dispersion to agglomeration of NPs, at a moderately high NP-polymer interaction strength ɛnp = 5.0, for m = 1-30, is identified by a significant decrease in the second virial coefficient, excess entropy, and potential energy, and a sharp increase in the Kirkwood-Buff integral. We also find that NPs undergo the following transitions with increasing m at ɛnp ⩾ 5.0: string-like → branch-like → sphere-like → dispersed state.