i have a undirected graph and i want to print a cycle with length >=k (given) , can you suggest me a algo ? i dont want any code, snippet. i am hoping for hint and algo for this. thanks. it is guaratned that cycle of length >=k exists.. thanks.
nitin1
15
Master Poster
Recommended Answers
Jump to PostYou could use Depth First Search to look for all cycles. Report back only those that have length >= k.
Jump to PostYou should keep your visited node in order. You need to keep checking whether the new node you are visiting is already in your visited list. If it is, those nodes between the duplicated nodes and its own node compose a cycle. (Remember that you keep them in order of …
All 5 Replies
Taywin
312
Posting Virtuoso
nitin1
15
Master Poster
Taywin
312
Posting Virtuoso
nitin1
15
Master Poster
Taywin
312
Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.