Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add summary of the rustworkx benchmarks to the documentation #736

Merged
merged 7 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ retworkx/*pyd
*.ps
*.png
*.svg
!/docs/source/images/*.svg
*.jpg
retworkx-core/Cargo.lock
38 changes: 38 additions & 0 deletions docs/source/benchmarks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
****************************************************
Rustworkx Comparison Benchmarks With Other Libraries
****************************************************

rustworkx is competitive against other popular graph libraries for Python. We compared rustworkx to the igraph, graph-tools and NetworkIt libraries `in a benchmark consisting of four tasks available on Github for reproducibility <https://github.com/mtreinish/retworkx-comparison-benchmarks>`__ . We report the results from a machine with an Intel(R) i9-9900K CPU at 3.60GHz with eight cores, 16 theads, and 32GB of RAM avaialble.

Graph Creation
==============

The first use benchmark consists of creating graphs with their respective nodes and edges. We compare the time to create graphs representing the USA road network from the 9th DIMACS challenge dataset (Demetrescu et al., 2009).

.. image:: /images/creation.svg

Single Source Shortest Path
===========================

The second benchmark is to calculate the distance two among nodes in a weighted graph. We compare the time to calculate the distance between the first and the last node in the USA road network, with the datta also coming from the 9th DIMACS challenge (Demetrescu et al., 2009). See :func:`~rustworkx.dijkstra_shortest_path_lengths` for more information on the benchmarked function.

.. image:: /images/single_source_shortest_path.svg

All-Pairs Shortest Path
=======================

The third benchmark is to calculate the distance among all nodes in a weighted graph. We compare the time to calculate the distance among all nodes in the City of Rome road network, another dataset from the 9th DIMACS challenge (Demetrescu et al., 2009). See :func:`~rustworkx.all_pairs_dijkstra_path_lengths` for more information on the benchmarked function.

.. image:: /images/all_pairs.svg

Subgraph Isomorphism
====================

Lastly, the fourth benchamrk is about graph isomorphism. We compare the time to answer if pairs of graphs from the ARG Database are subgraph-isomorphic (De Santo et al., 2003). See :func:`~rustworkx.is_subgraph_isomorphic` for more information on the benchmarked function.

.. image:: /images/subgraph_isomorphism.svg

Citation
--------
* `Demetrescu, C., Goldberg, A., & Johnson, D. The Shortest Path Problem: Ninth DIMACS Implementation Challenge. <https://doi.org/10.1090/dimacs/074>`__
* `Santo, M. D., Foggia, P., Sansone, C., & Vento, M. (2003). A large database of graphs and its use for benchmarking graph isomorphism algorithms. Pattern Recognition Letters, 24(8), 1067–1079. <https://doi.org/10.1016/S0167-8655(02)00253-2>`__