Skip to main content

Timeline for Build an Electrical Grid

Current License: CC BY-SA 3.0

40 events
when toggle format what by license comment
Jan 12, 2018 at 1:05 vote accept Colera Su
Dec 9, 2017 at 2:05 comment added Οurous Congratulations on winning the first bounty!
Dec 9, 2017 at 1:19 history bounty ended Colera Su
Dec 8, 2017 at 20:14 comment added Οurous @AndersKaseorg I'll get started then, thanks.
Dec 8, 2017 at 14:30 history edited Colera Su CC BY-SA 3.0
deleted 47 characters in body
Dec 8, 2017 at 14:07 history edited Anders Kaseorg CC BY-SA 3.0
Document complexity
Dec 8, 2017 at 14:00 history edited Anders Kaseorg CC BY-SA 3.0
Some explanation
Dec 8, 2017 at 13:52 history edited Anders Kaseorg CC BY-SA 3.0
Even faster algorithm
Dec 8, 2017 at 12:03 comment added Anders Kaseorg @Οurous The degree of originality in your answer depends on the degree of originality in your answer, I guess?
Dec 8, 2017 at 11:53 history edited Anders Kaseorg CC BY-SA 3.0
Small optimizations
Dec 8, 2017 at 11:21 comment added Οurous @AndersKaseorg Sorry, SMAWK (autocorrect). I'd like to use it as a base for a solution, but as you used it first, I was asking if you'd object / feel like I was encroaching on your answer. It wouldn't be a literal translation of your solution (unlike one of the C ones).
Dec 8, 2017 at 11:21 history edited Anders Kaseorg CC BY-SA 3.0
Remove unnecessary &
Dec 8, 2017 at 10:51 history edited Anders Kaseorg CC BY-SA 3.0
Small optimizations
Dec 8, 2017 at 10:28 history edited Anders Kaseorg CC BY-SA 3.0
Small optimizations
Dec 8, 2017 at 10:10 comment added Anders Kaseorg @ColeraSu Here’s a third algorithm that’s even faster!
Dec 8, 2017 at 10:10 history edited Anders Kaseorg CC BY-SA 3.0
Even faster algorithm
Dec 5, 2017 at 1:57 comment added ngn @AndersKaseorg ok, this is better - only ~50% slower than C
Dec 5, 2017 at 1:45 comment added ngn @AndersKaseorg you guessed correctly, mine: 1.14.0, tio: 1.21.0
Dec 5, 2017 at 1:21 comment added Anders Kaseorg @ngn It compiles fine at the TIO link. Perhaps your rustc version is too old?
Dec 4, 2017 at 23:57 comment added ngn @AndersKaseorg The current Rust source doesn't compile (or am I doing something wrong?), so I tested against the old source. The C translation I posted is about twice as fast.
Dec 4, 2017 at 23:32 comment added ngn @AndersKaseorg Strip takes it from a few MB down to hundreds of kB. For comparison, my binary is a little more than 3 kB but I did go out of my way to get rid of libc.
Dec 4, 2017 at 23:17 comment added Anders Kaseorg @ngn Wow, this was definitely not intended to be an introduction to Rust. Perhaps you don’t realize how little these abstractions actually cost (and that they are not “imposed”), but you’ll find that out soon enough. To make your comparison fair, I’ve gone and turned off bounds checking on the vector accesses. As for binary size, did you try strip?
Dec 4, 2017 at 23:12 history edited Anders Kaseorg CC BY-SA 3.0
Skip bounds checking
Dec 4, 2017 at 22:02 comment added ngn @AndersKaseorg My only experience with Rust is this post, a few examples and a presentation on YouTube. First impressions: too verbose, imposes unnecessary abstractions, static typing only gets in the way. To be fair, Rust binaries are surprisingly fast despite their size, and I find rustc's error messages helpful. I'm actually trying to rewrite your code in C (not my favourite language either - I'm an APL/J/k fan) to see if it's any faster and I'll post as non-competing it if I'm successful.
Dec 4, 2017 at 21:08 comment added Anders Kaseorg @ngn What do you have against Rust? :-(
Dec 4, 2017 at 15:46 comment added ngn @AndersKaseorg Impressive! The algorithm is brilliant, the programming language - not so much.
Dec 3, 2017 at 14:39 comment added Colera Su Wow, I had never thought of SMAWK algorithm. Nice job, you got 73.
Dec 3, 2017 at 13:55 history edited Colera Su CC BY-SA 3.0
edited body
Dec 3, 2017 at 13:49 history edited Colera Su CC BY-SA 3.0
deleted 53 characters in body
Dec 3, 2017 at 12:18 history edited Anders Kaseorg CC BY-SA 3.0
added 306 characters in body
Dec 3, 2017 at 12:08 history edited Anders Kaseorg CC BY-SA 3.0
More optimization
Dec 3, 2017 at 11:49 history edited Anders Kaseorg CC BY-SA 3.0
More optimization
Dec 3, 2017 at 10:33 history edited Anders Kaseorg CC BY-SA 3.0
Improved version
Dec 3, 2017 at 9:33 history edited Colera Su CC BY-SA 3.0
edited body
Dec 3, 2017 at 9:32 comment added Colera Su Yes. You got 63.
Dec 3, 2017 at 9:03 history edited Anders Kaseorg CC BY-SA 3.0
deleted 32 characters in body
Dec 3, 2017 at 9:01 comment added Anders Kaseorg @ColeraSu Does it do better if I just change type Cost = u32 to type Cost = u64?
Dec 3, 2017 at 8:33 comment added Colera Su You've got a pretest score 61, but that's because overflow of u32. Maybe you can change to 64-bit integer type?
Dec 3, 2017 at 5:58 history edited Anders Kaseorg CC BY-SA 3.0
added 52 characters in body
Dec 3, 2017 at 5:39 history answered Anders Kaseorg CC BY-SA 3.0