traversal.go
func DFSRecursion(g Graph, id ID) []ID {
	if _, err := g.GetNode(id); err != nil {
		return nil
	}

	visited := make(map[ID]bool)
	rs := []ID{}

	dfsRecursion(g, id, visited, &rs)

	return rs
}
func DFSRecursion(g Graph, id ID) []ID {
	if _, err := g.GetNode(id); err != nil {
		return nil
	}

	visited := make(map[ID]bool)
	rs := []ID{}

	dfsRecursion(g, id, visited, &rs)

	return rs
}
func DFSRecursion ( g Graph , id ID ) [ ] ID { if _ , err := g . GetNode ( id ) ; err != nil { return nil } visited := make ( map [ ID ] bool ) rs := [ ] ID { } dfsRecursion ( g , id , visited , & rs ) return rs }
// DFSRecursion does depth-first search recursively.
//
//	 0. DFS(G, v):
//	 1.
//	 2. 	if v is visited:
//	 3. 		return
//	 4.
//	 5. 	label v as visited
//	 6.
//	 7. 	for each vertex u adjacent to v:
//	 8.
//	 9. 		if u is not visited yet:
//	10. 			recursive DFS(G, u)
//
DFSRecursion does depth - first search recursively . 0 . DFS ( G v ) : 1 . 2 . if v is visited : 3 . return 4 . 5 . label v as visited 6 . 7 . for each vertex u adjacent to v : 8 . 9 . if u is not visited yet : 10 . recursive DFS ( G u )