Qiskit / rustworkx

A high performance Python graph library implemented in Rust.
https://www.rustworkx.org
Apache License 2.0
967 stars 140 forks source link

Hyperbolic generator improvements + fix #1212

Closed SILIZ4 closed 1 month ago

SILIZ4 commented 1 month ago

The hyperbolic distance returned NaN for very close vertices. This meant the hyperbolic geometric graph generator wouldn't create edges that should exist.

I realized it didn't make sense to accept infinite coordinates (hyperbolic distance is undefined in most cases) and return an error instead.

I swapped the order of the parameters in the rustworkx-core api to match the rustworkx api.

Finally, it's inconvenient to specify the time coordinates since it can be computed using the other coordinates. Users only need to specify the useful coordinates.

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 9425909095

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
rustworkx-core/src/generators/random_graph.rs 18 20 90.0%
<!-- Total: 19 21 90.48% -->
Files with Coverage Reduction New Missed Lines %
rustworkx-core/src/generators/random_graph.rs 1 85.04%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 9421992816: -0.004%
Covered Lines: 17350
Relevant Lines: 18105

💛 - Coveralls
coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 9428509697

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
rustworkx-core/src/generators/random_graph.rs 18 20 90.0%
<!-- Total: 19 21 90.48% -->
Files with Coverage Reduction New Missed Lines %
rustworkx-core/src/generators/random_graph.rs 1 85.04%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 9421992816: 0.03%
Covered Lines: 17356
Relevant Lines: 18105

💛 - Coveralls