Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I'm also interested in knowing what the set of all possible layouts with zero stress are for a given bag of pieces. It feels like it might be an easier question to answer than what the article answers: trying to approximate, below a boundary of acceptable stress, a pre-existing shape with only certain pieces.

I think I would construct a tree of combinations of pieces, where each node of the tree was weighted with a vector of three elements: the X and Y position of the end of the piece relative to the start, and the angle of the track's direction at the end of the piece. Each subsequent piece added to the track (represented by a new layer of depth of the tree) would sum the previous weight vector. At any point in the tree where the vector sums to zero, you know you've completed a full loop and so terminate that branch of the tree there. After searching through the full factorial of the number of pieces you have, you can select all the zero-weight nodes to get the possible layouts. It seems as if the article uses abstract 'it turns left' and 'it turns right' pieces, rather than arbitrary sizes and angles, and doesn't use any tree-based brute-forcing to find possible answers.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: