Tree preserving embedding