BrowserUk:

We're only picking three points for each triangle, and the point order doesn't matter, so the number of calls to chk_triangle_inequality during the exhaustive check for your dataset is n!/((n-3)!*3!). For your dataset, it's 680 calls, and 2024 for Dirk80's dataset. If it were trillions of checks, I'd've pressed ^C long before it ended. ;^D

Currently the check is pointless busywork, but since TSP problem is interesting to me, and printing interesting clues might spur ideas, so I threw it in for fun. I frequently litter my programs with print statements showing intermediate steps, or call functions whose results may be interesting. I delete it when it proves valueless to me, and then clean it up when I'm through. But I can't always predict beforehand which functions I'll find to be junk.

For example, when I was playing with your Bloom filter example, I put various print statements in my program, and noticed that one of the values was approaching an "interesting" value, allowing me to figure out the distributions.

Update: As AM said, wrong formula! Fixed.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


In reply to Re^9: Data visualisation. by roboticus
in thread Data visualisation. by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.