MCPcopy Create free account
hub / github.com/KOSASIH/skybridge / Traverse

Method Traverse

src/node/node.go:36–47  ·  view source on GitHub ↗

Traverse performs a depth-first traversal of the graph starting from the node

(visited map[string]bool)

Source from the content-addressed store, hash-verified

34
35// Traverse performs a depth-first traversal of the graph starting from the node
36func (n *Node) Traverse(visited map[string]bool) {
37 if visited[n.id] {
38 return
39 }
40
41 visited[n.id] = true
42 log.Printf("Visiting node %s", n.id)
43
44 for _, neighbor := range n.neighbors {
45 neighbor.Traverse(visited)
46 }
47}
48
49// TraverseConcurrently performs a concurrent depth-first traversal of the graph starting from the node
50func (n *Node) TraverseConcurrently(visited map[string]bool, wg *sync.WaitGroup) {

Callers 1

TestNodeFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestNodeFunction · 0.76