Ejemplo n.º 1
0
    def breadth_first_search(self, root=None, filter=filters.null()):
        """
        Breadth-first search.

        @type  root: node
        @param root: Optional root node (will explore only root's connected component)

        @rtype:  dictionary
        @return: A tuple containing a dictionary and a list.
            1. Generated spanning tree
            2. Graph's level-based ordering
        """
        return searching.breadth_first_search(self, root, filter=filter)
Ejemplo n.º 2
0
    def breadth_first_search(self, root=None, filter=filters.null()):
        """
        Breadth-first search.

        @type  root: node
        @param root: Optional root node (will explore only root's connected component)

        @rtype:  dictionary
        @return: A tuple containing a dictionary and a list.
            1. Generated spanning tree
            2. Graph's level-based ordering
        """
        return searching.breadth_first_search(self, root, filter=filter)
Ejemplo n.º 3
0
    def depth_first_search(self, root=None, filter=filters.null()):
        """
        Depht-first search.
        
        @type  root: node
        @param root: Optional root node (will explore only root's connected component)

        @rtype:  tuple
        @return:  tupple containing a dictionary and two lists:
            1. Generated spanning tree
            2. Graph's preordering
            3. Graph's postordering
        """
        return searching.depth_first_search(self, root, filter)
Ejemplo n.º 4
0
    def depth_first_search(self, root=None, filter=filters.null()):
        """
        Depht-first search.
        
        @type  root: node
        @param root: Optional root node (will explore only root's connected component)

        @rtype:  tuple
        @return:  tupple containing a dictionary and two lists:
            1. Generated spanning tree
            2. Graph's preordering
            3. Graph's postordering
        """
        return searching.depth_first_search(self, root, filter=filter)