  Given an arbitrary graph $E$ we investigate the relationship between $E$ and
the groupoid $G_E$.
  We show that there is a lattice isomorphism between the lattice of pairs $(H,
S)$, where $H$ is a hereditary and saturated set of vertices and $S$ is a set
of breaking vertices {associated to $H $}, onto the lattice of open invariant
subsets of $G_E^{(0)}$. We use this lattice isomorphism to characterize the
decomposability of the Leavitt path algebra $L_K(E)$, where $K$ is a field.
  First we find a graph condition to characterise when an open invariant subset
of $G_E^{(0)}$ is closed.
  Then we give both a graph condition and a groupoid condition each of which is
equivalent to $L_K(E)$ being decomposable {in the sense that it can be written
as a direct sum of two nonzero ideals}.
