Given a finite alphabet X and an ordering on the letters, the map \sigma
sends each monomial on X to the word that is the ordered product of the letter
powers in the monomial. Motivated by a question on Groebner bases, we
characterize ideals I in the free commutative monoid (in terms of a generating
set) such that the ideal generated by \sigma(I) in the free monoid
is finitely generated. Whether there exists an ordering such that
is finitely generated turns out to be NP-complete. The latter problem is
closely related to the recognition problem for comparability graphs.Comment: 27 pages, 2 postscript figures, uses gastex.st