A bit-vector encoding is a well known method for representing hierarchies (i. e. partially ordered sets). This encoding corresponds to an embedding of a given hierarchy into a Boolean lattice whose dimension is the encoding's size. Computing an optimal bit-vector encoding, which size is called the 2-dimension, is an NP-hard problem. Hence, many algorithms were designed to provide good bit-vector encoding. In this paper, we study tree hierarchies. We analyse previous algorithms for their bit-vector encoding then we point out their common strategy that led us to design a new algorithm improving all the previous ones.