As someone who has not english as moms language (Russia) I read this article at Wikipedia: http://en.wikibooks.org/wiki/Artificial_Intelligence/Search/Heuristic_search/Depth-first_search
and I try to follow this pseudo code example written in hardcore english with less to nothing explanations or comments.
In particular, I don't get what they try to say with this sentence:
DFS(u):
visit(u);
time = time + 1;
d[u] = time;
color[u] = grey;
for all nodes v adjacent to u do
if color[v] == white then
p[v] = u;
DFS(u);
time = time + 1;
f[u] = time;
color[u] = black;
for all nodes v adjacent to u do
My problem with this sentence is the "adjacent" part. My dictionary says this means something like "neighbor". So I have to iterate over the subnodes of the supernode of u? Note that u is a node in the graph.
Or are they trying to say I must iterate over all the subnodes of u? Because this would make a huge difference.
Besides those english problems they forgot to mention what d and p mean, which makes me ripp all my hairs out (yes, even those from my mustache).
The links in the article just repeat this not-much-telling cryptic stuff. Maybe someone was able to actually re-write this in a way that is more humanly readable, with more comments and meaningful variables? I didn't find any really good explanation that isn't just there to show off the dominating intelligence of the writer related to DFS.
So if someone can re-write that on the fly in a better way with greater learning value that would save my day, save my mustache. Save everything. Thank you.