networkx / nx-guides

Examples and Jupyter Notebooks about NetworkX
https://networkx.org/nx-guides/
Creative Commons Zero v1.0 Universal
188 stars 104 forks source link

Refactor geometric generator tutorial to use LineCollection for edge drawing. #23

Closed rossbar closed 3 years ago

rossbar commented 3 years ago

Many of the graphs generated in the geometric graph generator example have >1000 edges. Drawing edges got significantly slower with networkx/networkx#4360 (as expected). This PR adds a helper function to the example using LineCollection for visualizing edges. In the most drastic cases this results in >100x speedup for running the cells where >1000 edges are being drawn, greatly reducing the overall execution time for this notebook.