There are n points in the 2D plane. The robot wants to visit all of them, but can only move horizontally or vertically. How should he visit all of them so that the total distance that he covered is minimal?
This is a problem with the seller , where the distance between each pair of points is | y2-y1 | + | x2-x1 | (called Rectilinear distance or Manhattan distance ). This is NP-hard , which basically means that there is no known effective solution.
Ways to solve it on Wikipedia.
- , . O (n!). 10 , .
Source: https://habr.com/ru/post/1724836/More articles:Uploading images to a simulator but not a device? - iphoneDjango: модель доступа через другую модель - djangoJava Stanford NLP: spell checking - javaSimple regex to return text from Wordpress header - qtranslate plugin - phpPHP Development MVC Framework - designКак получить уникальные записи продуктов в List с LINQ - c#jquery getscript for iframe object - javascriptIs there a complete list of Google App Engine applications? - google-app-enginejQuery: how to remove list items from lists? - javascriptHow to print an array in jdb java debugger? - javaAll Articles