get_parent function

Get the index of the parent node at a node of a tree