@Jeth

Hi

Just thot  a Soln
Since we need to check whether the length of any path btw any two
nodes in a grph
it s enough if we checkwhether the Height of DFS tree [/Forest] is max
of 2.
If so then the ttask underlying is accomplished.


Notify if my intution s not crt

Open 4 comments

Regards
Bala


On May 5, 8:42 pm, jeth <[EMAIL PROTECTED]> wrote:
> Hi, for a long time I'm having a problem with one graph algorithm.
> After checking two and spending few days on it I've no more ideas what
> to do. Maybe you can give me some pieces of advice which algorithm
> should I use to solve such problem:
> Assume we have a n-vertice graph with m-edges. The edges are given in
> input. My task is to find if it is possible to connect each vertice
> with exactly two other vertices. Every edge can be used two times. The
> maximum lenght of path which connects two vertices is 3.
> For graph with edges
> 1 2
> 2 3
> the answer is YES, because we can make such connections:
> 1-2
> 2-3
> 1-2-3
> I'll be greatful for any possible help.
> regards,
> Jeth


--~--~---------~--~----~------------~-------~--~----~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to