Shortest path #39

Closed
opened 2026-01-29 15:01:32 +00:00 by claunia · 11 comments
Owner

Originally created by @Shreya2704 on GitHub (Oct 28, 2019).

To find the shortest path between 2 cities

Originally created by @Shreya2704 on GitHub (Oct 28, 2019). To find the shortest path between 2 cities
claunia added the Staleenhancement labels 2026-01-29 15:01:32 +00:00
Author
Owner

@ghost commented on GitHub (Feb 2, 2020):

Hi can i take up this issue ?
Plus any specific algortihm you have in mind ?

@ghost commented on GitHub (Feb 2, 2020): Hi can i take up this issue ? Plus any specific algortihm you have in mind ?
Author
Owner

@ghost commented on GitHub (Feb 3, 2020):

hi @Shreya2704 can you verify if the issue is resolved ? I have done a pull request for this ...if you find this solves your problem kindly merge it or if further additions need to be made ,please list them here.

@ghost commented on GitHub (Feb 3, 2020): hi @Shreya2704 can you verify if the issue is resolved ? I have done a pull request for this ...if you find this solves your problem kindly merge it or if further additions need to be made ,please list them here.
Author
Owner

@deadshotsb commented on GitHub (May 18, 2020):

@sagnik-chatterjee Well the Djikstra's algorithm can be used to find a single source shortest path, but as "To find the shortest path between 2 cities", I find it more like applying an all pair Shortest path (floyd warshall algorithm) You may consider adding a dynamic programming approach for that, you may refer to: https://www.geeksforgeeks.org/floyd-warshall-algorithm-dp-16/

@deadshotsb commented on GitHub (May 18, 2020): @sagnik-chatterjee Well the Djikstra's algorithm can be used to find a single source shortest path, but as "To find the shortest path between 2 cities", I find it more like applying an all pair Shortest path (floyd warshall algorithm) You may consider adding a dynamic programming approach for that, you may refer to: https://www.geeksforgeeks.org/floyd-warshall-algorithm-dp-16/
Author
Owner

@Manavpreeet commented on GitHub (May 20, 2020):

Can i take this issue ? Let me know if you have any particular choice !

@Manavpreeet commented on GitHub (May 20, 2020): Can i take this issue ? Let me know if you have any particular choice !
Author
Owner

@plongueira commented on GitHub (May 21, 2020):

Maybe use discrete mathematics theory for example directed graphs and weighted graphs could solve the problem (i.e) the distance between 2 cities without a direct connection is unknown so in order to get a close reflect of the reality you could check different paths between those two cities,then adding the weights between each pair of cities from city source to destiny and that'd be all

@plongueira commented on GitHub (May 21, 2020): Maybe use discrete mathematics theory for example directed graphs and weighted graphs could solve the problem (i.e) the distance between 2 cities without a direct connection is unknown so in order to get a close reflect of the reality you could check different paths between those two cities,then adding the weights between each pair of cities from city source to destiny and that'd be all
Author
Owner

@deadshotsb commented on GitHub (May 24, 2020):

@ManavpreetSingh Yes sure

@deadshotsb commented on GitHub (May 24, 2020): @ManavpreetSingh Yes sure
Author
Owner

@ashwinshaji6679 commented on GitHub (Aug 27, 2021):

Can I take up this issue

@ashwinshaji6679 commented on GitHub (Aug 27, 2021): Can I take up this issue
Author
Owner

@Panquesito7 commented on GitHub (Aug 27, 2021):

Can I take up this issue

Thank you for your interest in contributing. 👍
Before submitting a PR, please ensure the following:

  • The algorithm isn't a duplicate in this repository.
  • Make your code as per the repository standards.
  • Ensure that all the automated-tests pass.

I'll look forward to reviewing your pull request as soon as I can. Thanks. 🙂

@Panquesito7 commented on GitHub (Aug 27, 2021): > Can I take up this issue Thank you for your interest in contributing. 👍 Before submitting a PR, please ensure the following: * The algorithm isn't a duplicate in this repository. * Make your code as per the repository [standards](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md). * Ensure that all the [automated-tests](https://github.com/TheAlgorithms/C-Plus-Plus/actions) pass. I'll look forward to reviewing your pull request as soon as I can. Thanks. 🙂
Author
Owner

@HybridDog commented on GitHub (Oct 4, 2021):

In practice, e.g. in a car navigation system, the graph is preprocessed so that the distance between two cities can later be queried in e.g. O(sqrt(n) log(n)), which is a lot faster than Dijkstra's algorithm (excluding the preprocessing time).
https://en.wikipedia.org/wiki/Contraction_hierarchies

@HybridDog commented on GitHub (Oct 4, 2021): In practice, e.g. in a car navigation system, the graph is preprocessed so that the distance between two cities can later be queried in e.g. O(sqrt(n) log(n)), which is a lot faster than Dijkstra's algorithm (excluding the preprocessing time). https://en.wikipedia.org/wiki/Contraction_hierarchies
Author
Owner

@github-actions[bot] commented on GitHub (Dec 11, 2021):

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions[bot] commented on GitHub (Dec 11, 2021): This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Author
Owner

@github-actions[bot] commented on GitHub (Dec 18, 2021):

Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions[bot] commented on GitHub (Dec 18, 2021): Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our [Gitter](https://gitter.im/TheAlgorithms) channel or our [Discord server](https://discord.gg/c7MnfGFGa6). Thank you for your contributions!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#39