  Using an ensemble of N-body simulations, this paper considers the fate of the
outer gas giants (Jupiter, Saturn, Uranus, and Neptune) after the Sun leaves
the main sequence and completes its stellar evolution. Due to solar mass-loss
-- which is expected to remove roughly half of the star's mass -- the orbits of
the giant planets expand. This adiabatic process maintains the orbital period
ratios, but the mutual interactions between planets and the width of
mean-motion resonances (MMR) increase, leading to the capture of Jupiter and
Saturn into a stable 5:2 resonant configuration. The expanded orbits, coupled
with the large-amplitude librations of the critical MMR angle, make the system
more susceptible to perturbations from stellar flyby interactions. Accordingly,
within about 30 Gyr, stellar encounters perturb the planets onto the chaotic
sub-domain of the 5:2 resonance, triggering a large-scale instability, which
culminates in the ejections of all but one planet over the subsequent $\sim10$
Gyr. After an additional $\sim50$ Gyr, a close stellar encounter (with a
perihelion distance less than $\sim200$ AU) liberates the final planet. Through
this sequence of events, the characteristic timescale over which the solar
system will be completely dissolved is roughly 100 Gyr. Our analysis thus
indicates that the expected dynamical lifetime of the solar system is much
longer than the current age of the universe, but is significantly shorter than
previous estimates.
