data structure design question

Thomas Hamelryck thamelry at
Mon Feb 14 18:03:06 CET 2000

Felix Thibault <felixt at> wrote:
: I'm thinking of trying to do some chemistry stuff in 
: Python, and one of the things I was thinking of was
: to define a Chemical (or Molecule) object. On paper
: chemicals are represented by stuctures like:

: H
: |  
: C=O
: |
: H

What you really need is a graph data structure. There is an excellent 
module called kjbuckets that is just the right tool for the job. You can
consider the bonds as edges in the graph and the atoms as nodes. 

Take a look at:


Thomas Hamelryck    Institute of Molecular and Structural Biology
Aarhus University   Gustav Wieds Vej 10C
DK-8000 Aarhus C    Denmark

More information about the Python-list mailing list