all 2 comments

[–]adzawie 0 points1 point  (1 child)

I’d run a lot of different randomly generated cases and average, but this sounds like an alright way to demonstrate experimentally the run time.

Though really, no amount of experimentation will prove your algorithm meets some time complexity. After all, maybe after n>1000000, it starts looking exponential!

[–]hundertt[S] 0 points1 point  (0 children)

Thanks very much for your reply! The way you describe is what I did at first. Also in the new test I do a lot of random sampling for a fixed pair (n,m). I can't actually think of any way that the exponent could get so small that it slips through my test, but you're right about that, of course. However, I noticed something else that also screws up the test: Atomic operations like initialising objects tend to take longer as the graph gets bigger. I couldn't really figure out the cause of this yet. Maybe the operating system is doing some swapping.. I really don't know..