mishaturnbull / edgegraph

Python edge-vertex graph framework
https://edgegraph.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Breadth-first search does not identify starting vertex #5

Closed mishaturnbull closed 2 months ago

mishaturnbull commented 6 months ago

edgegraph.traversal.breadthfirst.bfs does not return the start vertex when it matches the desired criteria. The following unit test covers this case:

def test_bfs_finds_first_vertex(graph):
    uni, verts = graph
    for vert in verts:
        search = breadthfirst.bfs(uni, vert, 'i', vert.i)
        assert search is vert, f"BFS did not identify the starting vertex!"