Added new function to determine if the graph has a particular node

Added new function to determine the ancestors of a particular node