{"id":25191466,"url":"https://github.com/nelsonbn/algorithms-data-structures-bellman-ford","last_synced_at":"2025-04-04T12:42:58.709Z","repository":{"id":275663529,"uuid":"926798376","full_name":"NelsonBN/algorithms-data-structures-bellman-ford","owner":"NelsonBN","description":"Algorithms and Data Structures - Bellman-Ford","archived":false,"fork":false,"pushed_at":"2025-03-02T13:27:51.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T14:28:30.513Z","etag":null,"topics":["algorithms","algorithms-and-data-structures","data-structures"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NelsonBN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-03T21:51:32.000Z","updated_at":"2025-03-02T13:27:54.000Z","dependencies_parsed_at":"2025-03-02T14:34:27.256Z","dependency_job_id":null,"html_url":"https://github.com/NelsonBN/algorithms-data-structures-bellman-ford","commit_stats":null,"previous_names":["nelsonbn/algorithms-data-structures-bellman-ford"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NelsonBN%2Falgorithms-data-structures-bellman-ford","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NelsonBN%2Falgorithms-data-structures-bellman-ford/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NelsonBN%2Falgorithms-data-structures-bellman-ford/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NelsonBN%2Falgorithms-data-structures-bellman-ford/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NelsonBN","download_url":"https://codeload.github.com/NelsonBN/algorithms-data-structures-bellman-ford/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182338,"owners_count":20897379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["algorithms","algorithms-and-data-structures","data-structures"],"created_at":"2025-02-09T22:34:17.137Z","updated_at":"2025-04-04T12:42:58.701Z","avatar_url":"https://github.com/NelsonBN.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Algorithms and Data Structures - Bellman-Ford\n\n\n## Characteristics\n- Time complexity:\n  - Best: O(V) (when there are no negative edges and the shortest path is found in the first iteration)\n  - Average: O(V)\n  - Worst: O(V x E)\n  - Worst: O(V x E) (when all edges need to be relaxed in every iteration)\n- Space complexity: O(V) (storing distances and predecessors)\n\n\n## Graphs\n\n### No negative cycles\n\n```mermaid\ngraph LR\n  A --\u003e|4| B\n  A --\u003e|2| D\n  B --\u003e|2| C\n  B --\u003e|3| D\n  B --\u003e|3| E\n  D --\u003e|1| B\n  D --\u003e|6| C\n  D --\u003e|4| E\n  E --\u003e|-5| C\n```\n\n### With negative cycles\n\n```mermaid\ngraph LR\n  A --\u003e|4| B\n  A --\u003e|2| D\n  B --\u003e|2| C\n  B --\u003e|3| D\n  B --\u003e|3| E\n  C --\u003e|4| D\n  D --\u003e|1| B\n  D --\u003e|4| E\n  E --\u003e|-9| C\n```\n\n## Demos\n\n- [Distances](./src/distances.py)\n- [Distances with improved](./src/distances_improved.py)\n- [Paths](./src/paths.py)\n\n\n## References\n- [Other Algorithms \u0026 Data Structures](https://github.com/NelsonBN/algorithms-data-structures)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnelsonbn%2Falgorithms-data-structures-bellman-ford","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnelsonbn%2Falgorithms-data-structures-bellman-ford","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnelsonbn%2Falgorithms-data-structures-bellman-ford/lists"}