|
-
January 21st, 2011, 03:35 PM
#1
The best location of a path
Hi!
I've a problem to solve. I was given some fields divided into ranges. For example, field has 22 units in length, and contains some ranges (I don't know how to describe it well :P).
Except of this field, I was given also a length of a path. This path has to include the field's max ranges. For example, if the length of the path is 3 units, my algorithm should calculate that the path should start at 12th unit. It will contain 3 max possible ranges (99, 98, 97) for this lenght.
On the other hand, if the lenght of the path would be 4, the algorithm should calculate that the beggining of the path should be at 12th unit, and the end of the path - at 16 unit.
I hope you understand what I mean 
My problem is that I don't know whether should I choose the bruteforce algorithm to find this optimal location of the given path, as sometimes the calculations can take a lot of time...
If the bruteforce algorithm wouldn't be good in this case, then could you give me a little clue about the solution ? 
Best regards,
John.
Last edited by kollipsi; January 30th, 2011 at 02:29 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|