How about this??

Since we have the distances between all pairs of nodes, so first we find the
largest distance.
They nodes which are the maximum distance are terminal nodes.
So in the given e.g. we get a-d at a distance of 10 units.

Now with this we know that the remaining nodes will lie between the two
nodes selected in step one.
We can apply the above logic again on the reduced set that we obtained. In
our e.g we get b-c at a distance of 5. All we need to decide now is that
which of b or c is near a. This is already given in terms of a-b & a-c.

Seems ok to me?



Regards,
Sandeep Jain



On Thu, Jul 7, 2011 at 3:23 PM, Navneet Gupta <navneetn...@gmail.com> wrote:

> Can we do this?
>
> Start with a node, take an edge say between x1 and x2 of length k1.
> Take another node x3 and check distance between x1 and x3 (k13) and x2
> and x3 (k23)
>
> Depending on whether k13 or k23 is bigger, the node x3 between x1 and
> x2 or away from x1 and after x2.
>
> Proceeding in this way should get you the correct order i guess. Thoughts?
>
> On Thu, Jul 7, 2011 at 2:07 PM, Piyush Sinha <ecstasy.piy...@gmail.com>
> wrote:
> > But the problem arises in setting the order............
> >
> > On Thu, Jul 7, 2011 at 2:06 PM, Piyush Sinha <ecstasy.piy...@gmail.com>
> > wrote:
> >>
> >> I think for initial start it should be the minimum n values for n
> >> milestones....
> >>
> >> On Thu, Jul 7, 2011 at 1:53 PM, Akshata Sharma <
> akshatasharm...@gmail.com>
> >> wrote:
> >>>
> >>> There is a straight roads with 'n' number of milestones. You are given
> an
> >>> array with the distance between all the pairs of milestones in some
> random
> >>> order. Find the position of milestones.
> >>> Example:
> >>> Consider a road with 4 milestones(a,b,c,d) :
> >>> a <--- 3Km --->b<--- 5Km --->c<--- 2Km --->d
> >>> Distance between a and b = 3
> >>> Distance between a and c = 8
> >>> Distance between a and d = 10
> >>> Distance between b and c = 5
> >>> Distance between b and d = 7
> >>> Distance between c and d = 2
> >>> All the above values are given in a random order say 7, 10, 5, 2, 8, 3.
> >>> The output must be 3,5,2 or 2,5,3
> >>>
> >>> --
> >>> 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
> >>> algogeeks+unsubscr...@googlegroups.com.
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/algogeeks?hl=en.
> >>
> >>
> >>
> >> --
> >> Piyush Sinha
> >> IIIT, Allahabad
> >> +91-8792136657
> >> +91-7483122727
> >> https://www.facebook.com/profile.php?id=100000655377926
> >
> >
> >
> > --
> > Piyush Sinha
> > IIIT, Allahabad
> > +91-8792136657
> > +91-7483122727
> > https://www.facebook.com/profile.php?id=100000655377926
> >
> > --
> > 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
> > algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/algogeeks?hl=en.
> >
>
>
>
> --
> Regards,
> Navneet
>
> --
> 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
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to