thisisvasanths
BAN USERThe Travelling Salesman Problem belongs to the NP-Hard problems set and the decision version of the problem belongs to the NP-Complete problems set.
One probable approach I can think of is Branch and Bound, which can perform O(N^2) at the worst case.
I have read about a Stanford-McGill team which figured out the most optimal Solution for the TSM problem in 2013. But have not seen the paper.
If anyone knows of a better approach, please post it here.
My Solution would be to create three classes,
MonthClass, DayClass, HoursClass,
in a hierarchical order.
We can instantiate an object for all the months, days and hours touched by the ranges provided in String input.
like:
[Root]
__l__
| |
[Jan] [Feb] ....
__|__ __|__
|
[Day1]....
|
[Hour1]...
And update the ranges for the hours.
Then a simple DFS can give us the Hour with the highest value!
P.S: Please feel free to slam on, if the sol. doent make sense.
(* Excuse the multiple comment, Browser screwed up :D )
- thisisvasanths November 08, 2015