If your node setup is like a tree. You can make use of recursive functions to inspect the parents or childs of each element. Its more natural to find all root elements first and then perform operations on each child but look for parents given a node is also posible.
parent = node.parent:
if parent == None: #this is a root element
#this node has parent
#recursive traverse all subsequence parents
any_value = search_parent(parent)
#do something with any_value
nodes = chromosomes.nodes
for each node in nodes:
node = chromosomes #any random node inside nodes
This code assumes that you have a single parent for each node. If you have many the only difference is that you have to iterate for each one of them before calling search_parents.