my colleague offered me an exercise from the online judge’s website, which basically posed the problem of solving the evacuation graph in a small town.
I do not need an answer (and I do not want it). I just need advice on which the best approach to solving it has been since it became new to such problems.
the problem consists of urban buildings with workers and shelters for fallout in the event of a nuclear attack. I have to build an algorithm that will assign the workers of each building to one or more shelters for radioactive fallout, but so that some shelters do not become too crowded, while others remain almost empty (otherwise I would just make the workers move to the nearest one).
The problem is this: http://acm.timus.ru/problem.aspx?space=1&num=1237
if offline it will be stored in the cache version of Google: http://webcache.googleusercontent.com/search?q=cache:t2EPCzezs7AJ:acm.timus.ru/problem.aspx%3Fspace%3D1%26num% 3D1237 + vladimir + kotov + evacuation + problem & cd = 1 & hl = pt-PT & ct = clnk & gl = pt
what I have done so far, for each building, get the closest shelter and move the number of workers from this assembly equal to the throughput. then move on to the next building. but sometimes the number of workers is more than shelter, in this case, after I iterating through each building, I just repeat and then apply the same algorithm again until there are 0 workers in each building, the problem is that this is unlikely Is there a better way to solve it.
, , , , .
.