Included function to check for a transitive connection