I assume you are talking about the distance between nodes.
Are you using ForceDirectedLayout? That assumes that there are Links between the Nodes to counteract the repulsive electrical forces.
When there are no links, the electrical charges cause nodes to move far enough apart until the forces are considered insignificant.
You could either decrease the ForceDirectedLayout.defaultElectricalCharge or decrease the ForceDirectedLayout.infinityDistance. Or maybe increase the ForceDirectedLayout.defaultGravitationalMass.