MCPcopy Create free account
hub / github.com/djeada/Algorithms-And-Data-Structures / bfs

Function bfs

src/graphs/python/bfs/src/bfs.py:11–52  ·  view source on GitHub ↗

Find the shortest path between source and destination using BFS. Note: BFS finds the shortest path in terms of number of edges, but this implementation also tracks edge weights for consistency with other algorithms. Args: graph: The graph to search. source:

(graph: Graph, source: Vertex, destination: Vertex)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Calls 3

containsMethod · 0.45
verticesMethod · 0.45
edges_from_vertexMethod · 0.45