1. A method of local optimization of a tree structure of a human body comprising: choosing a body part; choosing a dynamic; choosing a part state; running dynamic on said part state; deciding whether to accept new states or not; running probabilities propagation; and repeating until reach local maximum.