{"id":22513883,"url":"https://github.com/emahtab/bellman-ford-algorithm","last_synced_at":"2026-01-07T00:40:21.741Z","repository":{"id":79525299,"uuid":"443682899","full_name":"eMahtab/bellman-ford-algorithm","owner":"eMahtab","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-02T05:32:34.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T03:25:53.222Z","etag":null,"topics":["bellman-ford-algorithm","graph","shortest-path"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eMahtab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-01-02T04:44:27.000Z","updated_at":"2022-01-02T05:32:36.000Z","dependencies_parsed_at":"2023-03-12T08:27:09.647Z","dependency_job_id":null,"html_url":"https://github.com/eMahtab/bellman-ford-algorithm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fbellman-ford-algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fbellman-ford-algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fbellman-ford-algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fbellman-ford-algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eMahtab","download_url":"https://codeload.github.com/eMahtab/bellman-ford-algorithm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245952164,"owners_count":20699440,"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":["bellman-ford-algorithm","graph","shortest-path"],"created_at":"2024-12-07T03:14:47.341Z","updated_at":"2026-01-07T00:40:21.717Z","avatar_url":"https://github.com/eMahtab.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bellman Ford Algorithm\n\nBellman Ford algorithm is used to find the shortest path in a weighted graph from a source vertex.\n\n❗❗❗ Remember Bellman Ford algorithm works with negative weights.\n\n## Algorithm :\n1. Take a `distances[]` array and fill it with `Integer.MAX_VALUE` , set `distances[startingVertex] = 0`\n2. Sort the given edges according to edge weights\n3. If number of vertices are n, loop over edges **n-1** times (Outer loop)\n4. Loop over all the given edges(u,v) and relax (check if `dU + dUV \u003c dV`) the vertices if possible (Inner loop) and update the distances[v] accordingly.\n5. At the end `distances` array will have **shortest path** to all the vertices from the `startingVertex`\n\n\n\n# References :\nhttps://www.youtube.com/watch?v=IjEX4rgxsvI (Hindi, Good explanation)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femahtab%2Fbellman-ford-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femahtab%2Fbellman-ford-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femahtab%2Fbellman-ford-algorithm/lists"}