Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output Issue #8

Open
mdrhmn opened this issue Apr 21, 2020 · 0 comments
Open

Output Issue #8

mdrhmn opened this issue Apr 21, 2020 · 0 comments

Comments

@mdrhmn
Copy link

mdrhmn commented Apr 21, 2020

Hello there. I stumbled upon your codings for my Algorithm Design course assignment. I tried to run it but I seem to not understand the output generated by the coding. Here's the output that I got:

Input:
tsp([[1, 1], [2, 5], [8, 0]])

Output:
Graph: {0: {1: 4.123105625617661, 2: 7.0710678118654755}, 1: {0: 4.123105625617661, 2: 7.810249675906654}, 2: {0: 7.0710678118654755, 1: 7.810249675906654}} MSTree: [(0, 1, 4.123105625617661), (0, 2, 7.0710678118654755)] Odd vertexes in MSTree: [1, 2] Minimum weight matching: [(0, 1, 4.123105625617661), (0, 2, 7.0710678118654755), (1, 2, 7.810249675906654)] Eulerian tour: [1, 0, 2, 1] Result path: [1, 2, 1, 1] Result length of the path: 15.620499351813308

Isn't Christofides Algorithm supposed to generated the shortest path between all the nodes? And why are the resulting path nodes repeated (three '1's). Would appreciate some clarification from your behalf!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant