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

Qiskit / retworkx / 545 / 3
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 25 Jun 2020 09:17PM UTC
Files 3
Run time 1s
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

25 Jun 2020 09:13PM UTC coverage: 83.838% (+0.4%) from 83.483%
545.3

push

travis-ci-com

web-flow
Add graph greedy color function (#77)

* Add graph greedy color function

This commit adds a new function for getting the greedy coloring using a
largest first strategy.

* Add simple tests and fix bugs

This commit adds some simple tests to start and fixes bugs found via the
testing. Given the number of logic issues in the first draft of the
function we need more thorough testing prior to merging.

* Adjust sort key to be consistent with expectations

The sorting we were using was different then the equivalent function in
networkx this is trying to match. Instead of doing a stable sort and
then reversing this could result in a different sorting order than what
someone migrating from the equivalent networkx function would expect.
This commit changes the sort key to be the
{number of nodes} - {number of neighbors} to address this. It also has
the advantage of speeding it up because we don't have to do the inplace
reverse.

* Calculate sort keys upfront

This commit reworks the sorting to calculate the keys upfront all at
once prior to doing the sorting and storing them in a hashmap. Then the
sort function is just based on a hashmap value lookup. This makes the
number of times we run sorting key function (which gets a count of
neighbors and subtracts the node count from it) less which speeds up the
run time.

* Add docs

* Add comment explaining sort key

* Handle edge case of large degrees in multigraphs

This commit fixes an edge case in the new function where we'd get
incorrect results if the degree of a node was greater than the number of
nodes in the graph. We previously would cause an overflow by subtracting
number of nodes - degree and the reverse ordering was broken because the
node with the large degree is now a larger number instead of a smaller
number. This fixes this issue by using the Reverse struct from std::cmp
[1] and making the sort key Reverse(degree). The hash map previously
used is kept in ... (continued)

1053 of 1256 relevant lines covered (83.84%)

1644.88 hits per line

Source Files on job 545.3
  • Tree
  • List 0
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 117
  • Travis Job 545.3
  • f804879d on github
  • Prev Job for on master (#528.3)
  • Next Job for on master (#547.3)
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