2
$\begingroup$

I am writing a work on pathfinding algorithms and DFS is a part of it. And the book Introduction to Algorithms and many another websites mention timestamps. And they say timestamps could be used for others algorithms using DFS, topological sorting and etc.

So for pathfinding these timestamps dont really matter?

Thank you for helping.

Here is the section from the book mentioning timestamps: Besides creating a depth-first forest, depth-first search also timestamps each vertex. Each vertex has two timestamps: the first timestamp :d records when is first discovered (and grayed), and the second timestamp :f records when the search finishes examining ’s adjacency list (and blackens )

$\endgroup$
2
$\begingroup$

Correct. If you just want to check which nodes are reachable, or find any path from $s$ to $t$, you don't need the timestamps (the pre and post values).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.