in reply to Re^8: Data visualisation.
in thread Data visualisation.

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.

Replies are listed 'Best First'.
Re^10: Data visualisation.
by Anonymous Monk on Jan 05, 2014 at 18:36 UTC
    Strange ... wrong formula but correct values???

    s/2/3/ ;-)

Re^10: Data visualisation.
by BrowserUk (Patriarch) on Jan 05, 2014 at 18:54 UTC
    so the number of calls to chk_triangle_inequality during the exhaustive check for your dataset is n!/((n-2)!*2!). For your dataset, it's 680 calls, and 2024 for Dirk80's dataset.

    Indeed. I found completely the wrong formula.

    (BTW: it is simply all combinations of 3 from N; so if you have a calculator with an nCr button ... )


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.