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

Qiskit / retworkx / 545
97%

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

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)

27 of 27 new or added lines in 1 file covered. (100.0%)

1053 of 1256 relevant lines covered (83.84%)

1644.88 hits per line

Jobs
ID Job ID Ran Files Coverage
3 545.3 25 Jun 2020 09:17PM UTC 0
83.84
Travis Job 545.3
Source Files on build 545
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #545
  • f804879d on github
  • Prev Build on master (#528)
  • Next Build on master (#547)
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