I did some quick time profiling of the code. Here's a quick recap.
No quiet flag was used and generator was run with the --big-superposition flag. I modified the number of ants manually.
With a 100 ants the results looked like this.
Here's with a 1000 ants.
And 10 000 ants.
And finally 100 000 ants.
With a 100 000 ants the execution time is about 2 seconds. That doesn't seem too bad.
As you can see from the pictures, the bottleneck of the program depends on the amount of ants (and most likely the amount of nodes and paths, although this can't easily be adjusted). As the number of ants grow, the printer quickly becomes the bottleneck. I would say this is more or less expected, because increasing the number of ants mostly increases the workload for printer. Parsing and solving are probably affected more by the size of the and the number of connections in the graph.
Anyway, I just wanted to share that. I hope you find it helpful! In any case, this is a pretty good start, since it seems to already be fast enough to get us full points for the time complexity in the eval form. ⚡️
I did some quick time profiling of the code. Here's a quick recap.
No quiet flag was used and generator was run with the --big-superposition flag. I modified the number of ants manually.
With a 100 ants the results looked like this.
Here's with a 1000 ants.
And 10 000 ants.
And finally 100 000 ants.
With a 100 000 ants the execution time is about 2 seconds. That doesn't seem too bad.
As you can see from the pictures, the bottleneck of the program depends on the amount of ants (and most likely the amount of nodes and paths, although this can't easily be adjusted). As the number of ants grow, the printer quickly becomes the bottleneck. I would say this is more or less expected, because increasing the number of ants mostly increases the workload for printer. Parsing and solving are probably affected more by the size of the and the number of connections in the graph.
Anyway, I just wanted to share that. I hope you find it helpful! In any case, this is a pretty good start, since it seems to already be fast enough to get us full points for the time complexity in the eval form. ⚡️