Skip to content

Commit 57651d8

Browse files
committed
style(graphs): fix line length in kahns algorithm benchmark
1 parent 9241eab commit 57651d8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

graphs/kahns_algorithm_topo.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ def benchmark() -> None:
104104
Benchmark comparing topological_sort() (using deque.popleft) against
105105
the pre-optimization baseline _topological_sort_list_queue() (using list.pop(0)).
106106
107-
Demonstrates the performance improvement of O(1) queue operations in Kahn's algorithm
108-
on a graph with a large number of zero-indegree vertices.
107+
Demonstrates the performance improvement of O(1) queue operations in
108+
Kahn's algorithm on a graph with a large number of zero-indegree vertices.
109109
"""
110110
from timeit import timeit
111111

@@ -125,7 +125,8 @@ def benchmark() -> None:
125125
new_time = timeit(lambda: topological_sort(graph), number=runs)
126126

127127
print(
128-
f"Benchmark results for topological_sort with {num_sources} vertices over {runs} runs:"
128+
f"Benchmark results for topological_sort with {num_sources} vertices "
129+
f"over {runs} runs:"
129130
)
130131
print(f"Pre-optimization (list.pop(0)): {old_time:.5f} seconds")
131132
print(f"Current (deque.popleft): {new_time:.5f} seconds")

0 commit comments

Comments
 (0)