Accurate ab-initio calculations are performed for pyrrole and thiophene oli
gomers bonded through alpha and beta carbons. The thermodynamical stabiliti
y of all possible binding types including the branched forms of tetramers a
nd pentamers are compared. Employing the probabilities obtained from these
calculations, a Monte Carlo type growth scheme is applied to predict branch
ing as functions of the chain length and temperature. A high degree of bran
ching for polypyrrole is reported whereas the linear chains dominate the st
ructure of polythiophene.