Skip to content

Conversation

mtreinish
Copy link
Member

This commit adds a new return type NodeIndices that is used as the
return type for functions that return Vec when its used as the
return type to return a list of node indices. This custom type implements
the Python sequence protocol and can be used as the list which was
previously returned except for where explicit type checking was used.
Just as in #185 the advantage here is that for large lists of node
indices the type conversion from a Vec to list(int) becomes a
large bottleneck. This avoids that conversion and only does a usize to
python int conversion on access.

Related to #71

This commit adds a new return type NodeIndices that is used as the
return type for functions that return Vec<usize> when its used as the
return type to return a list of node indices. This custom type implements
the Python sequence protocol and can be used as the list which was
previously returned except for where explicit type checking was used.
Just as in Qiskit#185 the advantage here is that for large lists of node
indices the type conversion from a Vec<usize> to list(int) becomes a
large bottleneck. This avoids that conversion and only does a usize to
python int conversion on access.

Related to Qiskit#71
@coveralls
Copy link

coveralls commented Nov 16, 2020

Pull Request Test Coverage Report for Build 372748559

  • 69 of 69 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 94.712%

Totals Coverage Status
Change from base Build 372745282: 0.07%
Covered Lines: 2955
Relevant Lines: 3120

💛 - Coveralls

mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Nov 18, 2020
In Qiskit#5117 the noise adaptive layout pass was updated to use retworkx
internally for performance. In that PR there were a couple of TODO
comments added about using neighbors methods when they were released.
The retworkx 0.6.0 release was pushed last week so we can update the
usage and remove the TODO comments. The neighbors methods should have
lower overhead since it only returns a list of node indices instead of a
dictionary of (node index, edge weight). This will also get
significantly faster (for large neighbors lists) with
Qiskit/rustworkx#198.
@mtreinish mtreinish requested a review from itoko November 18, 2020 18:33
///
/// :raises Exception: If an unexpected error occurs or a path can't be found
/// :raises DAGHasCycle: If the input PyDiGraph has a cycle
#[pyfunction]
#[text_signature = "(graph, /)"]
fn dag_longest_path(graph: &digraph::PyDiGraph) -> PyResult<Vec<usize>> {
longest_path(graph)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like longest_path still returns PyResult<Vec<usize>>. Should that not be updated to NodeIndices?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's easier to leave it returning Vec<usize> because dag_longest_path_length calls it too. I actually did that in the first rev before pushing this and it errored because there is no len() on NodeIndices it felt easier to leave it like this and have dag_longest_path just move the result into the NodeIndices struct as the return and leave it as a Vec<usize> for the other method

mtreinish and others added 2 commits November 19, 2020 12:05
Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com>
@mtreinish mtreinish merged commit 857947d into Qiskit:master Nov 19, 2020
@mtreinish mtreinish deleted the node-indices-iterator branch November 19, 2020 18:14
mtreinish added a commit to mtreinish/retworkx that referenced this pull request Nov 19, 2020
This commit adds 2 new return types EdgeList and WeightedEdgeList
that are used as the return type for functions that return
Vec<(usize, usize)> and Vec<(usize, usize, PyObject)> respectively.
This custom type implements the Python sequence protocol and can be
used as the list which was previously returned except for where
explicit type checking was used. Just as in Qiskit#185 and Qiskit#198 the
advantage here is that for large edge lists the conversion from
Rust to a Python type becomes a large bottleneck. This avoids that
conversion and only does it per element on access.
@mtreinish
Copy link
Member Author

I ran some benchmarks on this from https://github.com/mtreinish/retworkx-bench before merging and forgot to paste here. The numbers for the hosted bencharks are running now and when they finish it'll be updated on https://mtreinish.github.io/retworkx-bench/ but for now this is what it shows:

Benchmarks that have improved:

       before           after         ratio
     [0b19f238]       [7a2d17de]
     <stash~1>        <node-indices-iterator>
-       128±0.7μs        115±0.7μs     0.90  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(1000, 10000)
-        210±20ms        187±0.2ms     0.89  paths.PathFunctionBenchmarks.time_dag_longest_path_length(10000, 1000000)
-     1.10±0.04μs        969±100ns     0.88  node_benchmarks.GraphNodeAddition.time_add_from(100, 10)
-     1.10±0.05μs          968±9ns     0.88  node_benchmarks.DiGraphNodeAddition.time_add_from(100, 10)
-     1.12±0.04μs          968±4ns     0.86  node_benchmarks.DiGraphNodeAddition.time_add_from(10000, 10)
-     1.10±0.04μs        919±100ns     0.83  node_benchmarks.GraphNodeAddition.time_add_from(1, 10)
-     3.25±0.04μs      2.71±0.01μs     0.83  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(100, 10)
-         291±7ms          236±2ms     0.81  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(1000000, 1000000)
-     5.43±0.02μs      4.16±0.01μs     0.77  node_benchmarks.DiGraphNodeAddition.time_add_from(1000000, 100)
-     1.13±0.04μs         862±70ns     0.76  node_benchmarks.GraphNodeAddition.time_add_from(10000, 10)
-     1.15±0.01ms          876±3μs     0.76  paths.PathFunctionBenchmarks.time_all_simple_paths(100, 1000000)
-     5.43±0.01μs       4.13±0.3μs     0.76  node_benchmarks.GraphNodeAddition.time_add_from(1000000, 100)
-      4.94±0.1μs       3.64±0.2μs     0.74  node_benchmarks.GraphNodeAddition.time_add_from(10000, 100)
-      4.96±0.1μs       3.64±0.1μs     0.73  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(100, True)
-      4.92±0.1μs       3.61±0.4μs     0.73  node_benchmarks.GraphNodeAddition.time_add_from(1, 100)
-      4.97±0.1μs      3.64±0.04μs     0.73  node_benchmarks.DiGraphNodeAddition.time_add_from(1000, 100)
-      5.03±0.4μs       3.65±0.1μs     0.73  node_benchmarks.DiGraphNodeAddition.time_add_from(1, 100)
-      45.4±0.6μs      32.7±0.06μs     0.72  node_benchmarks.DiGraphNodeAddition.time_add_from(1000000, 1000)
-     45.6±0.07μs       32.6±0.2μs     0.72  node_benchmarks.GraphNodeAddition.time_add_from(1000000, 1000)
-        41.2±2μs         29.3±2μs     0.71  node_benchmarks.GraphNodeAddition.time_add_from(100000, 1000)
-        40.1±6μs       28.3±0.5μs     0.71  node_benchmarks.DiGraphNodeAddition.time_add_from(10000, 1000)
-        468±30μs          329±1μs     0.70  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(10000, 10000)
-     38.2±0.05μs      26.7±0.09μs     0.70  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(1000, 1000)
-        41.1±1μs         28.4±1μs     0.69  node_benchmarks.DiGraphNodeAddition.time_add_from(10, 1000)
-        41.1±1μs         28.4±1μs     0.69  node_benchmarks.GraphNodeAddition.time_add_from(100, 1000)
-      8.35±0.1ms      5.76±0.03ms     0.69  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(100000, 100000)
-        41.2±2μs         28.3±1μs     0.69  node_benchmarks.DiGraphNodeAddition.time_add_from(1000, 1000)
-        405±10μs         277±10μs     0.68  node_benchmarks.GraphNodeAddition.time_add_from(1, 10000)
-        403±20μs         276±10μs     0.68  node_benchmarks.GraphNodeAddition.time_add_from(1000, 10000)
-      5.35±0.4μs       3.66±0.2μs     0.68  node_benchmarks.GraphNodeAddition.time_add_from(100000, 100)
-        41.3±1μs         28.2±1μs     0.68  node_benchmarks.GraphNodeAddition.time_add_from(1000, 1000)
-        405±10μs         275±10μs     0.68  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_from(10000)
-         405±7μs        274±0.4μs     0.68  node_benchmarks.GraphNodeAddition.time_add_from(100, 10000)
-        41.9±1μs         28.1±1μs     0.67  node_benchmarks.GraphNodeAddition.time_add_from(10, 1000)
-      5.49±0.3μs       3.68±0.2μs     0.67  node_benchmarks.DiGraphNodeAddition.time_add_from(100000, 100)
-        43.1±5μs         28.7±1μs     0.66  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_from(1000)
-      5.55±0.4μs       3.67±0.2μs     0.66  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_from(100)
-      5.52±0.4μs       3.64±0.1μs     0.66  node_benchmarks.GraphNodeAddition.time_add_from(1000, 100)
-      5.53±0.4μs       3.64±0.1μs     0.66  node_benchmarks.DiGraphNodeAddition.time_add_from(10, 100)
-      5.53±0.4μs       3.63±0.1μs     0.66  node_benchmarks.GraphNodeAddition.time_add_from(100, 100)
-      5.54±0.4μs       3.63±0.1μs     0.66  node_benchmarks.GraphNodeAddition.time_add_from(10, 100)
-      5.55±0.4μs       3.63±0.1μs     0.65  node_benchmarks.DiGraphNodeAddition.time_add_from(100, 100)
-         485±1μs        315±0.7μs     0.65  node_benchmarks.GraphNodeAddition.time_add_from(1000000, 10000)
-        486±30μs        315±0.5μs     0.65  node_benchmarks.DiGraphNodeAddition.time_add_from(1000000, 10000)
-      30.1±0.1μs      19.3±0.09μs     0.64  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(1000, 100)
-        45.8±4μs         29.4±2μs     0.64  node_benchmarks.DiGraphNodeAddition.time_add_from(100000, 1000)
-        431±30μs         276±20μs     0.64  node_benchmarks.GraphNodeAddition.time_add_from(10, 10000)
-      27.5±0.9μs       17.5±0.1μs     0.64  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(1000, 10)
-        432±50μs         275±10μs     0.64  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(10000, True)
-        45.3±4μs         28.4±2μs     0.63  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(1000, False)
-        440±40μs         274±20μs     0.62  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(10000, False)
-        65.5±2ms       40.3±0.5ms     0.62  node_benchmarks.DiGraphNodeAddition.time_add_from(1, 1000000)
-         449±9μs         276±10μs     0.62  node_benchmarks.GraphNodeAddition.time_add_from(10000, 10000)
-        46.4±3μs         28.5±1μs     0.61  node_benchmarks.DiGraphNodeAddition.time_add_from(1, 1000)
-         6.86±0s          4.21±0s     0.61  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_from(100000000)
-        46.2±4μs         28.3±1μs     0.61  node_benchmarks.DiGraphNodeAddition.time_add_from(100, 1000)
-        66.1±1ms       40.3±0.3ms     0.61  node_benchmarks.DiGraphNodeAddition.time_add_from(10, 1000000)
-        46.6±3μs         28.4±2μs     0.61  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(1000, True)
-        454±50μs         276±10μs     0.61  node_benchmarks.DiGraphNodeAddition.time_add_from(100, 10000)
-        454±30μs          276±9μs     0.61  node_benchmarks.DiGraphNodeAddition.time_add_from(10, 10000)
-        66.9±1ms       40.5±0.1ms     0.61  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(1000000, True)
-        66.0±1ms       40.0±0.3ms     0.61  node_benchmarks.GraphNodeAddition.time_add_from(100, 1000000)
-        67.0±3ms       40.6±0.3ms     0.61  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(1000000, False)
-      66.1±0.8ms       39.9±0.4ms     0.60  node_benchmarks.DiGraphNodeAddition.time_add_from(100, 1000000)
-        46.7±3μs         28.2±1μs     0.60  node_benchmarks.GraphNodeAddition.time_add_from(1, 1000)
-        456±30μs         274±10μs     0.60  node_benchmarks.DiGraphNodeAddition.time_add_from(1000, 10000)
-      66.9±0.4ms       40.1±0.2ms     0.60  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_from(1000000)
-        70.3±3ms       42.0±0.6ms     0.60  node_benchmarks.DiGraphNodeAddition.time_add_from(100000, 1000000)
-      67.4±0.5ms         40.0±1ms     0.59  node_benchmarks.GraphNodeAddition.time_add_from(10000, 1000000)
-         464±2μs         275±10μs     0.59  node_benchmarks.GraphNodeAddition.time_add_from(100000, 10000)
-        65.9±2ms         38.9±2ms     0.59  node_benchmarks.DiGraphNodeAddition.time_add_from(1000, 1000000)
-        67.9±2ms         40.1±1ms     0.59  node_benchmarks.GraphNodeAddition.time_add_from(1, 1000000)
-        472±20μs         277±20μs     0.59  node_benchmarks.DiGraphNodeAddition.time_add_from(1, 10000)
-        68.9±2ms       40.4±0.8ms     0.59  node_benchmarks.GraphNodeAddition.time_add_from(100000, 1000000)
-        46.6±3μs         27.2±1μs     0.58  node_benchmarks.GraphNodeAddition.time_add_from(10000, 1000)
-        66.7±3ms         38.8±2ms     0.58  node_benchmarks.DiGraphNodeAddition.time_add_from(1000000, 1000000)
-        67.0±2ms         38.9±2ms     0.58  node_benchmarks.GraphNodeAddition.time_add_from(1000, 1000000)
-        69.0±2ms       40.1±0.1ms     0.58  node_benchmarks.GraphNodeAddition.time_add_from(10, 1000000)
-        67.1±3ms         38.5±3ms     0.57  node_benchmarks.GraphNodeAddition.time_add_from(1000000, 1000000)
-     5.61±0.04ms      3.22±0.04ms     0.57  node_benchmarks.GraphNodeAddition.time_add_from(1000000, 100000)
-     5.59±0.04ms      3.20±0.03ms     0.57  node_benchmarks.DiGraphNodeAddition.time_add_from(1000000, 100000)
-      4.86±0.3ms      2.78±0.01ms     0.57  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(100000, True)
-      4.97±0.2ms       2.83±0.1ms     0.57  node_benchmarks.DiGraphNodeAddition.time_add_from(10000, 100000)
-      4.89±0.2ms       2.78±0.2ms     0.57  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(100000, False)
-       331±0.9μs        188±0.6μs     0.57  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(10000, 1000)
-     5.00±0.05ms       2.83±0.2ms     0.57  node_benchmarks.DiGraphNodeAddition.time_add_from(100000, 100000)
-        490±50μs          276±9μs     0.56  node_benchmarks.DiGraphNodeAddition.time_add_from(10000, 10000)
-      5.07±0.3ms       2.83±0.1ms     0.56  node_benchmarks.GraphNodeAddition.time_add_from(10000, 100000)
-      5.51±0.6ms       3.05±0.2ms     0.55  node_benchmarks.GraphNodeAddition.time_add_from(1000, 100000)
-        72.4±3ms       40.0±0.2ms     0.55  node_benchmarks.DiGraphNodeAddition.time_add_from(10000, 1000000)
-      5.16±0.2ms       2.82±0.2ms     0.55  node_benchmarks.GraphNodeAddition.time_add_from(100000, 100000)
-      5.07±0.3ms       2.76±0.1ms     0.54  node_benchmarks.DiGraphNodeAddition.time_add_from(1000, 100000)
-     3.72±0.05ms      2.02±0.01ms     0.54  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(100000, 10000)
-      5.22±0.3ms       2.82±0.2ms     0.54  node_benchmarks.GraphNodeAddition.time_add_from(100, 100000)
-      5.29±0.4ms       2.84±0.2ms     0.54  node_benchmarks.DiGraphNodeAddition.time_add_from(100, 100000)
-       306±0.7μs        164±0.3μs     0.54  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(10000, 100)
-        515±40μs         275±20μs     0.53  node_benchmarks.DiGraphNodeAddition.time_add_from(100000, 10000)
-      5.26±0.3ms       2.81±0.1ms     0.53  node_benchmarks.DiGraphNodeAddition.time_add_from(1, 100000)
-         304±1μs        162±0.1μs     0.53  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(10000, 10)
-     5.33±0.07ms         2.78±0ms     0.52  node_benchmarks.DiGraphNodeAddition.time_add_from(10, 100000)
-     3.17±0.03ms      1.65±0.01ms     0.52  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(100000, 1000)
-     5.38±0.04ms      2.77±0.08ms     0.52  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_from(100000)
-     3.15±0.06ms         1.61±0ms     0.51  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(100000, 10)
-     3.23±0.04ms      1.62±0.01ms     0.50  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(100000, 100)
-      5.83±0.5ms       2.78±0.1ms     0.48  node_benchmarks.GraphNodeAddition.time_add_from(1, 100000)
-      6.08±0.7ms       2.78±0.2ms     0.46  node_benchmarks.GraphNodeAddition.time_add_from(10, 100000)
-        88.0±7ms       31.2±0.1ms     0.36  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(1000000, 100000)
-        81.6±7ms      18.0±0.02ms     0.22  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(1000000, 10000)
-        77.2±7ms      16.4±0.03ms     0.21  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(1000000, 100)
-        78.2±5ms      16.5±0.07ms     0.21  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(1000000, 10)
-        80.6±7ms       16.6±0.4ms     0.21  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(1000000, 1000)
-       240±0.9ms      33.6±0.01ms     0.14  node_benchmarks.TwoDimensionDynamicSimulation.time_nodes_indexes
-       218±0.5ms      29.6±0.03ms     0.14  node_benchmarks.RoadGraphWesternUSA.time_nodes_indexes(True)
-       818±0.3ms        110±0.6ms     0.14  node_benchmarks.RoadGraphFullUSA.time_nodes_indexes(True)
-         833±4ms        112±0.4ms     0.13  node_benchmarks.RoadGraphFullUSA.time_nodes_indexes(False)
-       415±0.3ms       54.6±0.9ms     0.13  node_benchmarks.AsiaRoadGraph.time_nodes_indexes
-      6.40±0.6ms        261±0.9μs     0.04  node_benchmarks.USANYCRoadGraph.time_nodes_indexes(False)
-      6.57±0.3ms        260±0.4μs     0.04  node_benchmarks.USANYCRoadGraph.time_nodes_indexes(True)

Benchmarks that have stayed the same:

       before           after         ratio
     [0b19f238]       [7a2d17de]
     <stash~1>        <node-indices-iterator>
           failed           failed      n/a  node_benchmarks.RandomGeometricGraph.time___len__
           failed           failed      n/a  node_benchmarks.RandomGeometricGraph.time_get_node_data
           failed           failed      n/a  node_benchmarks.RandomGeometricGraph.time_nodes
           failed           failed      n/a  node_benchmarks.RandomGeometricGraph.time_nodes_indexes
           failed           failed      n/a  node_benchmarks.RandomGeometricGraph.time_remove_node
           failed           failed      n/a  node_benchmarks.RandomGeometricGraph.time_remove_nodes_from
        231±0.9ns        318±0.8ns    ~1.38  node_benchmarks.RoadGraphFullUSA.time___len__(True)
         298±20ns          347±2ns    ~1.16  node_benchmarks.RoadGraphWesternUSA.time_get_node_data(False)
       1.64±0.1μs      1.90±0.03μs    ~1.16  node_benchmarks.DiGraphNodeAddition.time_add_loop(10, 10)
         534±40ns          617±4ns    ~1.16  node_benchmarks.DiGraphNodeAddition.time_add_from(10, 1)
         835±40μs          954±4μs    ~1.14  paths.PathFunctionBenchmarks.time_dag_longest_path_length(10000, 10000)
         545±10ns         617±40ns    ~1.13  node_benchmarks.DiGraphNodeAddition.time_add_from(100, 1)
         839±50ns          950±8ns    ~1.13  paths.PathsUSANYCRoadGraph.time_all_simple_paths(True)
         549±20ns          621±3ns    ~1.13  node_benchmarks.DiGraphNodeAddition.time_add_from(100000, 1)
         145±10μs        162±0.3μs    ~1.12  node_benchmarks.DiGraphNodeAddition.time_add_loop(1, 1000)
         559±40ns        625±0.7ns    ~1.12  node_benchmarks.RoadGraphWesternUSA.time_remove_nodes_from(False)
         557±10ns         624±30ns    ~1.12  node_benchmarks.DiGraphNodeAddition.time_add_from(1000, 1)
         567±30ns          632±2ns    ~1.12  node_benchmarks.RoadGraphFullUSA.time_remove_nodes_from(True)
         276±10ns       308±0.05ns    ~1.11  node_benchmarks.RoadGraphFullUSA.time___len__(False)
         584±40ns          649±6ns    ~1.11  paths.PathFunctionBenchmarks.time_all_simple_paths(1000, 1000000)
         553±30ns          613±6ns    ~1.11  node_benchmarks.GraphNodeAddition.time_add_from(10, 1)
         554±40ns          613±3ns    ~1.11  node_benchmarks.DiGraphNodeAddition.time_add_from(10000, 1)
          540±2ns         597±20ns    ~1.11  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_from(1)
         585±50ns          642±2ns     1.10  paths.PathFunctionBenchmarks.time_all_simple_paths(10000, 100)
          192±3ns        210±0.4ns     1.09  node_benchmarks.AsiaRoadGraph.time_remove_node
         555±50ns         603±30ns     1.09  node_benchmarks.GraphNodeAddition.time_add_from(100, 1)
          566±7ns          614±4ns     1.09  node_benchmarks.GraphNodeAddition.time_add_from(100000, 1)
          159±8ms          172±1ms     1.08  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000000, 1000000)
         44.7±4μs       48.5±0.9μs     1.08  paths.TestAstar.time_astar_shortest_path(10, 1000)
          576±4ns          623±4ns     1.08  node_benchmarks.GraphNodeAddition.time_add_from(1000000, 1)
       1.51±0.1μs      1.63±0.06μs     1.08  paths.PathFunctionBenchmarks.time_dag_longest_path(10, 10)
       1.80±0.2μs       1.94±0.1μs     1.08  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000000, 10)
          436±8μs          470±8μs     1.08  paths.TestAstar.time_astar_shortest_path(10, 10000)
         547±30ns         588±30ns     1.07  node_benchmarks.GraphNodeAddition.time_add_from(1000, 1)
         318±20ns          339±5ns     1.07  node_benchmarks.RoadGraphWesternUSA.time_remove_node(False)
         604±50ns         643±10ns     1.06  paths.PathFunctionBenchmarks.time_all_simple_paths(1000, 10)
          154±8ms          164±2ms     1.06  node_benchmarks.DiGraphNodeAddition.time_add_loop(10000, 1000000)
         539±10μs        572±0.8μs     1.06  paths.PathFunctionBenchmarks.time_dag_longest_path_length(10000, 1000)
         171±10ns          181±1ns     1.06  node_benchmarks.TwoDimensionDynamicSimulation.time___len__
        156±0.8ms          166±1ms     1.06  node_benchmarks.GraphNodeAddition.time_add_loop(1000000, 1000000)
       15.9±0.2μs      16.8±0.07μs     1.06  node_benchmarks.DiGraphNodeAddition.time_add_loop(100000, 100)
          550±9ns         583±60ns     1.06  node_benchmarks.DiGraphNodeAddition.time_add_from(1, 1)
          122±4ms          130±5ms     1.06  paths.PathFunctionBenchmarks.time_dag_longest_path_length(1000000, 10000)
          158±2μs        167±0.4μs     1.06  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000, 1000)
        150±0.7μs        158±0.5μs     1.06  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_loop(1000)
       15.4±0.8ms       16.2±0.1ms     1.05  node_benchmarks.DiGraphNodeAddition.time_add_loop(10, 100000)
       15.2±0.3ms      16.1±0.06ms     1.05  node_benchmarks.GraphNodeAddition.time_add_loop(10000, 100000)
      1.58±0.02ms      1.67±0.01ms     1.05  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000, 10000)
      1.81±0.03μs      1.91±0.02μs     1.05  paths.TestAstar.time_astar_shortest_path(10, 10)
       15.7±0.3ms      16.5±0.07ms     1.05  node_benchmarks.DiGraphNodeAddition.time_add_loop(100000, 100000)
      1.03±0.04ms         1.08±0ms     1.05  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(100, 100000)
       15.8±0.2μs       16.6±0.2μs     1.05  node_benchmarks.DiGraphNodeAddition.time_add_loop(10, 100)
      1.57±0.03ms      1.65±0.03ms     1.05  node_benchmarks.DiGraphNodeAddition.time_add_loop(100000, 10000)
       15.8±0.3μs      16.6±0.07μs     1.05  node_benchmarks.DiGraphNodeAddition.time_add_loop(1, 100)
        28.1±0.2s       29.5±0.06s     1.05  qiskit_terra.QiskitTranspilerBenchmarks.time_transpile(2)
      15.4±0.03μs       16.1±0.1μs     1.05  node_benchmarks.GraphNodeAddition.time_add_loop(100, 100)
          156±1μs        164±0.6μs     1.05  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(1000, False)
       15.6±0.3ms      16.3±0.06ms     1.05  node_benchmarks.DiGraphNodeAddition.time_add_loop(100, 100000)
       16.0±0.9μs       16.8±0.4μs     1.05  node_benchmarks.DiGraphNodeAddition.time_add_loop(10000, 100)
       16.2±0.2μs       17.0±0.2μs     1.05  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000, 100)
          160±2μs          168±1μs     1.05  node_benchmarks.DiGraphNodeAddition.time_add_loop(100000, 1000)
      1.77±0.01μs      1.86±0.06μs     1.05  node_benchmarks.GraphNodeAddition.time_add_loop(10, 10)
          158±3μs          166±4μs     1.05  node_benchmarks.DiGraphNodeAddition.time_add_loop(10000, 1000)
       15.4±0.2ms      16.2±0.09ms     1.05  node_benchmarks.GraphNodeAddition.time_add_loop(1000, 100000)
       15.0±0.1ms      15.8±0.06ms     1.05  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_loop(100000)
          385±6ns          403±3ns     1.05  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(1, True)
      1.56±0.02ms         1.63±0ms     1.05  node_benchmarks.DiGraphNodeAddition.time_add_loop(10, 10000)
         1.76±0μs      1.85±0.01μs     1.05  node_benchmarks.GraphNodeAddition.time_add_loop(1, 10)
         1.74±0μs         1.82±0μs     1.05  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_loop(10)
          153±2ms          160±6ms     1.05  node_benchmarks.GraphNodeAddition.time_add_loop(1000, 1000000)
          154±2μs        160±0.5μs     1.05  node_benchmarks.GraphNodeAddition.time_add_loop(1000, 1000)
      1.51±0.01ms      1.58±0.01ms     1.04  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_loop(10000)
          156±1μs        163±0.4μs     1.04  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(1000, True)
         308±20ns         322±10ns     1.04  node_benchmarks.RoadGraphFullUSA.time_remove_node(False)
       15.8±0.1μs      16.4±0.04μs     1.04  node_benchmarks.GraphNodeAddition.time_add_loop(10000, 100)
       15.8±0.2ms       16.5±0.1ms     1.04  node_benchmarks.GraphNodeAddition.time_add_loop(1000000, 100000)
      15.8±0.09μs       16.5±0.6μs     1.04  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(100, True)
      15.5±0.09μs       16.2±0.2μs     1.04  node_benchmarks.GraphNodeAddition.time_add_loop(1, 100)
       15.2±0.2ms       15.8±0.2ms     1.04  node_benchmarks.GraphNodeAddition.time_add_loop(100, 100000)
         298±50ns         311±10ns     1.04  node_benchmarks.USANYCRoadGraph.time___len__(False)
      1.60±0.02ms      1.66±0.01ms     1.04  node_benchmarks.GraphNodeAddition.time_add_loop(1000000, 10000)
          153±2μs         159±10μs     1.04  node_benchmarks.GraphNodeAddition.time_add_loop(10, 1000)
      15.5±0.06μs      16.1±0.04μs     1.04  node_benchmarks.GraphNodeAddition.time_add_loop(10, 100)
      1.81±0.03μs      1.89±0.01μs     1.04  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(10, False)
          154±2μs        160±0.8μs     1.04  node_benchmarks.GraphNodeAddition.time_add_loop(10000, 1000)
      1.55±0.04ms         1.61±0ms     1.04  node_benchmarks.DiGraphNodeAddition.time_add_loop(1, 10000)
       16.1±0.6ms       16.8±0.2ms     1.04  node_benchmarks.DiGraphNodeAddition.time_add_loop(10000, 100000)
       15.9±0.1μs      16.5±0.06μs     1.04  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(100, False)
          163±3ms          170±4ms     1.04  node_benchmarks.DiGraphNodeAddition.time_add_loop(100000, 1000000)
          155±2ms          161±2ms     1.04  node_benchmarks.GraphNodeAddition.time_add_loop(10000, 1000000)
          158±2ms          164±2ms     1.04  node_benchmarks.DiGraphNodeAddition.time_add_loop(100, 1000000)
      1.56±0.01ms      1.62±0.05ms     1.04  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(10000, True)
          314±9μs          326±2μs     1.04  paths.PathFunctionBenchmarks.time_dag_longest_path_length(1000, 10000)
      1.84±0.02μs         1.91±0μs     1.04  node_benchmarks.DiGraphNodeAddition.time_add_loop(10000, 10)
       15.9±0.2ms       16.5±0.1ms     1.04  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000, 100000)
        16.1±0.1s       16.7±0.03s     1.04  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(100000000, True)
      1.57±0.03ms         1.63±0ms     1.04  node_benchmarks.DiGraphNodeAddition.time_add_loop(100, 10000)
      1.81±0.02μs       1.88±0.1μs     1.04  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(10, True)
          157±2ms          163±3ms     1.04  node_benchmarks.GraphNodeAddition.time_add_loop(100000, 1000000)
       15.7±0.2ms      16.3±0.09ms     1.04  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(100000, False)
      1.85±0.04μs      1.92±0.01μs     1.04  node_benchmarks.GraphNodeAddition.time_add_loop(1000000, 10)
      1.81±0.05μs         1.88±0μs     1.04  node_benchmarks.DiGraphNodeAddition.time_add_loop(1, 10)
         49.0±4ms       50.8±0.9ms     1.04  paths.TestAstar.time_astar_shortest_path(10, 1000000)
          156±6μs          162±2μs     1.04  node_benchmarks.DiGraphNodeAddition.time_add_loop(100, 1000)
          122±5ms        126±0.2ms     1.04  paths.PathFunctionBenchmarks.time_dag_longest_path_length(1000000, 100)
      1.59±0.03ms      1.65±0.07ms     1.04  node_benchmarks.DiGraphNodeAddition.time_add_loop(10000, 10000)
      1.53±0.03ms      1.58±0.01ms     1.04  node_benchmarks.GraphNodeAddition.time_add_loop(10, 10000)
       15.3±0.08s        15.9±0.1s     1.04  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_loop(100000000)
      1.81±0.02μs      1.88±0.01μs     1.03  node_benchmarks.DiGraphNodeAddition.time_add_loop(100, 10)
          150±3ms          155±7ms     1.03  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_loop(1000000)
       93.5±0.8ms       96.7±0.2ms     1.03  node_benchmarks.RoadGraphWesternUSA.time_nodes(False)
      1.85±0.02μs      1.91±0.01μs     1.03  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000, 10)
          160±2μs        165±0.8μs     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(1000000, 1000)
      1.53±0.01ms      1.58±0.01ms     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(100, 10000)
          153±1μs        158±0.3μs     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(100, 1000)
          155±3ms          161±2ms     1.03  node_benchmarks.DiGraphNodeAddition.time_add_loop(1, 1000000)
        16.0±0.2s       16.6±0.02s     1.03  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(100000000, False)
       16.8±0.3μs       17.4±0.2μs     1.03  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000000, 100)
       16.0±0.3μs      16.5±0.03μs     1.03  node_benchmarks.DiGraphNodeAddition.time_add_loop(100, 100)
       16.3±0.2μs      16.8±0.06μs     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(1000000, 100)
      1.79±0.01μs      1.85±0.05μs     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(10000, 10)
          153±2ms          158±4ms     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(1, 1000000)
          313±4ns          322±5ns     1.03  node_benchmarks.RoadGraphWesternUSA.time___len__(True)
      1.55±0.02ms      1.60±0.01ms     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(100000, 10000)
       15.6±0.1μs         16.1±1μs     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(1000, 100)
       4.54±0.2ms      4.68±0.07ms     1.03  paths.TestAstar.time_astar_shortest_path(10, 100000)
       15.5±0.1ms      16.0±0.04ms     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(100000, 100000)
       15.7±0.2ms       16.2±0.6ms     1.03  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(100000, True)
          161±3ms          166±3ms     1.03  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000, 1000000)
      1.57±0.02ms      1.61±0.01ms     1.03  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(10000, False)
          557±8ns         574±40ns     1.03  node_benchmarks.GraphNodeAddition.time_add_from(1, 1)
        153±0.6μs        158±0.8μs     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(1, 1000)
      1.55±0.02ms      1.60±0.01ms     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(1000, 10000)
          393±5ns          404±1ns     1.03  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(1, False)
         340±40ns          350±5ns     1.03  node_benchmarks.USANYCRoadGraph.time_remove_node(True)
      1.53±0.02ms         1.57±0ms     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(1, 10000)
       15.8±0.3ms       16.3±0.1ms     1.03  node_benchmarks.DiGraphNodeAddition.time_add_loop(1, 100000)
      15.8±0.09μs      16.2±0.08μs     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(100000, 100)
      1.79±0.01μs      1.84±0.01μs     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(100, 10)
          152±2ms          156±2ms     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(10, 1000000)
      3.60±0.09μs      3.69±0.04μs     1.03  paths.PathFunctionBenchmarks.time_dag_longest_path(10, 100)
         499±20μs        513±0.7μs     1.03  paths.PathFunctionBenchmarks.time_dag_longest_path(10000, 100)
      1.64±0.05ms      1.68±0.08ms     1.03  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000000, 10000)
      1.57±0.04ms         1.61±0ms     1.03  node_benchmarks.GraphNodeAddition.time_add_loop(10000, 10000)
          157±4ms        161±0.9ms     1.03  node_benchmarks.DiGraphNodeAddition.time_add_loop(10, 1000000)
          163±3ms          167±1ms     1.02  paths.PathFunctionBenchmarks.time_dag_longest_path(1000000, 100000)
          163±3ms          167±1ms     1.02  paths.PathFunctionBenchmarks.time_dag_longest_path_length(1000000, 100000)
       16.6±0.2ms      17.0±0.05ms     1.02  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000000, 100000)
         595±40ns         609±60ns     1.02  paths.PathFunctionBenchmarks.time_all_simple_paths(1000, 1000)
       15.5±0.2ms       15.8±0.1ms     1.02  node_benchmarks.GraphNodeAddition.time_add_loop(1, 100000)
       5.89±0.3μs       6.03±0.3μs     1.02  paths.TestAstar.time_astar_shortest_path(10, 100)
          632±9ns          646±4ns     1.02  paths.PathFunctionBenchmarks.time_all_simple_paths(10000, 1000)
       15.4±0.1ms       15.8±0.1ms     1.02  node_benchmarks.GraphNodeAddition.time_add_loop(10, 100000)
          124±4ms        126±0.5ms     1.02  paths.PathFunctionBenchmarks.time_dag_longest_path_length(1000000, 1000)
          566±8ns         577±70ns     1.02  node_benchmarks.GraphNodeAddition.time_add_from(10000, 1)
          357±4ms          364±2ms     1.02  node_benchmarks.RoadGraphFullUSA.time_nodes(True)
          156±3μs          159±5μs     1.02  node_benchmarks.GraphNodeAddition.time_add_loop(100000, 1000)
      1.28±0.09μs      1.30±0.01μs     1.02  paths.PathsUSANYCRoadGraph.time_all_simple_paths(False)
          163±4μs         166±10μs     1.02  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000000, 1000)
      1.81±0.03μs      1.84±0.04μs     1.02  node_benchmarks.GraphNodeAddition.time_add_loop(100000, 10)
      1.88±0.08μs      1.92±0.02μs     1.02  node_benchmarks.DiGraphNodeAddition.time_add_loop(100000, 10)
      3.52±0.02μs      3.58±0.03μs     1.02  paths.PathFunctionBenchmarks.time_dag_longest_path_length(10, 100)
         990±60ns         1.01±0μs     1.02  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(10, 10)
         395±20ns         401±10ns     1.02  node_benchmarks.DiGraphNodeAddition.time_add_loop(100000, 1)
          639±8ns         650±40ns     1.02  paths.PathFunctionBenchmarks.time_all_simple_paths(1000, 10000)
          395±3ns          401±5ns     1.02  node_benchmarks.GraphNodeAddition.time_add_loop(10000, 1)
          157±2ms          159±3ms     1.02  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(1000000, False)
          385±2ns         390±20ns     1.01  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_loop(1)
          392±3ns         397±20ns     1.01  node_benchmarks.DiGraphNodeAddition.time_add_loop(1, 1)
      3.24±0.03ms      3.28±0.01ms     1.01  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(1000, 100000)
          929±4ms        942±0.7ms     1.01  paths.PathsRoadGraphFullUSA.time_astar_shortest_path(True)
          1.45±0s       1.47±0.01s     1.01  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(1000000, 100000)
          404±4ns          410±7ns     1.01  node_benchmarks.GraphNodeAddition.time_add_loop(1000000, 1)
       16.3±0.3μs      16.5±0.08μs     1.01  paths.PathFunctionBenchmarks.time_dag_longest_path(10, 1000)
          345±3ns          349±4ns     1.01  node_benchmarks.USANYCRoadGraph.time_remove_node(False)
         504±20ms          510±6ms     1.01  paths.PathFunctionBenchmarks.time_dag_longest_path_length(1000000, 1000000)
       60.8±0.5μs       61.5±0.6μs     1.01  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(10, 10000)
          125±4ms          127±1ms     1.01  paths.PathFunctionBenchmarks.time_dag_longest_path(1000000, 10)
       8.29±0.2μs      8.37±0.01μs     1.01  paths.PathFunctionBenchmarks.time_dag_longest_path_length(100, 100)
         303±30ns         306±20ns     1.01  node_benchmarks.USANYCRoadGraph.time___len__(True)
         83.0±4μs       83.9±0.1μs     1.01  paths.PathFunctionBenchmarks.time_dag_longest_path_length(1000, 1000)
        143±0.9ms          144±4ms     1.01  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(10000, 1000000)
         645±10ns          651±5ns     1.01  paths.PathFunctionBenchmarks.time_all_simple_paths(1000, 100000)
          641±3μs          647±3μs     1.01  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(10, 100000)
        350±0.8ns          352±1ns     1.01  node_benchmarks.RoadGraphFullUSA.time_get_node_data(True)
        402±0.6ns          405±3ns     1.01  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000, 1)
        178±0.9ns       180±0.07ns     1.01  node_benchmarks.AsiaRoadGraph.time___len__
      4.71±0.05μs      4.74±0.02μs     1.01  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(10, 100)
       11.1±0.06s       11.2±0.08s     1.01  qiskit_terra.QiskitTranspilerBenchmarks.time_transpile(1)
      1.36±0.01ms         1.37±0ms     1.01  paths.PathFunctionBenchmarks.time_dag_longest_path(10, 100000)
      15.2±0.01μs         15.3±1μs     1.01  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_loop(100)
      28.0±0.08μs       28.2±0.2μs     1.01  paths.PathFunctionBenchmarks.time_dag_longest_path_length(100, 1000)
         641±40ns          646±4ns     1.01  paths.PathFunctionBenchmarks.time_all_simple_paths(100000, 1000)
          622±7ns         626±50ns     1.01  paths.PathFunctionBenchmarks.time_all_simple_paths(10, 1000)
          355±2ns          357±3ns     1.01  node_benchmarks.RoadGraphFullUSA.time_remove_node(True)
      1.66±0.01μs      1.67±0.01μs     1.01  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(10, 100)
      20.4±0.06ms       20.5±0.1ms     1.01  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(10, 1000000)
       1.42±0.01s          1.43±0s     1.00  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(1000000, 100)
       39.0±0.2ms      39.1±0.08ms     1.00  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(100, 1000000)
         623±20ns          626±3ns     1.00  paths.PathFunctionBenchmarks.time_all_simple_paths(10, 100000)
      8.46±0.06ms      8.50±0.02ms     1.00  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(10000, 100000)
          127±3μs          127±1μs     1.00  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(100, 10000)
          403±9ns          405±7ns     1.00  node_benchmarks.GraphNodeAddition.time_add_loop(100000, 1)
       1.42±0.01s       1.43±0.01s     1.00  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(1000000, 10)
      4.97±0.05ms      5.00±0.03ms     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path_length(10000, 100000)
          157±5μs        158±0.2μs     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path_length(100, 10000)
         345±10ns          346±4ns     1.00  node_benchmarks.USANYCRoadGraph.time_get_node_data(False)
      1.49±0.07μs         1.50±0μs     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path_length(10, 10)
      8.41±0.03μs      8.44±0.03μs     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path(100, 100)
      5.00±0.03ms      5.02±0.04ms     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path(10000, 100000)
          125±1ms          125±1ms     1.00  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(10000, 1000000)
          156±3μs         156±10μs     1.00  node_benchmarks.DiGraphNodeAddition.time_add_loop(10, 1000)
      1.37±0.01ms      1.37±0.01ms     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path_length(10, 100000)
         505±20μs        506±0.4μs     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path_length(10000, 10)
         400±30ns          400±2ns     1.00  node_benchmarks.DiGraphNodeAddition.time_add_loop(100, 1)
          621±1ns          622±2ns     1.00  node_benchmarks.RoadGraphFullUSA.time_remove_nodes_from(False)
          129±3ms          130±1ms     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path(1000000, 10000)
          392±2ns         393±10ns     1.00  node_benchmarks.GraphNodeAddition.time_add_loop(1, 1)
      1.65±0.01μs         1.66±0μs     1.00  paths.PathFunctionBenchmarks.time_all_simple_paths(100000, 1000000)
       16.4±0.6μs      16.4±0.04μs     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path_length(10, 1000)
         649±60ns          650±7ns     1.00  paths.PathFunctionBenchmarks.time_all_simple_paths(100000, 10)
       13.9±0.3ms       13.9±0.2ms     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path_length(100000, 100000)
             190M             190M     1.00  qiskit_terra.QiskitTranspilerBenchmarks.peakmem_transpile(0)
             231M             231M     1.00  qiskit_terra.QiskitTranspilerBenchmarks.peakmem_transpile(2)
         624±20ns          624±3ns     1.00  paths.PathFunctionBenchmarks.time_all_simple_paths(10, 10000)
             252M             252M     1.00  qiskit_terra.QiskitTranspilerBenchmarks.peakmem_transpile(3)
          1.47±0s       1.47±0.02s     1.00  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(1000000, 1000000)
          629±3ns          629±4ns     1.00  node_benchmarks.RoadGraphWesternUSA.time_remove_nodes_from(True)
       59.3±0.7ms       59.3±0.6ms     1.00  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(100000, 100)
       12.6±0.7μs       12.6±0.3μs     1.00  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(10, 1000)
             193M             193M     1.00  qiskit_terra.QiskitTranspilerBenchmarks.peakmem_transpile(1)
          1.44±0s          1.43±0s     1.00  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(1000000, 10000)
       84.2±0.4μs         84.1±2μs     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path(1000, 1000)
         639±10ns         639±30ns     1.00  paths.PathFunctionBenchmarks.time_all_simple_paths(1000, 100)
          403±3ns          403±2ns     1.00  node_benchmarks.DiGraphNodeAddition.time_add_loop(10000, 1)
          391±2ns         390±40ns     1.00  node_benchmarks.GraphNodeAddition.time_add_loop(100, 1)
      3.86±0.01μs      3.85±0.01μs     1.00  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(10, 10)
        137±0.3μs        136±0.3μs     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path_length(10, 10000)
        136±0.2μs        135±0.9μs     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path(10, 10000)
          391±1ns         390±10ns     1.00  node_benchmarks.GraphNodeAddition.time_add_loop(10, 1)
       87.4±0.5μs       87.2±0.2μs     1.00  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(10, 10000)
         622±10ns         620±40ns     1.00  paths.PathFunctionBenchmarks.time_all_simple_paths(10, 100)
       1.59±0.01m       1.58±0.01m     1.00  qiskit_terra.QiskitTranspilerBenchmarks.time_transpile(3)
       28.6±0.5μs       28.5±0.3μs     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path(100, 1000)
      6.51±0.01μs      6.48±0.04μs     1.00  paths.PathFunctionBenchmarks.time_dag_longest_path(100, 10)
      5.95±0.04ms      5.92±0.04ms     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path(100000, 1000)
          290±2ms        289±0.1ms     0.99  paths.PathsRoadGraphWesternUSA.time_astar_shortest_path(False)
      7.46±0.04μs      7.42±0.03μs     0.99  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(10, 1000)
       37.7±0.2ms       37.5±0.1ms     0.99  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(100, 1000000)
        347±0.7ns          345±2ns     0.99  node_benchmarks.RoadGraphFullUSA.time_get_node_data(False)
          515±6μs        512±0.6μs     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path_length(10000, 100)
          612±4ns          608±2ns     0.99  node_benchmarks.USANYCRoadGraph.time_remove_nodes_from(False)
         652±20ns          648±4ns     0.99  paths.PathFunctionBenchmarks.time_all_simple_paths(10000, 10)
         348±30ns          346±4ns     0.99  node_benchmarks.USANYCRoadGraph.time_get_node_data(True)
       60.5±0.5ms       60.2±0.7ms     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path(100, 1000000)
         67.0±1ms       66.5±0.5ms     0.99  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(100000, 100000)
         554±10μs          550±2μs     0.99  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(1000, 10000)
         37.3±1μs       37.1±0.2μs     0.99  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(100, 100)
          395±3ns         392±20ns     0.99  node_benchmarks.DiGraphNodeAddition.time_add_loop(10, 1)
          623±5ns         618±40ns     0.99  paths.PathFunctionBenchmarks.time_all_simple_paths(10, 10)
      5.97±0.04ms      5.92±0.02ms     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path(100000, 100)
          418±2μs          414±1μs     0.99  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(1000, 1000)
          127±6ms          126±1ms     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path(1000000, 1000)
          512±9ms          508±2ms     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path(1000000, 1000000)
         649±50ns          643±7ns     0.99  paths.PathFunctionBenchmarks.time_all_simple_paths(1000000, 100)
      3.76±0.03ms      3.72±0.01ms     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path(1000, 100000)
       1.44±0.01s          1.43±0s     0.99  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(1000000, 1000)
         652±20ns          646±2ns     0.99  paths.PathFunctionBenchmarks.time_all_simple_paths(1000000, 100000)
          411±3μs          407±2μs     0.99  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(1000, 100)
      6.42±0.01μs      6.36±0.02μs     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path_length(100, 10)
         445±20ns         440±20ns     0.99  node_benchmarks.AsiaRoadGraph.time_remove_nodes_from
       13.8±0.3ms       13.6±0.2ms     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path(100000, 100000)
      7.51±0.06ms      7.43±0.04ms     0.99  paths.PathsUSANYCRoadGraph.time_astar_shortest_path(False)
          127±1ms        126±0.3ms     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path_length(1000000, 10)
          792±7ns          784±3ns     0.99  paths.PathFunctionBenchmarks.time_all_simple_paths(100, 100)
       60.6±0.5ms       59.9±0.6ms     0.99  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(100000, 1000)
      2.71±0.01ms      2.68±0.01ms     0.99  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(1000, 100000)
      1.61±0.01μs      1.59±0.01μs     0.99  paths.PathFunctionBenchmarks.time_all_simple_paths(100, 1000)
         640±10ns          633±7ns     0.99  paths.PathFunctionBenchmarks.time_all_simple_paths(10, 1000000)
          396±2ns         391±20ns     0.99  node_benchmarks.GraphNodeAddition.time_add_loop(1000, 1)
      1.58±0.01ms         1.56±0ms     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path(100, 100000)
         654±10ns          646±5ns     0.99  paths.PathFunctionBenchmarks.time_all_simple_paths(10000, 100000)
      4.97±0.01ms      4.90±0.02ms     0.99  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(10000, 10000)
         823±10ns          813±8ns     0.99  paths.PathFunctionBenchmarks.time_all_simple_paths(1000000, 1000000)
       60.2±0.4ms       59.5±0.3ms     0.99  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(100000, 10)
      4.66±0.03ms      4.60±0.01ms     0.99  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(10000, 10)
         651±20ns          643±4ns     0.99  paths.PathFunctionBenchmarks.time_all_simple_paths(10000, 10000)
      4.11±0.03ms      4.06±0.02ms     0.99  paths.PathsUSANYCRoadGraph.time_astar_shortest_path(True)
          833±5μs          822±1μs     0.99  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(100, 100000)
       55.5±0.7μs         54.7±1μs     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path(1000, 10)
       60.1±0.2μs      59.3±0.05μs     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path_length(1000, 100)
         581±10μs        573±0.7μs     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path(10000, 1000)
          617±9ns          609±1ns     0.99  node_benchmarks.USANYCRoadGraph.time_remove_nodes_from(True)
      1.59±0.02ms      1.57±0.01ms     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path_length(100, 100000)
          242±1ms          239±3ms     0.99  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(100000, 1000000)
      3.77±0.03ms      3.72±0.01ms     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path_length(1000, 100000)
         658±10ns          648±2ns     0.99  paths.PathFunctionBenchmarks.time_all_simple_paths(1000000, 10)
          128±4ms          126±1ms     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path(1000000, 100)
          513±2μs        506±0.4μs     0.99  paths.PathFunctionBenchmarks.time_dag_longest_path(10000, 10)
       10.7±0.02s       10.6±0.04s     0.98  qiskit_terra.QiskitTranspilerBenchmarks.time_transpile(0)
         626±10ns          617±7ns     0.98  paths.PathFunctionBenchmarks.time_all_simple_paths(100, 10)
          891±8μs          878±1μs     0.98  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(10, 100000)
      60.4±0.08μs      59.4±0.02μs     0.98  paths.PathFunctionBenchmarks.time_dag_longest_path(1000, 100)
       33.7±0.4ms       33.2±0.2ms     0.98  paths.PathFunctionBenchmarks.time_dag_longest_path(10, 1000000)
        159±0.8μs        157±0.4μs     0.98  paths.PathFunctionBenchmarks.time_dag_longest_path(100, 10000)
        112±0.8ms        110±0.2ms     0.98  node_benchmarks.TwoDimensionDynamicSimulation.time_nodes
          410±2ns         403±30ns     0.98  node_benchmarks.DiGraphNodeAddition.time_add_loop(1000000, 1)
      4.74±0.03ms         4.67±0ms     0.98  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(10000, 1000)
       6.91±0.2ms      6.80±0.01ms     0.98  paths.PathFunctionBenchmarks.time_dag_longest_path_length(100000, 10000)
         656±10ns          645±2ns     0.98  paths.PathFunctionBenchmarks.time_all_simple_paths(100000, 10000)
         658±20ns          647±3ns     0.98  paths.PathFunctionBenchmarks.time_all_simple_paths(1000000, 10000)
          406±6μs        399±0.5μs     0.98  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(1000, 10)
      4.71±0.04ms      4.63±0.01ms     0.98  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(10000, 100)
          357±3ns          351±4ns     0.98  node_benchmarks.RoadGraphWesternUSA.time_get_node_data(True)
      6.04±0.04ms      5.94±0.02ms     0.98  paths.PathFunctionBenchmarks.time_dag_longest_path_length(100000, 1000)
         98.4±1ms       96.7±0.3ms     0.98  node_benchmarks.RoadGraphWesternUSA.time_nodes(True)
          965±2μs          948±3μs     0.98  paths.PathFunctionBenchmarks.time_dag_longest_path(10000, 10000)
       55.6±0.1μs      54.5±0.09μs     0.98  paths.PathFunctionBenchmarks.time_dag_longest_path_length(1000, 10)
       61.2±0.9ms       60.1±0.3ms     0.98  paths.PathFunctionBenchmarks.time_dag_longest_path_length(100, 1000000)
          151±2ms          148±3ms     0.98  node_benchmarks.GraphNodeAddition.time_add_loop(100, 1000000)
          133±1ms          130±1ms     0.98  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(1000, 1000000)
         47.2±1μs       46.2±0.8μs     0.98  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(100, 1000)
       5.98±0.3ms      5.86±0.01ms     0.98  paths.PathFunctionBenchmarks.time_dag_longest_path_length(100000, 100)
       21.3±0.3ms       20.8±0.1ms     0.98  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(10, 1000000)
      5.87±0.09ms      5.74±0.01ms     0.98  paths.PathFunctionBenchmarks.time_dag_longest_path_length(100000, 10)
         664±20ns          650±7ns     0.98  paths.PathFunctionBenchmarks.time_all_simple_paths(1000000, 1000)
       6.97±0.5ms      6.82±0.05ms     0.98  paths.PathFunctionBenchmarks.time_dag_longest_path(100000, 10000)
        177±0.6ms          173±3ms     0.98  paths.PathsRoadGraphWesternUSA.time_astar_shortest_path(True)
      9.66±0.02μs      9.44±0.02μs     0.98  paths.PathFunctionBenchmarks.time_all_simple_paths(100, 10000)
         832±10ns          812±4ns     0.98  paths.PathFunctionBenchmarks.time_all_simple_paths(100000, 100000)
          124±5ms        121±0.5ms     0.98  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(1000, 1000000)
         663±20ns         646±10ns     0.98  paths.PathFunctionBenchmarks.time_all_simple_paths(10000, 1000000)
          207±2ns          202±6ns     0.97  node_benchmarks.TwoDimensionDynamicSimulation.time_remove_node
       62.8±0.3ms       61.2±0.6ms     0.97  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(100000, 10000)
       90.1±0.1μs       87.8±0.4μs     0.97  paths.PathFunctionBenchmarks.time_all_simple_paths(100, 100000)
         446±20ns         435±20ns     0.97  node_benchmarks.TwoDimensionDynamicSimulation.time_remove_nodes_from
       34.1±0.5ms      33.2±0.06ms     0.97  paths.PathFunctionBenchmarks.time_dag_longest_path_length(10, 1000000)
       1.49±0.01s          1.45±0s     0.97  paths.PathsRoadGraphFullUSA.time_astar_shortest_path(False)
      5.96±0.08ms      5.80±0.02ms     0.97  paths.PathFunctionBenchmarks.time_dag_longest_path(100000, 10)
         669±40ns          650±6ns     0.97  paths.PathFunctionBenchmarks.time_all_simple_paths(100000, 100)
        141±0.5ms          136±1ms     0.97  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(100000, 1000000)
         1.79±0μs      1.73±0.07μs     0.97  node_benchmarks.GraphNodeAddition.time_add_loop(1000, 10)
        373±0.2ms          361±3ms     0.97  node_benchmarks.RoadGraphFullUSA.time_nodes(False)
       38.0±0.8μs       36.7±0.3μs     0.97  toplogical_sort.TopologicalSortBenchmarks.time_lexicographical_topological_sort(100, 10)
         65.0±1μs       62.8±0.4μs     0.97  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(100, 10000)
          234±4ms          226±2ms     0.97  paths.PathFunctionBenchmarks.time_dag_longest_path(100000, 1000000)
          236±6ms          227±2ms     0.96  paths.PathFunctionBenchmarks.time_dag_longest_path_length(100000, 1000000)
          158±2ms          152±2ms     0.96  node_benchmarks.DiGraphNodeCreation.time_digraph_add_nodes_loop(1000000, True)
          204±3ns          197±8ns     0.96  node_benchmarks.AsiaRoadGraph.time_get_node_data
      1.74±0.05ms      1.67±0.01ms     0.96  node_benchmarks.USANYCRoadGraph.time_nodes(False)
        185±0.3ms          178±3ms     0.96  node_benchmarks.AsiaRoadGraph.time_nodes
          208±1ns          200±5ns     0.96  node_benchmarks.TwoDimensionDynamicSimulation.time_get_node_data
          339±2ns         324±20ns     0.96  node_benchmarks.RoadGraphWesternUSA.time_remove_node(True)
      1.03±0.01μs         976±20ns     0.95  node_benchmarks.GraphNodeCreation.time_graph_add_nodes_from(10)
      1.72±0.04ms      1.62±0.03ms     0.94  node_benchmarks.USANYCRoadGraph.time_nodes(True)
         322±10μs         301±20μs     0.93  paths.PathFunctionBenchmarks.time_dag_longest_path(1000, 10000)
       9.85±0.3μs      9.19±0.03μs     0.93  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(100, 1000)
      1.05±0.04μs          976±8ns     0.93  node_benchmarks.DiGraphNodeAddition.time_add_from(1, 10)
      1.05±0.03μs         970±10ns     0.93  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(10, False)
         1.11±0μs         1.03±0μs     0.93  node_benchmarks.DiGraphNodeAddition.time_add_from(1000000, 10)
      1.04±0.02μs          962±7ns     0.93  node_benchmarks.GraphNodeAddition.time_add_from(1000, 10)
      1.05±0.01μs          970±4ns     0.92  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(10, True)
      1.05±0.05μs          963±9ns     0.92  node_benchmarks.GraphNodeAddition.time_add_from(10, 10)
         296±10ns         272±30ns     0.92  node_benchmarks.RoadGraphWesternUSA.time___len__(False)
      3.19±0.03ms      2.93±0.01ms     0.92  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(10000, 100000)
      1.06±0.01μs         968±20ns     0.92  node_benchmarks.GraphNodeAddition.time_add_from(100000, 10)
         1.12±0μs         1.03±0μs     0.92  node_benchmarks.GraphNodeAddition.time_add_from(1000000, 10)
         211±20ms          191±3ms    ~0.91  paths.PathFunctionBenchmarks.time_dag_longest_path(10000, 1000000)
         202±20ms          183±5ms    ~0.91  paths.PathFunctionBenchmarks.time_dag_longest_path(1000, 1000000)
          200±8ms        178±0.3ms    ~0.89  paths.PathFunctionBenchmarks.time_dag_longest_path_length(1000, 1000000)
      1.09±0.05μs          969±2ns    ~0.89  node_benchmarks.DiGraphNodeAddition.time_add_from(1000, 10)
      1.12±0.05μs          975±7ns    ~0.87  node_benchmarks.DiGraphNodeAddition.time_add_from(10, 10)
       3.67±0.1μs      3.20±0.01μs    ~0.87  toplogical_sort.TopologicalSortBenchmarks.time_topological_sort(100, 100)
      1.13±0.04μs         969±20ns    ~0.86  node_benchmarks.DiGraphNodeAddition.time_add_from(100000, 10)
       5.03±0.2μs       3.64±0.1μs    ~0.72  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(100, False)
       5.50±0.4μs       3.64±0.2μs    ~0.66  node_benchmarks.DiGraphNodeAddition.time_add_from(10000, 100)
       6.73±0.05s       4.23±0.02s    ~0.63  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(100000000, False)
       6.84±0.02s       4.17±0.02s    ~0.61  node_benchmarks.DiGraphNodeCreation.time_digraph_add_node_from(100000000, True)
          214±2ms      29.5±0.05ms    ~0.14  node_benchmarks.RoadGraphWesternUSA.time_nodes_indexes(False)

mtreinish added a commit that referenced this pull request Dec 2, 2020
* Add EdgeList and WeightedEdgeList return types

This commit adds 2 new return types EdgeList and WeightedEdgeList
that are used as the return type for functions that return
Vec<(usize, usize)> and Vec<(usize, usize, PyObject)> respectively.
This custom type implements the Python sequence protocol and can be
used as the list which was previously returned except for where
explicit type checking was used. Just as in #185 and #198 the
advantage here is that for large edge lists the conversion from
Rust to a Python type becomes a large bottleneck. This avoids that
conversion and only does it per element on access.

* Add new return types to docs

* Apply suggestions from code review

Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com>

* Fix docstring mistakes

* Update in_edges and out_edges to use WeightedEdgeList
mergify bot added a commit to Qiskit/qiskit that referenced this pull request Dec 9, 2020
In #5117 the noise adaptive layout pass was updated to use retworkx
internally for performance. In that PR there were a couple of TODO
comments added about using neighbors methods when they were released.
The retworkx 0.6.0 release was pushed last week so we can update the
usage and remove the TODO comments. The neighbors methods should have
lower overhead since it only returns a list of node indices instead of a
dictionary of (node index, edge weight). This will also get
significantly faster (for large neighbors lists) with
Qiskit/rustworkx#198.

Co-authored-by: Kevin Krsulich <kevin.krsulich@ibm.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants