{"id":48413831,"url":"https://github.com/mnpatil17/negative_cycles","last_synced_at":"2026-04-06T06:35:19.202Z","repository":{"id":57445397,"uuid":"93213843","full_name":"mnpatil17/negative_cycles","owner":"mnpatil17","description":"For Finding Multiplicative Negative Cycles","archived":false,"fork":false,"pushed_at":"2017-08-07T05:27:39.000Z","size":27,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T12:39:02.593Z","etag":null,"topics":["bellman-ford-algorithm","negative-cycles"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnpatil17.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-03T00:44:36.000Z","updated_at":"2023-05-02T07:12:42.000Z","dependencies_parsed_at":"2022-09-26T17:30:52.299Z","dependency_job_id":null,"html_url":"https://github.com/mnpatil17/negative_cycles","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mnpatil17/negative_cycles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnpatil17%2Fnegative_cycles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnpatil17%2Fnegative_cycles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnpatil17%2Fnegative_cycles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnpatil17%2Fnegative_cycles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnpatil17","download_url":"https://codeload.github.com/mnpatil17/negative_cycles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnpatil17%2Fnegative_cycles/sbom","scorecard":{"id":655048,"data":{"date":"2025-08-11","repo":{"name":"github.com/mnpatil17/negative_cycles","commit":"35a8b163dcaa8556702dd9069d246fa1d80fd3e6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T14:25:47.690Z","repository_id":57445397,"created_at":"2025-08-21T14:25:47.691Z","updated_at":"2025-08-21T14:25:47.691Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31060829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T19:32:53.857Z","status":"ssl_error","status_checked_at":"2026-03-27T19:32:45.136Z","response_time":164,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bellman-ford-algorithm","negative-cycles"],"created_at":"2026-04-06T06:35:16.398Z","updated_at":"2026-04-06T06:35:19.187Z","avatar_url":"https://github.com/mnpatil17.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bellman-Ford and Negative Cycles in Python\n[![Build Status](https://travis-ci.org/mnpatil17/negative_cycles.svg?branch=master)](https://travis-ci.org/mnpatil17/negative_cycles)\n[![Latest Version](https://img.shields.io/pypi/v/negative-cycles.svg)](https://pypi.python.org/pypi/negative-cycles/)\n\n\n### Installation\n\nThis package uses pip for installation. You can find out more information about pip [here](https://pip.pypa.io/en/stable/quickstart/).\n\nInstallation can be done directly through pip, using `pip install negative-cycles`.\n\nIf this doesn't work, or you prefer having the source code on your machine, you can also execute the\nfollowing:\n\n1. `git clone https://github.com/mnpatil17/negative_cycles.git`\n2. `cd negative_cycles`\n3. `pip install -e .`\n\n\n### Usage\n\nThis package allows you to perform the following tasks in Python:\n\n1. Run the multiplicative Bellman-Ford algorithm\n2. Run the additive Bellman-Ford algorithm\n3. Find negative cycles based on the multiplicative Bellman-Ford algorithm\n\n\n#### Multiplicative Bellman-Ford Algorithm\n\nYou can run the multiplicative Bellman-Ford Algorithm as follows:\n\n    from negative_cycles import multiplicative_bellman_ford\n\n    graph = \u003cYOUR GRAPH HERE\u003e  # Note: for nodes without a connecting edge, the weights must be None\n    distance_vector, predecessor_list = multiplicative_bellman_ford(graph)\n\n\n#### Additive Bellman-Ford Algorithm\n\nYou can run the additive Bellman-Ford Algorithm as follows:\n\n    from negative_cycles import additive_bellman_ford\n\n    graph = \u003cYOUR GRAPH HERE\u003e  # Note: for nodes without a connecting edge, the weights must be None\n    distance_vector, predecessor_list = additive_bellman_ford(graph)\n\n\n#### Negative Cycles (Multiplicative)\n\nYou can run the multiplicative negative cycles as follows:\n\n    from negative_cycles import find_negative_cycle\n\n    graph = \u003cYOUR GRAPH HERE\u003e  # Note: for nodes without a connecting edge, the weights must be None\n    graph_labels = \u003cYOUR NODE NAMES\u003e  # The names of the nodes of the graph, in order\n    cycle, gain = find_negative_cycle(graph, graph_labels)\n\nNote that if a negative cycle is NOT found, both `cycle` and `gain` will be `None`.\n\nIf a negative cycle is found, the `cycle` returned will be of the form\n`['Node A', 'Node C', 'Node D', 'Node A']`, where the names in the list are based on your\n`graph_labels`, and the first and last elements of the list are repeated to emphasize that the list\nrepresents a cycle.\n\nAdditionally, if a negative cycle is found, the `gain` variable will be a number greater than\n(or equal to) `1.0`. This is to say that if you start with 1 unit and follow the`cycle`, then you\nwill get `gain` units at the end of the cycle.\n\n\n### Testing\n\nIf you choose, you can clone this repository locally and run the tests yourself.\nTo run tests, simply run `nosetests` from the `negative_cycles/` directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnpatil17%2Fnegative_cycles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnpatil17%2Fnegative_cycles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnpatil17%2Fnegative_cycles/lists"}