Random Post
Recent Posts
Recent Comments
Frits on Enigma 773: Duodecimal | |
Jim Randell on Enigma 773: Duodecimal | |
Brian Gladman on Enigma 773: Duodecimal | |
Frits on Enigma 773: Duodecimal | |
Frits on Enigma 773: Duodecimal | |
Frits on Enigma 773: Duodecimal | |
Frits on Enigma 773: Duodecimal | |
Jim Randell on Enigma 773: Duodecimal |
Archives
Categories
- article (11)
- braintwister (16)
- enigma (1,715)
- enigma-book-1982 (70)
- headscratchers-book-2023 (70)
- microteasers-book-1986 (11)
- misc (7)
- project euler (2)
- puzzle (90)
- puzzle# (249)
- site news (83)
- sphinx (4)
- tantalizer (254)
- tantalizer-book-1970 (40)
- teaser (7)
- today (1)
Site Stats
- 346,347 hits
The following Python program runs in 45ms.
Solution: FIFTEEN = 4043551.
@geoffrounce: I’m a curious how you time MiniZinc models since it’s so much faster than when I run them. For you model my fastest machine runs in 122ms. This includes both the flattening to .fzn file and solving.
Here’s how I time it using Gecode (on a Linux Ubuntu machine) where the model is named test71.mzn:
It is then converted (by minizinc) to these two command:
Perhaps you have that fast machine…
@hakank: I run the code on a laptop with an I7 64-bit processor and Windows 10 Pro. I run it several times in the MinZinc IDE, mostly with the Geocode bundled solver. Usually the run-time improves and I take the the best time. For most Enigma puzzles I seem to get between 60 and 90 msec with this method.
@ Jim: Can you say what sort of run-times you get for MiniZinc and by which method?
I use the built-in [[
time
]] function of my shell (Z-shell) to measure the run time of a command line. That way I can get a reasonable comparison between different implementations.In this case I saved the MiniZinc model to a file and executed it using the [[
mzn-gecode -a
]] solver like this:I run the command a number of times (usually 16 times for a program that takes less than 1 second), and report the best elapsed time.
So, according to my methodology, the model Geoff posted (7th August 2017 at 4:04pm) executes in 84ms.
My timings are done using a 13″ MacBook Pro (Late 2011 model, with a 2.4 GHz Intel Core i5 processor). This is the same laptop I’ve been using since I started Enigmatic Code, so timings should be roughly comparable between my posts (although software has been updated during that time).
@geoffrounce: Thanks. I also usually run it a couple of time and then take some average of the values. By skipping the call to solns2out it saved about 30ms, to 90ms.