A graph theory based approach has been used in this study, where the nodes represent the atoms and edges represent the covalent bonds between the atoms. The number of bonds that an atom can form is constrained by the valency of the atom. In order to accommodate multiple bonds between two atoms, we used the networkx MultiGraph object. Edge attributes were used to indicate the number of bonds between two atoms.