- #1
BiGyElLoWhAt
Gold Member
- 1,622
- 131
Hi, I think this is a topology question, but I'm honestly not 100% sure. Feel free to move.
On a number line, I am trying to find the minimum number of moves to get from one point to another, given certain allowed step sizes. For example, My allowed steps might be +/-2, +/-3, and I want to move from 0 to 1. my shortest number of moves would be 2 in this case, +3->-2 or -2->+3. Now say I want to move from a->b. How would I go about figuring out the shortest number of moves?
My actual problem also has constraints on the moves as well, some places I can't execute more than one of the moves. Think about it as a finite 2D space projected onto a line. So I have an nxm grid numbered 0 through n*m-1 and I'm not allowed to leave the grid. If I'm looking at a position along the left hand side, I can't, for example, use -3. I'm just curious about how I should go about solving this problem, so I'm not giving the actual example, but in case you're curious, it's a 2d space mapped to a 1d space, and the set of moves are +/- (6,10,15,17) with constraints, like position 0 can only move 10 and 17. No negative positions are allowed, however I don't think that is all that important, since there is a symmetric move (3-2 vs -2+3 in the original example).
My guess is that it can be solved using a metric with the proper distance function for each point. However that doesn't feel quite right. If I am not clear, I can attempt to clarify. I'm more looking for the approach to the solution rather than the solution itself, so let's stick with +/-(2,3) for our moves, and arbitrary constraints if that works for whoever is reading this to help.
Thanks in advance.
On a number line, I am trying to find the minimum number of moves to get from one point to another, given certain allowed step sizes. For example, My allowed steps might be +/-2, +/-3, and I want to move from 0 to 1. my shortest number of moves would be 2 in this case, +3->-2 or -2->+3. Now say I want to move from a->b. How would I go about figuring out the shortest number of moves?
My actual problem also has constraints on the moves as well, some places I can't execute more than one of the moves. Think about it as a finite 2D space projected onto a line. So I have an nxm grid numbered 0 through n*m-1 and I'm not allowed to leave the grid. If I'm looking at a position along the left hand side, I can't, for example, use -3. I'm just curious about how I should go about solving this problem, so I'm not giving the actual example, but in case you're curious, it's a 2d space mapped to a 1d space, and the set of moves are +/- (6,10,15,17) with constraints, like position 0 can only move 10 and 17. No negative positions are allowed, however I don't think that is all that important, since there is a symmetric move (3-2 vs -2+3 in the original example).
My guess is that it can be solved using a metric with the proper distance function for each point. However that doesn't feel quite right. If I am not clear, I can attempt to clarify. I'm more looking for the approach to the solution rather than the solution itself, so let's stick with +/-(2,3) for our moves, and arbitrary constraints if that works for whoever is reading this to help.
Thanks in advance.