Intel's Ronler Acres Plant

Silicon Forest
If the type is too small, Ctrl+ is your friend

Thursday, January 25, 2018

Optimization Problem, Part 2

Cargo Load Planning & Optimization
I finally got my simple minded scheme to work, as in 'complete the task', only to find that it didn't work at all, meaning the distribution of boxes earned me a Delta score in the thousands as opposed to a value less than one. (You write your program and then run it on the web page and Codingame calculates your score / pulls a number out of a hat).

Reading over the description of the problem, and taking my first impression of the data, it appeared that while the volume that each truck could contain was limited, it wasn't really a deciding factor. After all, what we are really concerned with is weight. It turns out that volume IS a big factor because if you don't pack each truck as full as possible, you won't have enough room for all the boxes. So I chucked out all the bits of code related to weight and now the program is only half as long and much simpler. It runs more reliably (it runs to completion on all of the test cases) but it still gets an abysmal score.

Getting my initial version of the program running was a bit of a chore. The idea was simple enough, but the mechanics of dealing with 4 cases and keeping track of four sets of indices was more than my sleep deprived brain could handle. Eventually though I got some sleep and got it sorted out. And then I discovered that, while my scheme might have worked very well if you were actually loading boxes on trucks, it wasn't going to cut it in this modern age of squeezing every penny until it screams.

This was depressing. Since my quick are dirty scheme doesn't cut the mustard, writing a program to actually solve the problem is going to take quite a bit more work, and do I really want to invest that much effort into something that is just going to get thrown away?

This problem is a 'sponsored challenge', which means some company is behind it and the ultimate prize is you might get offered a job. I'm reasonably certain that 1) no one is ever going to hire me and 2) there are probably a zillion bright young programmers out there who are willing to invest the time and energy to solve this problem. So while it's an interesting problem, and I'm reasonable certain that I could write a program that could do a decent job of allocating loads, I'm not sure that I could make it competitive without a great deal of study and work.

If a problem is fun, that's one thing, but when it becomes work, well,that's when I want to get paid, and I don't see that happening. And for all I know, the company may just steal all the code from the contestants and use it to solve their problem and not actually hire anyone. Which is why there is a growing cadre of disgruntled programs hacking into whatever computer system appeals to them. Not that I would do that, it's too much like work.


No comments: