• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / rustworkx / 12365801109
96%
main: 94%

Build:
Build:
LAST BUILD BRANCH: gh-readonly-queue/main/pr-1530-48906ad026428218a5a0835ca01eaee170fbbf9a
DEFAULT BRANCH: main
Ran 17 Dec 2024 03:41AM UTC
Jobs 1
Files 108
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Dec 2024 03:30AM UTC coverage: 95.825% (-0.04%) from 95.868%
12365801109

push

github

web-flow
Migrate Johnson's algorithm to rustworkx-core (#1318)

* Migrate Johnson's algorithm to rustworkx-core

This commit adds Johnson's algorithm for computing simple cycles to
rustworkx-core. This implementation returns an iterator-like struct
which requires a reference to the graph for each step of the iterator.
This mirrors the structure of the Bfs and similar structs in petgraph.
While an implementor of Iterator could be used for this, this
complicates using it from Python because we can't have a shared
reference in a pyclass struct. This also has the advantage of enabling
mutable references while iterating over the cycles.

To facilitate this 2 traits are added `EdgeFindable` and `EdgeRemovable`
which add traits for `remove_edge()` and `find_edge()` to petgraph graph
types. The `EdgeRemovable` trait isn't actually used currently, it was
in an earlier local draft of the PR which attempted to remove self
cycles from a clone before changing direction of the interface. Since
the implementation was done and relatively simple, and the potential
general usefulness this was left in. `EdgeFindable` is actively used
by this new function however.

* Simplify python side logic

* Set name of pyclass to SimpleCycleIter for backwards compat

* Fix rustdoc warnings

---------

Co-authored-by: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com>
Co-authored-by: Ivan Carvalho <ivancarv@student.ubc.ca>

288 of 312 new or added lines in 4 files covered. (92.31%)

18360 of 19160 relevant lines covered (95.82%)

1137670.45 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
12
95.44
rustworkx-core/src/connectivity/johnson_simple_cycles.rs
12
10.71
-8.04% rustworkx-core/src/graph_ext/mod.rs
Jobs
ID Job ID Ran Files Coverage
1 12365801109.1 17 Dec 2024 03:41AM UTC 108
95.82
GitHub Action Run
Source Files on build 12365801109
  • Tree
  • List 108
  • Changed 26
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #12365801109
  • 14be08f9 on github
  • Prev Build on main (#12364370810)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc