TGTGInsightтелеграм анализLIVE / telegram public index
← Такты, стеки, два колеса

TGINSIGHT SIMILAR POSTS

Намери подобно съдържание

Изходен канал @clockstackwheels · Post #1084 · 9.04

В общем, была задача на оптимизацию плана работ: есть набор заказов, и в каждом N тасков. Таски могут зависеть друг от друга или нет, имеют длительность и тип. Ещё есть M работников, каждый из которых может выполнять таски только определённых типов, причём, у каждого своя скорость. Если все таски в заказе выполнены, фирма получает сколько-то денег. У заказа есть дедлайн, за просрочку штраф (за каждый день просрочки), который вычитается из цены заказа. И ещё фирма тратит деньги за каждый день своей работы независимо от того, как загружены её сотрудники (то есть просто платит зарплаты по сути). Ещё важен учёт праздников и выходных. Нужно заработать на определённом наборе заказов и работников как можно больше денег. Полный текст задачи и код программы проверки есть в репозитории. Эта задача является изменённым заказом, который мы с напарником решали в реальной жизни: оптимизация работы печатных станков для типографии. Правда, тогда и мы справились так себе, и заказчик в итоге сначала захотел всё вручную сам делать, а потом и вовсе похоронил проект при смене директора. !!! Не читайте дальше, если хотите сначала попробовать решить самостоятельно, потому что я сейчас опишу эффективные подходы и результаты. ________________________________________ Так вот. Мы с другим экспертом Андреем сразу сели и написали разные варианты, чтобы задать шкалу, по которой будем оценивать решения команд. За пару часов я собрал примитивный жадный алгоритм, который сортировал заказы по прибыльности и укладывал в сетку кое-как, это дало нам нижнюю оценку. Мой алгоритм заработал ~75 млн виртуальных рублей, мы решили для оценки поставить нижней границей 40 млн. То есть всё, что ещё ниже, оценивалось в ноль баллов за качество оптимизации. Затем Андрей закрылся дома на три дня и вышел на свет со сложным жадным алгоритмом, который очень хитро сортировал заказы и очень хитро укладывал их в сетку, попутно выбирая разные способы этой укладки в зависимости от конкретного заказа. Это позволило заработать ~275 млн рублей. Мы сделали верхней границей для оценки 280 млн. К сожалению, в итоге только две команды из десяти прошли нижнюю границу, заработав, соответственно, ~91 и ~105 млн. К верхней границе не приблизился никто. И у четырёх команд алгоритм вообще не смог уложить без нарушений задачи в сетку (то есть, например, произвольно менял длительности, накладывал задачи друг на друга, давал одному работнику две задачи в один момент и так далее). Важной ошибкой команд, на мой взгляд, являлся тот факт, что никто не воспользовался возможностью запустить алгоритм на несколько минут и дать ему поработать. По условиям задания, можно было тянуть до 5 минут на одну оптимизацию, но по факту решения команд отрабатывали за единицы и десятки секунд. На самом конкурсе, пока команды работали, я решил попробовать сделать быстрое (по времени написания) но эффективное решение. Сначала попробовал жадную сортировку + доведение до лучшего варианта методом имитации отжига. В качестве нового состояния я просто менял местами заказы целиком. Этот вариант работал пару минут и дал мне около ~200 млн дохода. К слову, команда-лидер использовала такой же подход, просто не докрутила число итераций и температуру. Ну и потом я взял готовую либу по реализации классической генетики с особями и скрещиванием. Особью был массив с приоритетами заказов (которые конечно же нужно было аккуратно уложить чистым алгоритмом). Тип скрещивания: scattered. Всего 15 поколений по 20 особей, и это за минуту-полторы давало ~230-240 млн. Считаю, что для конкурса это самый лучший выбор: пишется одним человеком за день и даёт почти максимум, при этом легко настраивается на нужную длительность работы, легко параллелится. Ну а потом уже дома я посидел и накодил свой вариант сложного жадного с плавающим окном перебора отсортированных заказов и плавающей же укладкой по работникам. Такая штука за две минуты зарабатывает ~281 млн. Но за три дня в условиях стресса я бы такое не сделал, скорее всего. #dev

Hashtags

Резултати

Намерени 35 подобни публикации

Търсене: #roads

当前筛选 #roads清除筛选
Bali News

@balinews · Post #516 · 24.10.2025 г., 13:03

🛵 Two female tourists fell from the Yellow Bridge on Nusa Lembongan 📰 They were riding a motorcycle across the bridge connecting Nusa Lembongan and Nusa Ceningan when they lost control, collided with the railing, and plunged into the water. The police have urged local authorities and road services to urgently repair the bridge, which is in a state of disrepair and poses a threat to all road users. #accidents#roads@BaliNews

Bali News

@balinews · Post #278 · 28.12.2024 г., 10:01

🪨A road that collapsed near Ubud has blocked a tourist route 📍 A main road collapsed in Pedjeng village in Tampaksiring district, Gianyar. The collapse was 25 meters deep and 15 meters wide. 🚧 Authorities have completely closed the road as it was impassable for both cars and motorcycles. 📰 The Public Works Department is expected to restore the collapsed road as soon as possible. It is of great importance to locals and tourists alike. Passersby now have to make a significant detour. Farmers who used to use this route to transport their crops are also affected. @BaliNews #accidents#roads

Bali News

@balinews · Post #389 · 11.04.2025 г., 14:11

🛣Gilimanuk-Mengvi highway decided to split into three parts 📰 The Gilimanuk-Mengvi highway is in the news again. This time the authorities, apparently tired of finding investors and buying back land, decided to change their approach. 🔎 They have divided the 100-kilometer toll road into three sections and are going to work with each of them separately, namely: Section 1: Gilimanuk-Pekutatan, which is 53.6 km long. Section 2: Pecutatan-Soka, 24.3 km long. Section 3: Soka-Mengvi, 18.9 km long. 📆 It is scheduled to be completed in 2028. @BaliNews #roads#projects

Bali News

@balinews · Post #264 · 16.12.2024 г., 09:20

🛣Construction of a new highway to western Bali will resume in 2025 📰 Minister for Infrastructure Affairs Dodi Hanggoto said that construction of the Mengwi-Gilimanuk highway will continue in 2025. The minister emphasized that President Prabowo Subianto's plan to develop the north of the island, including the construction of a second airport there, cannot be fulfilled without a new road. 🔎 The road will be 97 kilometers long and the potential cost of construction is $1.58 billion. The project is now at the stage of approval of the general contractor. 📆 Also last week, Governor Wayan Koster confirmed that construction of the highway will begin in mid-2025. Until then, the local government is committed to buying the land for future construction. ℹ️ On September 10, 2022, authorities had already announced the start of construction, but after that, the project stood up due to lack of funding. We would like to believe that the new authorities will find the necessary funds and the project will still be realized. @BaliNews #projects#roads

Amazing Geography 🌍

@amazingeo · Post #333 · 04.10.2025 г., 20:31

🌍 The world’s highest paved international road, the Karakoram Highway, climbs over 4,700 meters linking China and Pakistan. Its route carves through mountains shaped by ancient glaciers and landslides. ✨ #transport⚡#mountains⚡#roads⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #554 · 03.01.2026 г., 20:31

🌍 The Trans-Amazonian Highway spans over 4,000 kilometers across Brazil, but much of it remains unpaved and nearly impassable in the rainy season, highlighting the challenges of transport geography in remote regions. ✨ #infrastructure⚡#roads⚡#rainforest⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #633 · 15.02.2026 г., 12:31

🌍 The world’s longest continuous road, the Pan-American Highway, stretches about 30,000 kilometers from Alaska to Argentina. Its route is interrupted by a wild jungle gap called the Darién Gap. ✨ #transport⚡#infrastructure⚡#roads⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Bali News

@balinews · Post #165 · 05.09.2024 г., 10:30

🛣Bali will have new bus routes and toll roads 🧳 The Kintamani region of Bali is gaining popularity with touristsand island authorities are looking for ways to make traveling to this remote area easier. 📍 The Bangli Transportation Authority has proposed adding new bus routes to Kintamani to make it easier for tourists to get there. There are plans to open a new Damri bus route that will connect Kintamani to Ubud via Payangan and Gianyar. 🪙 In southern Bali, congestion is also being tackled by building new roads. Indonesian Tourism Minister Sandiaga Uno revealed the construction of a new toll road that will connect resorts in southern Bali with northern regions. The project has been approved by the central government and a tender for construction will be held in 2025. 📆 The work will temporarily worsen traffic congestion in the Kuta, Jimbaran and Baypas Ngurah Rai and Labuan Sait areas. Travelers are advised to plan their trips in advance and take into account delays in the Bukit Peninsula area from September. @BaliNews #roads#transport#tourism

Bali News

@balinews · Post #147 · 20.08.2024 г., 09:02

🛣Transportation changes in Bali and their implications 📆 Next month sees the launch of several infrastructure projects that, while intended to improve the traffic situation in the long term, could make it much more difficult in the short term. These include: 1 - The start of construction of the metro, namely its first section between the airport and Kuta. 2 - The construction of two new underground interchanges: one in Sanur, at the intersection of Tohpati and Bypass, the second – the exit from Bypass towards Uluwatu. 3 - The ongoing mass paving of storm drains and sidewalks in central Bukit. ❓What should tourists do? The solution for tourists going to Bali anytime soon is to choose self-sufficient neighborhoods where you don't have to drive anywhere and everything can be done on foot. Plus, instead of staying for a week or more in one place, travelers divide their vacation into 3-4 days in one location and then move on to other places of interest. A classic set might look like this: Uluwatu/Bingin for beach vacations and beautiful sunsets, Ubud for cultural vacations, and north Bali for a couple days for unique nature. @BaliNews #roads#transport#tourism

Bali News

@balinews · Post #79 · 07.06.2024 г., 12:00

🛣Bali's big toll road project is back on the agenda 👍 One of Bali's biggest infrastructure projects resumes this month. Development teams have been given permission to proceed with work on the Gilimanuk-Mengwi toll road, which will connect the heart of the island to the far west, the Java Ferry. In June 2024, after nearly two years of delays and postponements, the land acquisition process will be allowed to continue. Construction itself will begin as early as September. @BaliNews #goodnews#transport#roads

Bali News

@balinews · Post #365 · 25.03.2025 г., 09:16

⛔Bali Tol Mandara toll road will close for 32 hours during Nyepi 📰 PT Jasamarga Bali Tol management company PT Jasamarga Bali Tol announced that it will temporarily close access to the Bali Tol Mandara Toll Road for 32 hours due to the Nyepi celebration on March 29, 2025. 🚧 The road will become inaccessible on Friday, March 28 at 23:00 and will reopen on Sunday, March 30 at 07:00. Although the road will be closed to the general public, passage will be free for emergency services and in case of non-emergency situations. @BaliNews #transport#roads#holidays

ПредишнаСтр. 1 от 3Следваща