  In this paper, a construction of constant weight codes based on the unique
decomposition of elements in lattices is presented. The conditions for unique
primary decomposition and unique irreducible decomposition in lattices are
discussed and connections with the decomposition of ideals in Noetherian
commutative rings established. In this context it is shown, drawing on the
definitive works of Dilworth, Ward and others, that, as opposed to Noetherian
commutative rings, the existence of unique irreducible decomposition in
lattices does not guarantee unique primary decomposition. The source alphabet
in our proposed construction is a set of uniquely decomposable elements
constructed from a chosen subset of irreducible or primary elements of the
appropriate lattice. The distance function between two lattice elements is
based on the symmetric distance between sets of constituent elements. It is
known that constructing such constant weight codes is equivalent to
constructing a Johnson graph with appropriate parameters. Some bounds on the
code sizes are also presented and a method to obtain codes of optimal size,
utilizing the Johnson graph description of the codes, is discussed. As an
application we show how these codes can be used for error and erasure
correction in random networks employing store-and-forward (SAF) routing.
