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

Резултати

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

Търсене: #development

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

@balinews · Post #462 · 12.07.2025 г., 12:15

🏭Bali reduces dependence on Java: the island will build its own power plants 📰 Bali is on the verge of energy independence: the authorities are launching several projects to build their own power plants. Gas stations in Denpasar and Gianyar, as well as two new units on the north coast, will provide the island with 1.5 GW of power by 2029. ℹ️ This will make it possible to abandon vulnerable underwater cables from Java and eliminate the risk of large-scale blackouts. Residents are being urged to support the initiative by installing solar panels and switching to renewable energy sources. #development@BaliNews

Hashtags

The Telegram Times

@TheTGTimes · Post #142 · 11.11.2023 г., 10:14

📰The popular Android developer, Xaxtix, parted ways with Telegram. In the release of the latest versions of Telegram Android, we find that Ilya Samorodov is ​​no longer active in the development of Telegram. Read more on iDubTG #Development 👉The TG Times

Hashtags

Bali News

@balinews · Post #484 · 21.08.2025 г., 11:15

🎰Bali governor rejects casino construction despite promised 100 trillion rupiah 📰 Bali Governor Wayan Koster has stated that he rejects the proposal to create a legalized casino, even despite the potential profit of 100 trillion rupiah. 🛕 According to him, the refusal is dictated by the principles of cultural tourism development, on which the island's economy is based. 🤔 At the same time, according to some analysts, the location of casinos in new areas, for example, near the northern airport under construction, could accelerate the development of these territories. And if it later turns out that casinos really do interfere with cultural tourism, they can always be closed. #places#development@BaliNews

Bali News

@balinews · Post #466 · 19.07.2025 г., 11:35

🌊Bali will build a kilometer-long promenade from Changgu to Cemagi 📰 A kilometer-long promenade will appear along the coast between Canggu and Cemagi by 2026. It will rehabilitate the eroded shoreline, create a wide pedestrian path and recreational areas. 📍 The cultural center will be the area near the Batu Ngaus temple, where a stage for kechak dances is planned. Traders will be distributed among the new pavilions to make the beaches convenient for both visitors and entrepreneurs. #places#development@BaliNews

Bali News

@balinews · Post #455 · 06.07.2025 г., 14:05

🏭The largest battery production project in Indonesia has begun 📰 Contemporary Amperex Technology Co. Limited (CATL), the world's largest manufacturer of batteries for electric vehicles, has begun a large-scale project in Indonesia to create production facilities and an ecosystem related to the production of electric vehicles. 🧲 The investment is estimated at $6 billion. ℹ️ According to Indonesian Minister of Energy and Mineral Resources Bahliola Lahadalia, this is the first project of its kind and scale in the world. The launch of electric vehicle battery production is one of 18 large-scale industrial projects planned for implementation in Indonesia in the coming years. Together, they are estimated to be worth nearly $45 billion. The projects will be implemented in the areas of nickel and bauxite production, as well as gasification, oil refining, and the creation of oil storage facilities. Some of the initiatives will affect fishing, agriculture, and the forestry industry. #business#development@BaliNews

djangoproject

@djangoproject · Post #136 · 01.09.2016 г., 19:13

http://astrocodeschool.com/ Astro Code School is respected by tech firms and universities for a reason: we’re founded and staffed by a leading #web#development firm, Caktus Group. Our team interacts daily with the inner workings of Caktus so we see the trends and best practices that will make you job ready. If you’re prepared to launch a new career with the real-world technical depth employers seek, Astro is right for you.

Go

@golang · Post #76 · 29.01.2019 г., 13:16

Errors in Go: From denial to acceptance Learn how to stop worrying and love error handling in Go. Author of Overmind and imgproxy describes his journey through all five stages of Kübler-Ross model—from denial to acceptance—as he went deeper into the language, and shares his favorite patterns for dealing with errors in Go code. #development#language https://evilmartians.com/chronicles/errors-in-go-from-denial-to-acceptance

Go

@golang · Post #73 · 17.01.2019 г., 15:59

Ok, I’m online again so Happy New Year for everyone 🎈 The first article that I want to share this year is about channels design in GoLang, their structure and internal operations. Enjoy the reading! #development#language https://codeburst.io/diving-deep-into-the-golang-channels-549fd4ed21a8

Go

@golang · Post #71 · 09.10.2018 г., 08:39

Hello, there! One GoLang feature proposal about immutability is here 🙂 It’s a really interesting idea with pros and cons inside, it has a good explanation, use cases and examples for the following proposed changes: fields, arguments, variables, return values, methods reference types (Pointers, slices, maps, channels). This approach merits attention if you are interested in paths of GoLang development, so, have a good reading! 😉 #language#development https://github.com/romshark/Go-1-2-Proposal---Immutability

Go

@golang · Post #62 · 22.05.2018 г., 16:28

“Should I Rust, or Should I Go” - this is an article with a quick comparison of Golang and Rust code styles, features and conveniences of usage. #language#development https://codeburst.io/should-i-rust-or-should-i-go-59a298e00ea9

Go

@golang · Post #57 · 11.04.2018 г., 13:25

Good day 👋 I would like to share following 7 advices in short article by Kartik Khare how to increase your code quality in GoLang. Of course, before using it you should understand reasons for each advice in the post. As example Kartik writes: #6 Use int as keys instead of strings in Map. It’s a good way but here we can get optimization for optimization 🤔 #development#language https://codeburst.io/how-to-optimise-your-go-code-c6b27d4f1452

123•••10•••1213
ПредишнаСтр. 1 от 13Следваща