MCPcopy Create free account
hub / github.com/OpenGenus/quark / bfs

Function bfs

code/code/graph_algorithms/src/breadth_first_search/bfs.rb:43–71  ·  view source on GitHub ↗

Given a start node and a function or code block this performs a bread first search and will exit upon function or code block returning true, or returns :goal_node_not_found when it has visited the whole graph. visited is a set containing all nodes that has been checked. frontier is a queue were new nodes are appended, making this a breadth first search.

(start, goal = :goalNode?)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

testFunction · 0.70
maximum_flowMethod · 0.50

Calls 2

newMethod · 0.45
empty?Method · 0.45

Tested by

no test coverage detected