Hello freeCodeCampers! I have an algorithmic question relating to the world of endurance sports. Suppose you have these constraints:
- a limited amount of time to train per week (say 6-8 hours)
- A fixed distance and a time limit to train for (eg 112 miles 180km in a maximum of 10.5 hours ) on a bike
And the biggest factor of all is the catch 22
-if you are slow, it takes longer to train but if you are fast, you have “leftover” training time.
If I ride 14mph. It will take me 8 hours to complete the event.
but if I ride 20mph, it will only take me 5.5 hours to complete it. The slowest speed someone could complete the course in is about 10.5 mph.
I’m hunting for some algorithms to help generate training patterns based on my current bike speed/fitness, but don’t quite know what I’m looking for. Linear or some kind of AI?
What kind of algorithm am I looking to implement here?