Chinese-Postman icon indicating copy to clipboard operation
Chinese-Postman copied to clipboard

Hi! Does the input support an input with an irrational side length?

Open provenpeng opened this issue 4 years ago • 2 comments

If my input is a right triangle, the hypotenuse is 2, and one of the right angles is 1, does that support the input, and if so, how?If not, any Suggestions?

provenpeng avatar Jun 03 '20 01:06 provenpeng

At the moment it seems all the code that uses weight or edge_cost assumes a float value. So if you wanted to use a lambda as an input, for example, that would require quite a lot of refactoring. I can imagine it would be possible, however. You could define an edge as a function, e.g. math.pi(), and call that function whenever you are evaluating your edge cost.

You might want to define your input data in a python file, in that case.

supermitch avatar Jun 03 '20 04:06 supermitch

Thank you for answering. There is another question I would like to ask you. If you are only seeking the shortest path through all the edges without asking for the final return to the starting point, how should you achieve it?

provenpeng avatar Jun 03 '20 05:06 provenpeng