tree path comparison