0

I've been working for a few days on solving a travelling salesman type problem, with the following goal. On a plot like the one displayed below (algorithmic identification of the cells, hence the fact that the numbers are not necessarily in a precise order, since the numbering algorithm is recursive), I would like to go from my cell 'cell21' (top right), to the cell 'cell12' (bottom left), passing through all the cells, in the shortest order possible. See graph :

graphData

Dijkstra allows me to draw the shortest path, but therefore does not pass through all the cells.

Finally, the travelling salesman does not answer perfectly to the need, since it allows diagonal movements, with return to the starting point.

I would like to implement an algorithm like the travelling salesman, with the following constraints:

  • Different (but known) start and end points

  • Only vertical/horizontal movements. In fact, when I arrive in cell4 (top, middle), I can only go to cell3, cell5 or cell20, without going back through already used cells (so a fortiori if I am in cell4, I have at most 2 exit options left, since I arrived there by one).

  • So a finite choice of new vertices from the current one (in graph theory).

I can't find variants of known algorithms that take into account this kind of criterion. I tried by putting almost infinite weights on my diagonal paths, without success. Would someone know a name of an algorithm that would fit my problem please?

Thanks in advance & have a nice day!

J O
  • 1
  • 1
  • It seems like my 'Hello all' disappeared... Sorry for that, and so good morning :) – J O Sep 21 '22 at 08:41

0 Answers0