-
-
Notifications
You must be signed in to change notification settings - Fork 35
Description
I expect that we will need many different types of graphs for the algorithms. So the get_graph May not be able to be used very often. At least that is what happens with tests and pytest. We create a test class and put some graphs that could be used by lots of tests, but then they end up only being used by a couple of the tests and the rest construct their own graph. So we may want to create a different setup function for many of the timing functions. I think we’ll have to wait to see what is most useful. Keeping it as a common function is fine with me. Could we name it something like: cached_gnp_random_graph?
Originally posted by @dschult in #24 (comment)
I was working through the benchmarks and realized that for the tournament functions, we’re currently including the graph generation time in the benchmark measurements, possibly skewing the results.
def time_is_reachable(self, backend, num_nodes):
G = nx.tournament.random_tournament(num_nodes, seed=42)
_ = nx.tournament.is_reachable(G, 0, num_nodes - 1, backend=backend)Following the way benchmarks are implemented in NetworkX, I was thinking of introducing a setup function in nx-parallel, at least for the tournament benchmark, which seems to need a different graph structure. That said, I was also wondering if we should aim for a more uniform setup approach across all benchmarks.
[Note]: I read through PR#24, and it looks like most benchmarks work well with the current cached graph approach. If we decide to continue using the cached graph, perhaps we could introduce a dedicated setup function only for the tournament benchmark. Please let me know your thoughts on this.