Friday, February 21, 2025

This recent algorithm for sorting books or files is close to perfection

Share

Original version With This story appeared in How much warehouse.

IT specialists often deal with abstract problems that are complex to understand, but an thrilling recent algorithm is vital for anyone who owns books and at least one shelf. The algorithm solves something called the problem of sorting the library (more formally the problem of “labeling the list”). The challenge is to develop a strategy for organizing books in some sorted order – for example, for example – which minimizes how much time it takes a recent book on the shelf.

Imagine, for example, that you keep your books stuck together, leaving a empty space on the right side of the shelf. Then, if you add the book Isabel Allende to your collection, you may have to move each book on the shelf to make a place. It would be a time -consuming surgery. And if you receive Douglas Adams’s book, you must do it again. A better layout would leave an unjust spaces arranged on the shelf – but how exactly should they be distributed?

This problem was introduced in 1981 PaperAnd he simply goes beyond providing librarians with organizational instructions. This is due to the fact that the problem also applies to laying files on challenging drives and databases in which organized elements can be number in billions. An unproductive system means a significant waiting time and earnest calculation costs. Scientists came up with some productive methods of storing subjects, but for a long time they wanted to determine the best possible way.

Last year, v test This was presented at the Foundations of Computer Science conference in Chicago, a team of seven researchers described a way to organize items that are temptingly similar to the theoretical ideal. The recent approach combines low knowledge about the earlier content of the shelf with surprising randomness.

“This is a very important problem,” he said Seth PettieIT specialist from the University of Michigan, because many data structures we are involved in sequentially, we store information. He called the recent work “exceptionally inspired [and] One of my three favorite articles of the year easily. “

Narrowing of the boundaries

So how do you measure a well -porched shelf with books? It is a common way to check how much time it takes to insert individual items. Of course, it depends on the number of items in the first place, the value usually marked by N. In the example of Isabel Allende, when all books have to move to accommodate a recent one, the time is needed proportional N. The greater NThe longer it takes. This makes it a “upper limit” with a problem: it will never last longer than the proportional time N To add one book to the shelf.

The authors of the 1981 article initiated this problem, they wanted to know if it was possible to design an algorithm with an average insertion time much less than N. And they actually proved that you can do better. They created an algorithm that was guaranteed to achieve the average proportional insertion N)2. This algorithm had two properties: it was “deterministic”, which means that his decisions did not depend on any randomness, and was also “liquid”, which means that books must be spread evenly in the subsection of the shelf in which the inserts (or deletions) are made. The authors left the question open whether the upper limit can be improved even more. For over four decades, no one managed to do this.

However, in the years of intervening improvements of the lower limit. While the upper limit determines the maximum possible time needed to insert the book, the lower limit gives the fastest possible insertion time. To find the final solution to the problem, scientists try to narrow down the gap between the upper and lower borders, perfectly until they cover. When this happens, the algorithm is considered optimal – organized confined from above and below, leaving no place for further improvement.

Latest Posts

More News