By the use of ordering-tree and connectivity matrix, a new algorithm to code non-circle molecules, called connectivity matrix polynomial (CMP) algorithm, is developed. The algorithm can not only differentiate asymmetrical atoms. but also make the two-direction mapping between codes and non-circle molecular structures. That is, from the molecular structure, a unique code can be obtained, and from the unique code, the specific molecular structure can be derived