lutzzdias / travelling-salesman-problem

0 stars 1 forks source link

[Component] constructor #4

Closed AlexandreAndrade00 closed 11 months ago

AlexandreAndrade00 commented 11 months ago

The API has a Component class. It should be discussed what it represents in our problem and implement it.

AlexandreAndrade00 commented 11 months ago

In my interpretation, a Component is a city, so it should have a city ID.

lutzzdias commented 11 months ago

Agreed, we'll be able to get the distance between 2 cities from the problem instance and the path will be saved in the path variable.

lutzzdias commented 11 months ago

The professor criticized in class that a component would be only the next city, in his opinion, the edge (currCity -> nextCity) is better since that is what we are actually adding. The city itself will be in the solution no matter what

AlexandreAndrade00 commented 11 months ago

I don't think that this change will change the final result. But the Component can be changed to represent an edge instead of a vertice.

lutzzdias commented 11 months ago

I did not fully understand the reasoning behind not using the cities as a component. In the end the outcome would be the same, perhaps it's in order to facilitate the reasoning for adding new components and allowing for non linear solution construction (eg. not necessarily start from a city, but add any arcs as long as it does not create loops)

lutzzdias commented 11 months ago

We can confirm the reasoning in today's PL

lutzzdias commented 11 months ago

closed in #27