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

Резултати

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

Търсене: #relationship

当前筛选 #relationship清除筛选

Living A Life Rich With Relationships (Part 6) A life full of relationships will make your life a smooth ride and not a difficult journey and a tiring one. We all know that relationships are valuable and precious and we need to take care of them so that they help us at all times and at every step. Distance in relationships at times causes situations to seem bigger than what they are. Love in relationships is the basis of a life full of strength and power. A person with spiritual strength can overcome difficult situations but the spiritual strength comes very largely with the love not only experienced from human beings but also from God. The one who is close to God is able to defend himself against negative attitudes, words and actions of others which very commonly come to test us in our lives. Also the one with the power of the non-physical love of God is able to remain stable when the physical body creates problems and is not the way it should be. Some people are able to remain stable and happy in a challenging illness much more than others because they are always under God’s canopy of protection which is full of love. Also, the person who is always holding the hand of God at every step is able to cross all problems of wealth and the role in personal and professional life and other challenges in family and at the workplace, with the power of his or her relationship with God. There are people who have lost their complete wealth in difficult financial situations of the world. But they came back with their faith and love for God in a big way and recovered their lost fortunes and damaged roles in the financial sphere of life. Lastly, if there is one relationship which is equal to all the relationships with others in your life put together or even higher, it is your relationship with God. A beautiful relationship with God makes all the other relationships beautiful and that in turn makes life full of joy and happiness and a beautiful obstacle-free existence. Relationships are thus the primary wealth of our lives and the key to a content mind, illness-free body and a successful personal and professional role. #Relationship

Living A Life Rich With Relationships (Part 5) Life without relationships is like living without strength. People who are loved a lot by others will be stronger and they will be able to cross different situations with this power. It is commonly said that love can move mountains. That can be further expanded to say love from different relationships can change the circumstances of your life from negative to positive. It’s as if relationships are a treasure and the richer we are with the treasure the more strength we have inside us. We can also challenge the world that when the world is with us, we will never drown deep in any situation, however demanding it may be. It’s as if so many people are holding your hand and helping you cross different types of situations which otherwise would not have been easy to cross without the power of their blessings. So never ever feel you are alone. This will make you susceptible to different types of situations of all types much more than if you were accompanied by many like-minded people in your life journey. People carry positive energy inside them which helps you remain stable when you are with them at every step in your life. Life throws different types of challenges at us and they can unsettle you. But people whom we love, help us in overcoming these challenges sometimes directly with their physical help and sometimes on a non-physical level through the power of their love and support on a mental level. It is different when we do not have real life tests and we do not realize the importance of our close loved ones at that time. Its only when we are tested when we realize the same. Take the example of a difficult physical illness. Knowing that you have a test paper of life that is in front of you is the first step of realization. Take two people with the same illness. The one with thousands of people’s love in his heart will at times emerge victorious sooner than the other one who has lesser love in her life but access to more and better medical facilities. That is why it is said in spiritual wisdom - blessings make you fly. (To be continued …) #Relationship

Living A Life Rich With Relationships (Part 4) Dealing with people in the right manner requires giving attention to the self at every step. E.g. if you have to interact with others in a company meeting, you will look after your external appearance and the way you look and keep yourself tidy before beginning it. At the same time, you need to look at your internal self and how tidy it is and see whether you are looking your best in terms of qualities and powers. You also need to check whether you are spiritually empowered enough to face the situation. It’s not just about the physical appearance but also about remaining focused and stable. It’s also about performing the right actions which make you worthy of praise and respect in your family and at your workplace. It is said that a good personality makes all the difference. We can change that to – a good person makes all the difference. So, personality is important but person is even more important. Role is important but soul is more important. The shirt is important but character is more important. That will make relationships work. Why are some relationships not working today? The reason is simple. Less attention on the inner self and more attention on the outer self. Also, whenever you talk to someone, ensure that the words are not only smart but also soft. Also, check that they are not only full of energy but also enthusiasm. Bring power in your words but also peace. Make them sweet and not only sharp. Also, check your words and see that are not only full of authority but also loveful. Also do not forget to make your words full of respect and not ego. This way people will appreciate you not only for how you present yourself physically but they will also be impressed by your spiritual self. A life rich with relationships will happen when you remain polished in not only everything you do but also in how you do it and what is the energy of your actions on a subtle level. (To be continued …) #Relationship

Living A Life Rich With Relationships (Part 3) Loving everyone for their specialties is the best way to create beautiful relationships. It’s good to see one specialty in everyone you come across and interact with each day. Suppose your parent has a virtue of loving everyone at home and remaining quiet amongst little issues at home, that is the virtue of tolerance. Learn from him or her and become like that. This is the art of imbibing or picking up virtues. It is not only seeing others’ qualities which is also a sign of love, but making that quality yours. Also, suppose your brother or sister is good at dealing with people, make that quality yours and become like him or her. This is not bowing down in front of the other person. But, on the other hand, it is remaining in your self-respect and giving respect to the other person. The other person will do the same in return. This is called true love and it is what brings people together in a beautiful bond of togetherness. It’s not about copying people but making people feel valuable by making their qualities yours. It is commonly said in spiritual wisdom – give blessings and take blessings. But another and similar act is - give qualities and take qualities. It binds people together and it creates an energy of trust wherever there are groups of people, whether in the family or at the workplace or in friend circles. Also, whenever you meet someone, it is important to greet people with a warm smile and beautiful gestures. By doing this, people experience happiness not only from our words but also through our actions. Your beautiful smile can make another person’s day. Also, remembering each one’s specialties and telling them to others is a beautiful way of gaining love and respect from the other. So make it a point to praise everyone with a deep heart and with a pure intention and not just artificially. You will see how people will respond by offering you their cooperation and help at every step. (To be continued …) #Relationship

Living A Life Rich With Relationships (Part 2) Relationships are made of gold i.e. they are extremely valuable. They can be stolen easily if we do not take adequate care of them. Remember it is the child’s relationship with its mother in the womb which nourishes the child and brings it into this world. Later it grows up and comes into different relationships like ones with its father, brothers and sisters, friends, life partner, children, office colleagues and many more. So life is all about building the right relationships at the right time and taking forward one step at a time. It’s not about living alone and at the same time to make relationships work, a good relationship with oneself is extremely important. As per spiritual wisdom, a good ruler of the self is able to achieve success in handling relationships well. What that means is that techniques like meditation and mind relaxation make you better equipped to handle relationships with others properly. People whose minds are relaxed and focused because of these techniques, are able to concentrate their mental energies on improving their relationships and make them full of love and happiness and free from obstacles. Loving others is only possible when we love ourselves and loving ourselves means that since we are our own best friend first, we take care that our thoughts, words and actions are not only right but extremely perfect. Such people then naturally tend to love each one in their personal and professional groups. Don’t forget that God is loved so much by everyone universally all around the world because He has such a beautiful personality and a nature full of love for others. So perfect people will automatically attract love from others. They will easily and absolutely naturally make others comfortable and content with their way of talking and performing actions.Live well and love well is the slogan of their beautiful lives. (To be continued …) #Relationship

Living A Life Rich With Relationships (Part 1) We all live a life full of relationships of different types. Starting from the morning till the night, relationships are a constant support system for us and almost like a lifeline. Imagine for once that you were alone in this world and you would have to spend a complete lifetime with no one to share your love and joy with. How would such a life be and how does it sound? Interesting? Not at all. So relationships are like life’s oxygen. They are a source of strength for us and of course a source of love, that a life without them cannot be imagined. Also, it is relationships which give meaning to life, whether it is relationships with people or even with God. Love is the primary virtue of the world and it is the most liked emotion of the world. Even God brings change in us on the basis of love. The soul changes itself because of love for God. Even power in the soul is filled by God, because He loves us immensely. All the work that God does on us and helps us become better human beings is because of His love for us. We are indebted to Him for that and then in return for all the love He showers on us, we become further determined to bring change in ourselves. So love with God works both ways and is the basis of a beautiful relationship with Him. Also, people whom we come in contact with in our relationships come close to us primarily because of the virtue of love. Love is the foundation of strong and stable relationships. (To be continued …) #Relationship

Quiet World 🍁

@QuietWorld · Post #7504 · 16.07.2020 г., 23:06

One of the saddest connections is the rebound relationship. You'reusingone person to try to unlove another. There is nothing pure or honest in what that relationship is, or ever will be, as you carried into it an unhealed bond to what was. Take time to cleanse, to heal, to renew, to grow, to become. #love#relationship#reminder @quietworld🍃

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