You can avoid this easily, if you have a numbering of the nodes. A cycle is only counted if all the vertices have a greater numbering than the current vertex.
These are minor implementation details. But DFS is the algorithm for finding cycles.
regards
Arunachalam.
On 10/23/06, malli <[EMAIL P
using DFS the loop would get detected more than once.
If we use DFS a loop would be detected 'n' times if there are 'n' nodes
in the loop.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To
You can use a DFS.Greetings.On 10/22/06, malli <[EMAIL PROTECTED]> wrote:
Hello All.How can I detect all loops in a directed graph?I would like to detect the starting node of the loop as well as the
closingedge of the loop.Thanks in Advance.Regards,Mallikarjun.-- Jair Cazarin Villanuevahttp://slipv
Hello All.
How can I detect all loops in a directed graph?
I would like to detect the starting node of the loop as well as the
closing
edge of the loop.
Thanks in Advance.
Regards,
Mallikarjun.
--~--~-~--~~~---~--~~
You received this message because you are s
A*?
plan system?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTE
could you talk it in detail?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EM
hello all
I have assignment of my
I come up with the idea of 3 graphs which inter connected.
following is:
the robot is able to guide people around the cities, he will tell you
how to go from one place to the other places according to some
condition or constraint.
1- each place will assign
Please help if you can!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL P
This code segment generates the matrix:for(i=0;i<26;i++) array[i][0]=1; for(n=0;n<26;n++) { for(j=0;j<26;j++) { for(i=j+1;i<26;i++)
{ temp+=array[i][n]; } array[j][n+1]=temp; temp=0; }
You can use binary search to do it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email
ya, i got it. thanx.but one think which i dont understand that
is that though we hv a direct fromula for calculating thru your algo
but what i think is that while programming it might be difficult to
maintain a matrix with no fixed size as characters are though 26 but
length of string is n
11 matches
Mail list logo