Backtracking , DFS, Divide & Conquer

Let's talk about algorithms!

Moderator: Board moderators

Post Reply
白約
New poster
Posts: 2
Joined: Sun Jan 08, 2006 7:39 pm

Backtracking , DFS, Divide & Conquer

Post by 白約 »

I'm always confusing these concepts. They're very very confusing me.

1. DFS is one of ways of search in graph and it can be implemented by recursive function. Moreover I always believe (recursive function = Backtracking).
So I think Backtracking is high concept than DFS and Backtracking is not a algorithm, but just a programming technique like DP.

2. Divide & Conquer is paradigm for algorithm design. It can be implemented by Backtracking and DP.

3. D&C > Backtracking > DFS

Am I right?

Oh.. There is another question.
Are there any problems that I could solve by ONLY using Backtracking?

Please help me.

ps. Hmm...My English is very poor. sorry about that.
serur
A great helper
Posts: 251
Joined: Thu Feb 23, 2006 11:30 pm

Post by serur »

Only backtracking? Oh there are many:
10422,10496,10578-very nice!,524,529-ver-very nice,and so on...
Last edited by serur on Sat Apr 14, 2012 3:35 pm, edited 1 time in total.
gvcormac
Problemsetter & Reviewer
Posts: 194
Joined: Fri Mar 15, 2002 2:00 am
Contact:

DFS != recursion

Post by gvcormac »

You don't need recursion for DFS - you can use a stack. Just like you use a queue for BFS.

DFS applies to a well-defined graph in which you can easily identify back-edges -- ones that revisit vertices you've already dealt with.

This makes DFS linear time. In general "recursive" solutions can be exponential but obviously the recursive implementation of DFS is not.

Some DFS-derived algorithms, like topological sort, are pretty obvious. Some, like biconnected components, are not. [CLR had a wrong algorithm for many years; I presume it is now fixed]
Post Reply

Return to “Algorithms”