graph assignement... finding anscestors