I've heavily reworked and improved the algorithm now. It should find more solutions and tries harder to find the most optimal one.
http://pastebin.com/kP9RXd9a
Unfortunately it still cannot find rings between 10.4 and 23.5. Rings and Cones seems to find one but I don't think this is anything but a rare corner case anyway... and even then Rings and Cones prints a 5 ring solution.
The algorithm now gets this for 10 - 23.5:
Rings and Cones gets a 4 ring solution. I don't think I have the patience to improve this any further.
Plus this does have the advantage of being much faster than Rings and Cones at finding the solutions!
I think I'll make a sample program using this algorithm so that people can try it out.
EDIT: Updated. Turned out that r1 / 2 is a particularly good splitting point since the area between r1 / 2 and r1 can be covered with a single ring1. This chomps another ring off the 10 - 23.5 case:
This is in fact the other of Rings and Cones' 4-ring answers, albeit the rings are in different order the numbers are the same. Not too bad, mmh?
http://pastebin.com/kP9RXd9a
Unfortunately it still cannot find rings between 10.4 and 23.5. Rings and Cones seems to find one but I don't think this is anything but a rare corner case anyway... and even then Rings and Cones prints a 5 ring solution.
The algorithm now gets this for 10 - 23.5:
Code:
Ring 10, scale by 1 (10 -> 11)
Ring 1, scale by 11 (11 -> 22)
Ring 44, scale by 0.5 (22 -> 22.5)
Ring 45, scale by 0.5 (22.5 -> 23)
Ring 46, scale by 0.5 (23 -> 23.5)
Rings and Cones gets a 4 ring solution. I don't think I have the patience to improve this any further.
Plus this does have the advantage of being much faster than Rings and Cones at finding the solutions!
I think I'll make a sample program using this algorithm so that people can try it out.
EDIT: Updated. Turned out that r1 / 2 is a particularly good splitting point since the area between r1 / 2 and r1 can be covered with a single ring1. This chomps another ring off the 10 - 23.5 case:
Code:
Ring 10, scale by 1 (10 -> 11)
Ring 22, scale by 0.5 (11 -> 11.5)
Ring 46, scale by 0.25 (11.5 -> 11.75)
Ring 1, scale by 11.75 (11.75 -> 23.5)
This is in fact the other of Rings and Cones' 4-ring answers, albeit the rings are in different order the numbers are the same. Not too bad, mmh?