main.py
def bfs(g, start=(0, 0)):
    """ Uses breadth first search to assign predecessors and get the
    distance from  the provided states."""
    start = g.getVertex(start)
    start.setDistance(0)
    start.setPred(None)
    vertQueue = Queue()
    vertQueue.enqueue(start)
    while vertQueue.size() > 0:
        currentVert = vertQueue.dequeue()
        for nbr in currentVert.getConnections():
            if nbr.getColor() == 'white':
                nbr.setColor('gray')
                nbr.setDistance(currentVert.getDistance() + 1)
                nbr.setPred(currentVert)
                vertQueue.enqueue(nbr)
        currentVert.setColor('black')
 Uses breadth first search to assign predecessors and get the
    distance from  the provided states.
Uses breadth first search to assign predecessors and get the
distance from  the provided states.
Uses breadth first search to assign predecessors and get the distance from the provided states .
def bfs(g, start=(0, 0)):
    start = g.getVertex(start)
    start.setDistance(0)
    start.setPred(None)
    vertQueue = Queue()
    vertQueue.enqueue(start)
    while vertQueue.size() > 0:
        currentVert = vertQueue.dequeue()
        for nbr in currentVert.getConnections():
            if nbr.getColor() == 'white':
                nbr.setColor('gray')
                nbr.setDistance(currentVert.getDistance() + 1)
                nbr.setPred(currentVert)
                vertQueue.enqueue(nbr)
        currentVert.setColor('black')
def bfs ( g , start = ( 0 , 0 ) ) : start = g . getVertex ( start ) start . setDistance ( 0 ) start . setPred ( None ) vertQueue = Queue ( ) vertQueue . enqueue ( start ) while vertQueue . size ( ) > 0 : currentVert = vertQueue . dequeue ( ) for nbr in currentVert . getConnections ( ) : if nbr . getColor ( ) == 'white' : nbr . setColor ( 'gray' ) nbr . setDistance ( currentVert . getDistance ( ) + 1 ) nbr . setPred ( currentVert ) vertQueue . enqueue ( nbr ) currentVert . setColor ( 'black' )
Uses breadth first search to assign predecessors and get the
distance from  the provided states.
Uses breadth first search to assign predecessors and get the distance from the provided states .
""" Uses breadth first search to assign predecessors and get the
    distance from  the provided states."""
g
start