graphit/graph_algorithms.py
def is_reachable(graph, root, destination):
    """
    Returns True if given node can be reached over traversable edges.
    
    :param graph: Graph to query
    :type graph: Graph class instance
    :param root: source node ID
    :type root: int
    :param destination: destintion node ID
    :type destination: int
    :return: bool
    """
    
    if root in graph.nodes and destination in graph.nodes:
        connected_path = dfs(graph, root)
        return destination in connected_path
    else:
        logger.error('Root or destination nodes not in graph')

    Returns True if given node can be reached over traversable edges.
    
    :param graph: Graph to query
    :type graph: Graph class instance
    :param root: source node ID
    :type root: int
    :param destination: destintion node ID
    :type destination: int
    :return: bool
    
Returns True if given node can be reached over traversable edges.
Returns True if given node can be reached over traversable edges .
def is_reachable(graph, root, destination):
    if root in graph.nodes and destination in graph.nodes:
        connected_path = dfs(graph, root)
        return destination in connected_path
    else:
        logger.error('Root or destination nodes not in graph')
def is_reachable ( graph , root , destination ) : if root in graph . nodes and destination in graph . nodes : connected_path = dfs ( graph , root ) return destination in connected_path else : logger . error ( 'Root or destination nodes not in graph' )
Returns True if given node can be reached over traversable edges.
Returns True if given node can be reached over traversable edges .
"""
    Returns True if given node can be reached over traversable edges.
    
    :param graph: Graph to query
    :type graph: Graph class instance
    :param root: source node ID
    :type root: int
    :param destination: destintion node ID
    :type destination: int
    :return: bool
    """
None
graph
Graph to query
Graph to query
root
source node ID
source node ID
destination
destintion node ID
destintion node ID