I am solving problems, but I am poor at graph problems.
Could anymore share his or her experience on how to have an efficient algorithm to detect or check for presences of cycles on a graph?
I just know DFS, but I think it's a poor algo.
Thx.
Graph problems
Moderator: Board moderators
-
- A great helper
- Posts: 284
- Joined: Thu Feb 28, 2002 2:00 am
- Location: Germany
- Contact:
-
- A great helper
- Posts: 284
- Joined: Thu Feb 28, 2002 2:00 am
- Location: Germany
- Contact:
Hmm, I might be wrong, but I think what you mean with the brute force method might be more appropriately be called backtracking.
When I think DFS, then I see the O(V+E) algorithm that traverses every part of the graph exactly once, without taking back choices made (i.e. the DFS tree is only extended).
For a nice application, try to solve problem 610 (Street Directions) with DFS.
When I think DFS, then I see the O(V+E) algorithm that traverses every part of the graph exactly once, without taking back choices made (i.e. the DFS tree is only extended).
For a nice application, try to solve problem 610 (Street Directions) with DFS.
Some graph problems can be easily solved by DFS.
Backtracking is a kind of method to tranverse a search tree.
Diffient problems diffient methods.
If you want to know more, just visit the following site,
you will get reply very soon.( A lot of excellent programmers from China there)
Welcome to visit :
http://www.ioiforum.org/en/
Here to register:
http://www.ioiforum.org/userreg.asp
Backtracking is a kind of method to tranverse a search tree.
Diffient problems diffient methods.
If you want to know more, just visit the following site,
you will get reply very soon.( A lot of excellent programmers from China there)
Welcome to visit :
http://www.ioiforum.org/en/
Here to register:
http://www.ioiforum.org/userreg.asp