Assorted stuff

home

Shopping spree

16 Apr 2014

My wallet got significantly lighter today, although I tried hard to get as much as possible. For the last several weeks I've been writing this scirpt (don't follow the link, it is still a very scruffy version) to optimise my expenses. The script takes a BOM and a list of products available in shops and tries to find a subset of products that provides all materials needed (BOM) and is the cheapest including shipping. The first version I conceived was O(2n) CPU-wise, where n is the number products. With n around 40 this problem becomes practically unsolvable (at least in Python).

The second approch was made possible by a teammate of mine who gave me a dynamic programming algorithm that flips the problem and makes it O(p * 2m), where p is the number of products and m number of BOM entries (times the amount of materials, e.g. ten servos of the same kind increase m by 10 unless you declare that shops provide them in 10-packs). The first version of this alogrithm didn't count shipping (which may significantly change the solution, I saw it after my running my binary tree traversal algorithm for about twenty four hours). Unfortunately adding vendor-dependent shipping costs means (at least now) iterating over all subsets of vendors (2v). The script finishis its job in about two hours and with some more work it could run in parallel but it still can't be declared scalable. I am going to build a few other things this year and hopefully I will find some time to improve the script (we've alread got an idea of an algorithm being quite fast though a lot more memory hungry).

This post was supposed to be about the plane(s) I am going to build and not about the software I wirte. Let's what I am going to find in my mailbox soon.

Product Price
SERVO: ABC-Power S-9 (x10) 24.47 €
Falcon EPP - Morlock 17.56 €
ESC: ABC-Power 30A 2-3S 9.28 €
ABC-Power ESC Programmer 4.51 €
GOLD 3,5 mm (x10) 2.86 €
PROPSAVER: Gemfan 3mm/5,5mm/7mm two-sided (x2) 1.38 €
abc-rc shipping 3.82 €
APARATURA: Turnigy 9x 72.99 €
karambol.pl shipping 1.67 €
CELLS: LiPol 1300mAh 3S 20-30C Turnigy (x3) 32.91 €
CHARGER: Redox ALPHA v2 + PSU 25.04 €
MOTOR: EMAX CF2822 (x2) 20.94 €
Dragonfly 45 (glider)1 5.96 €
XT60 (x4) 4.38 €
CA KICKER: 200 ml Joker 2.86 €
CA GLUE: 20 ml Joker (x2) 2.86 €
PROPELLER: GWS 9x5 (x3) 2.68 €
HORN: Control horn 13,5x16 mm (x10) 1.48 €
cyber-fly shipping 3.58 €
TOTAL 241.22 €

This isn't exactly what Mikey was promising ($10 RC plane). I suppose, however, he's got sutff worth a lot more thant taht in his drawers.

Footnotes:

1

I'll make a remote drop mechanism to release it after pulling it up in the air.