A Monte Carlo method is used in order to simulate the competition between the molecular relaxation and crystallization times in the formation of a glass. The results show that nucleation is avoided during supercooling and produce self-organization in the sense of the rigidity theory, where the number of geometrical constraints due to bonding and excluded volume are compared with the degress of freedom available to the system. Following this idea, glass transitions were obtained by producing self-organization, and in the case of geometrical frustration, self-organization is naturally observed.