how to obtain the longest chain of nodes among given connected nodes ?

algorithm
c
chain
codechef
graphs
java
longest

#1

I need suggestions for this question which is based upon longest chain of nodes.The problem is described here.