Closed williamfzc closed 1 year ago
Thanks for your PR! That makes perfectly sense. I only have one suggestion: Because the DFS
and DFSWithDepth
implementations are the same, you could remove the DFS
function body and replace it with a call to DFSWithDepth
:
ignoreDepth := func(vertex K, _ int) {
visit(vertex)
}
return DFSWithDepth(g, start, ignoreDepth)
... or something like that.
Thanks for your PR! That makes perfectly sense. I only have one suggestion: Because the
DFS
andDFSWithDepth
implementations are the same, you could remove theDFS
function body and replace it with a call toDFSWithDepth
:ignoreDepth := func(vertex K, _ int) { visit(vertex) } return DFSWithDepth(g, start, ignoreDepth)
... or something like that.
Sorry I have forgot leaving a comment for notification :) Already modified.
This change has been released in graph v0.21.0.
Thanks for your awesome project :)
This PR enhances current hook function for controlling BFS processing. Such as, stop BFS at a specfic depth level.
I am not pretty sure if there is a existed way to achieve this. But currently I have to walk the whole graph even I only need the first 3 layers.