The electronic structure and stability of metallocarbohedrenes (met-ca
r) and cubic structures containing Ti and C or N have been studied usi
ng the ab-initio density functional approach. We show that while the m
et-car and the cubic structures have comparable binding energies per a
tom for the case of carbides, the cubic structures are more stable for
metal-nitrogen systems. This change in behavior is shown to be relate
d to the differences in the nature of electronic bonds which stabilize
the two structures. By studying small TinCm and TinNm (n + m < 6) clu
sters, we identify these electronic features and show that the met-car
and cubic arrangements represent two different families whose formati
on is governed by the composition of the beam.