Sometimes when people first hear about the Traveling Salesman problem, they think: "Oh, that's not hard. Start with a city on the map; move to the nearest unvisited city; and then on each subsequent step, move to the nearest still-unvisited city, until you're done." This strategy is called a "greedy strategy": it always goes to the nearest allowed step. Now consider four cities, all placed along the number line. City A is at point 0, City B at point 2, City C at point 3, and City D at point 10: A B C D 00-01-02-03-04-05-06-07-08-09-10 Now, start a traveling salesman tour at City B, and use the greedy algorithm to choose your tour of the four cities, beginning and ending at B. How long is the greedy algorithm’s tour?

niga123098 niga123098    1   04.08.2020 12:53    31

Другие вопросы по теме Физика