Fastest Path with Acceleration at Points

前端 未结 2 1127
刺人心
刺人心 2021-02-19 01:19

This is just something I came up with on my own, but it seems like a fun problem and it has me stumped.

You have a set of points in two-dimensional space, with one point

2条回答
  •  萌比男神i
    2021-02-19 01:54

    I think that the requirement that you only use the acceleration from each point once makes this problem NP complete in the general case. Consider an input that looks like this:

    If the "huge distance" between the end point and the rest of the points is large enough to dominate the cost of the final solution, finding an optimal solution will boil down to finding a way to pick up as many speed boosts as possible from the start of the graph. If you only allow each point to be passed once, this would be equivalent to to the Hamiltonian path problem, which is NP complete.

    That said, your problem has some extra rules on top of it (the distances are euclidean, the graph is always complete) which might end up making the problem easier.

提交回复
热议问题