Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hackerkid/awesome-programming-problems
Collection of awesome programming problems with solutions
https://github.com/hackerkid/awesome-programming-problems
List: awesome-programming-problems
Last synced: 3 days ago
JSON representation
Collection of awesome programming problems with solutions
- Host: GitHub
- URL: https://github.com/hackerkid/awesome-programming-problems
- Owner: hackerkid
- License: cc0-1.0
- Created: 2015-09-25T08:36:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-25T08:44:04.000Z (over 9 years ago)
- Last Synced: 2024-12-29T05:01:53.404Z (13 days ago)
- Size: 137 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#Awesome Programming Problems
##Chinese Postman Problem
The Chinese postman problem is a mathematical problem of graph theory. It is also known as route inspection problem. Suppose there is a mailman who needs to deliver mail to a certain neighbourhood. The mailman is unwilling to walk far, so he wants to find the shortest route through the neighbourhood, that meets the following criteria:
* It is a closed circuit (it ends at the same point it starts).
* He needs to go through every street at least once.###Solution
* Step 1: Find all the nodes of odd order.
* Step 2: For each pair of odd nodes find the connecting path of minimum weight.
* Step 3: Pair up all the odd nodes so that the sum of the weights of the connecting paths from Step 2 is minimised.
* Step 4: In the original graph, duplicate the minimum weight paths found in Step 3.
* Step 5: Find a trail containing every arc for the new (Eulerian) Graph.
###Code
The link to the code is [here](https://github.com/hackerkid/LightOJ-Solutions/blob/master/1086-Jogging-Trails.cpp)