Hi Friends,
I have learnt an algorithm regarding the graph i.e. to
find out the* DFS *
DFS(G)
{
for each vertex u of V[G]
do color[u]<-white
pred[u]<-NULL
time<-0
for each vertex u of V[G]
do if color[u]=WHITE
then DFS_Visit(u)
}
DFS_Visit(u)
{
color[u]<-GRAY
time<-time+1
d[u]<-time
for each v of V[G] adjacent of u
do if(color[u]==white)
then pred[v]<-u
DFS_Visit(v)
color[u]<-black
f[u]<-time+1
}
Example (DFS)
here in DFS pred[v] indicates that v has been discovered through whom.
d[u] indcates that what is *discovery time of vertex u*.
f[u]* indicates that what is finishing time of vertex u.*
*it was about DFS.*
*Arrange them in according to the decreasing order of their finishing time
it will give out DFS.*
**
**
**
**
**
**
*pls feel free to ask question regarding it.*
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---