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

Qiskit / rustworkx / 26096779769 / 1
95%
main: 95%

Build:
Build:
LAST BUILD BRANCH: fix-adjacency-matrix-node-list
DEFAULT BRANCH: main
Ran 19 May 2026 12:37PM UTC
Files 118
Run time 5s
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

19 May 2026 12:20PM UTC coverage: 94.722% (+0.05%) from 94.671%
26096779769.1

push

github

web-flow
Add kamada_kawai_layout function (#1583)

* Add kamada_kawai_layout function

Adds rustworkx.kamada_kawai_layout, supporting both PyGraph and
PyDiGraph inputs. Implements the original Kamada-Kawai (1989)
algorithm: an outer loop selects the node with the largest
partial-gradient norm and an inner loop applies a 2D Newton step
against the local Hessian until convergence.

Disconnected graphs are laid out by running Kamada-Kawai
independently on each connected component and packing the
components in a horizontal row, which avoids the visual collapse
seen with single-objective Kamada-Kawai on disconnected inputs.
Directed graphs have their distance matrix symmetrised before
optimising (Kamada-Kawai is fundamentally undirected).

Closes #438

* ruff format: K-K test files

* Remove dead code from kamada_kawai_layout dispatcher

The dispatcher fallthrough should only raise TypeError - the leftover
networkx_converter body was unreachable after the raise and duplicated
the real networkx_converter at line 948.

* Use DictMap for K-K pos parameter

DictMap preserves insertion order matching Python dict semantics. The
fixed parameter remains HashSet since order is never observed (only
contains/is_empty are called on it).

* Reuse edge_weights_from_callable for K-K edge weights

Replaces hand-rolled edge weight extraction with the codebase helper
that already handles weight_fn=None via default_weight, matching the
pattern used by bellman-ford, floyd-warshall, and other shortest-path
functions. Negative-weight validation stays since the helper doesn't
check (and Dijkstra requires non-negative weights).

* Use undirected view for K-K distance matrix

Replaces the min(d_ij, d_ji) symmetrisation with an explicit undirected
graph built from the source topology.  The min-based approach failed
for weakly-connected digraphs: e.g. graph 0->1<-2 yielded d(0,2)=Inf
because neither directed traversal can reach 0 from 2 or vice versa.
Building an undirected view gives d(0,2)... (continued)

19079 of 20142 relevant lines covered (94.72%)

922694.19 hits per line

Source Files on job 26096779769.1
  • Tree
  • List 118
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 26096779769
  • 7a6d4b0f on github
  • Prev Job for on gh-readonly-queue/main/pr-1583-7b48ce2d9fcf92f5963c29d25f4868cc68cb5c4d (#26058554497.1)
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

© 2026 Coveralls, Inc