  Liquid-liquid phase transitions have been found experimentally or by computer
simulations in many compounds such as water, hydrogen, sulfur, phosphorus,
carbon, silica, and silicon. Limited valence model implemented via event-driven
molecular dynamics algorithm provides a simple generic mechanism for the
liquid-liquid phase transitions in all these diverse cases. Here, we introduce
a variant of the limited valence model with a well defined Hamiltonian, i.e., a
unique algorithm by which the potential energy of the system of particles can
be computed solely from the coordinates of the particles and is thus equivalent
to a complex multi-body potential. We present several examples of the model
which can be used to reproduce liquid-liquid phase transition in systems with
maximum valence $z=1$ (hydrogen), $z=2$ (sulfur) and $z=4$ (water), where $z$
is the maximum number of bonds an atom is allowed to have. For $z=1$, we find a
set of parameters for which the system has a liquid-liquid and an isostructural
solid--solid critical points. For $z=4$, we find a set of parameters for which
the phase diagram resembles that of water with a wide region of negative
thermal expansion coefficient (density anomaly) extending into the metastable
region of negative pressures. The limited valence model can be modified to
forbid not only too large valences but also too low valences. In the case of
sulfur, we forbid the formation of monomers, thus restricting the valence $v$
of an atom to be within an interval $1=v_{\rm min}\leqslant v\leqslant v_{\rm
max}\equiv z=2$.
