For comparison:
$ time perl min_supply.pl 1 4 3 Required supply: 3 6 steps: S->X X->Z S->X X->Z S->X X->Z real 0m0.011s user 0m0.016s sys 0m0.000s $ time perl min_steps.pl 1 4 3 3 steps: S->Y Y->Z Z->X real 0m0.011s user 0m0.008s sys 0m0.004s $ time perl -e1 real 0m0.002s user 0m0.000s sys 0m0.000s
Note that I got a different solution that yours for min steps, but it's has the same number of steps.
Update: I seemed to have imagined that you said yours was slow. Ignore this post.
In reply to Re^6: Challenge: N Jugs Problem
by ikegami
in thread Challenge: N Jugs Problem
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |