We present a numerical method for the investigation of nonergodic effects i
n the Coulomb glass. An algorithm is developed to obtain an almost complete
set of low-energy many-particle states. The dynamics of the sample is mapp
ed to the graph formed by the relevant transitions between these states, th
at is, by transitions with rates larger than the inverse of the duration of
the measurement. The formation of isolated clusters in the graph indicates
nonergodicity. We analyze the connectivity of this graph in dependence on
temperature, duration of measurement, degree of disorder, and dimensionalit
y, studying how nonergodicity is reflected in the specific heat.