Find if path ecists between two nodes in a graph