Faster WordCrams? An Experiment

Simulated annealing is a programming trick for quickly packing a bunch of things together. It’s based on the idea of annealing, where (as I understand it) a metal is heated, which gives the molecules enough energy to wiggle, then cooled slowly, which lets the molecules settle into a denser arrangement.

I’ve been wondering for a while whether this could make WordCram faster. It seems well-suited to the problem – the heart of WordCram is packing non-overlapping shapes together.

So I made this Processing experiment sketch, which uses simulated annealing to arrange circles.

I think it works pretty well – it can arrange 200 circles of different sizes along a line in under a second. (My first experiment was a lot slower, which gives you an idea how powerful this trick can be – once you get it right.)

About these ads
This entry was posted in improvements. Bookmark the permalink.

3 Responses to Faster WordCrams? An Experiment

  1. James says:

    So you have experienced the power if SA bu are you going to update WordCram?
    BTW: What kind of algorithm are you currently using for WordCram?

    Best regards

    • I’m still playing with it, and it does seem promising, but spare time is scarce.

      Right now, WordCram uses pretty much the algorithm laid out by Jonathan Feinberg in his chapter from Beautiful Visualization, which he links to from his blog.

  2. Pingback: WordCram 0.5.5 released | WordCram.org

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s