Live data from Hacker News

My two year old taught me constraint solving

thecomputersciencebook.com

31–39 of 39 posts

Re: My two year old taught me constraint solving

#32
post #5

While similarly playing brio with a two year old, I thought about a different dimension not mentioned here - super loose tolerances make the search space really weird. In true 2-year-old fashion, my kid would bend the rules as much as possible by literally forcing pieces to the edge of their tolerance to make things fit that shouldn't fit. 8 piece circle yea, cool, but with a sufficiently old brio set handed down for…

My son was really into Brio trains when he was young, and I wrote a program to visually design layouts by placing track segments one after the other. The program took that tolerance into account, and gave a score to the layout based on how much it had to force the pieces together. I had the idea of adding some automation to design complex networks but that never materialized.

Re: My two year old taught me constraint solving

#34
post #16

My three year old taught me something he saw on a YouTube video: you can search through a maze and find your way out just by keeping your right hand on the wall at all times and continuing till exit. Does a DFS.

Another nifty maze solving trick: Using flood-fill in Paint or some such, starting at the entrance, paint the wall on one side of the entrance red, and the other blue. You'll find that the border between the red and blue sections (the path where one wall is red and the other is blue) is the path to the exit. If there are loops, then you'll end up with uncolored squares, but you can just treat those as blue if you follow the red edge.

Re: My two year old taught me constraint solving

#35
post #5

While similarly playing brio with a two year old, I thought about a different dimension not mentioned here - super loose tolerances make the search space really weird. In true 2-year-old fashion, my kid would bend the rules as much as possible by literally forcing pieces to the edge of their tolerance to make things fit that shouldn't fit. 8 piece circle yea, cool, but with a sufficiently old brio set handed down for…

Why would that be a good interview question?

So far as I can figure, it would not haha. There's a reason why it's still just a hypothetical on my backburner of interview questions

But you have to think about something after hours of brio.

Re: My two year old taught me constraint solving

#36

This attempt at humble bragging about how smart your two year old is was not necessary for this article. There does not need to be a constant game of trying to 1 up other parents by bragging about how much farther ahead your kid is compared to others.

If the comment from the 2yo correcting him about oblong vs. oval wasn't enough to trip your satire detector, 'graph with two cycles' should have blown it up. And now I realize that your comment 100% had to be sarcasm and I'm a fool for responding. At least I didn't downvote

Re: My two year old taught me constraint solving

#38
post #5

While similarly playing brio with a two year old, I thought about a different dimension not mentioned here - super loose tolerances make the search space really weird. In true 2-year-old fashion, my kid would bend the rules as much as possible by literally forcing pieces to the edge of their tolerance to make things fit that shouldn't fit. 8 piece circle yea, cool, but with a sufficiently old brio set handed down for…

I did cover it and had a toggle for it in the visualisations but decided to cut it out because the article was long enough already. There's maybe still a reference to the "vrio system" lurking in it.

My understanding -- correct me if wrong -- is that this hugely complicates things because the search space expands so much. If you imagine three straight pieces in a row, with vrio they now form a fan of possible positions. Then with corners and so on you have a near infinite amount of wiggle room. To do it accurately you probably need to map out the physical space a given connector can move within, but for the visualisation I just loosened the "connectors must align" rule to be "connectors must be within 6mm of each other", which is wrong but fairly close.

Re: My two year old taught me constraint solving

#39
post #5

While similarly playing brio with a two year old, I thought about a different dimension not mentioned here - super loose tolerances make the search space really weird. In true 2-year-old fashion, my kid would bend the rules as much as possible by literally forcing pieces to the edge of their tolerance to make things fit that shouldn't fit. 8 piece circle yea, cool, but with a sufficiently old brio set handed down for…

> a good way to map a set of pieces laid out with given tolerance ranges for piece, see if it can connect, etc.

Märklin C track needs this.

Post reply on HN