Christofides algorithm (by hand) (suboptimal solution - is it my fault?)
up vote
2
down vote
favorite
I would like to calculate an eularian path using Christofides algorithm on this graph: (Focus on the first number in each box representing the distance)
$alpha$ denotes the start and end vertex of the Eulerian path
Step 1 - Calculate minimum spanning tree $T$
Step 2 - Calculate the set of verices $O$ with odd degree in $T$
Step 3 - Form the subgraph of $G$ using only the vertices of $O$
This is starting to get confusing
Step 4 - Construct a minimum-weight perfect matching $M$ in this subgraph
Step 5 - Unite matching and spanning tree $T$ and $M$ to form an Eulerian multigraph
I am NOT satisfied
Did I do something wrong or did I simply just hit an sub-optimal solution.
It is not hard to see that the Eulerian path easily could be improved by either connection $G rightarrow H$ or $A rightarrow B$ as illustrated underneath:
algorithms graphs graph-theory matching spanning-trees
add a comment |
up vote
2
down vote
favorite
I would like to calculate an eularian path using Christofides algorithm on this graph: (Focus on the first number in each box representing the distance)
$alpha$ denotes the start and end vertex of the Eulerian path
Step 1 - Calculate minimum spanning tree $T$
Step 2 - Calculate the set of verices $O$ with odd degree in $T$
Step 3 - Form the subgraph of $G$ using only the vertices of $O$
This is starting to get confusing
Step 4 - Construct a minimum-weight perfect matching $M$ in this subgraph
Step 5 - Unite matching and spanning tree $T$ and $M$ to form an Eulerian multigraph
I am NOT satisfied
Did I do something wrong or did I simply just hit an sub-optimal solution.
It is not hard to see that the Eulerian path easily could be improved by either connection $G rightarrow H$ or $A rightarrow B$ as illustrated underneath:
algorithms graphs graph-theory matching spanning-trees
Christofides’ algorithm is an approximation algorithm. It is not guaranteed to produce an optimal solution.
– Yuval Filmus
8 hours ago
@YuvalFilmus That's why I am questioning whether I just hit a sub-optimal solution, however, it could also be a result of an error. I am new to the field of graph theory. All the terms are new to me, and so I could likely have made an error. Can you approve I did it right?
– Sebastian Nielsen
7 hours ago
I’m not going to check your solution. I can help you with any conceptual difficulties.
– Yuval Filmus
7 hours ago
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I would like to calculate an eularian path using Christofides algorithm on this graph: (Focus on the first number in each box representing the distance)
$alpha$ denotes the start and end vertex of the Eulerian path
Step 1 - Calculate minimum spanning tree $T$
Step 2 - Calculate the set of verices $O$ with odd degree in $T$
Step 3 - Form the subgraph of $G$ using only the vertices of $O$
This is starting to get confusing
Step 4 - Construct a minimum-weight perfect matching $M$ in this subgraph
Step 5 - Unite matching and spanning tree $T$ and $M$ to form an Eulerian multigraph
I am NOT satisfied
Did I do something wrong or did I simply just hit an sub-optimal solution.
It is not hard to see that the Eulerian path easily could be improved by either connection $G rightarrow H$ or $A rightarrow B$ as illustrated underneath:
algorithms graphs graph-theory matching spanning-trees
I would like to calculate an eularian path using Christofides algorithm on this graph: (Focus on the first number in each box representing the distance)
$alpha$ denotes the start and end vertex of the Eulerian path
Step 1 - Calculate minimum spanning tree $T$
Step 2 - Calculate the set of verices $O$ with odd degree in $T$
Step 3 - Form the subgraph of $G$ using only the vertices of $O$
This is starting to get confusing
Step 4 - Construct a minimum-weight perfect matching $M$ in this subgraph
Step 5 - Unite matching and spanning tree $T$ and $M$ to form an Eulerian multigraph
I am NOT satisfied
Did I do something wrong or did I simply just hit an sub-optimal solution.
It is not hard to see that the Eulerian path easily could be improved by either connection $G rightarrow H$ or $A rightarrow B$ as illustrated underneath:
algorithms graphs graph-theory matching spanning-trees
algorithms graphs graph-theory matching spanning-trees
edited 8 hours ago
asked 8 hours ago
Sebastian Nielsen
1164
1164
Christofides’ algorithm is an approximation algorithm. It is not guaranteed to produce an optimal solution.
– Yuval Filmus
8 hours ago
@YuvalFilmus That's why I am questioning whether I just hit a sub-optimal solution, however, it could also be a result of an error. I am new to the field of graph theory. All the terms are new to me, and so I could likely have made an error. Can you approve I did it right?
– Sebastian Nielsen
7 hours ago
I’m not going to check your solution. I can help you with any conceptual difficulties.
– Yuval Filmus
7 hours ago
add a comment |
Christofides’ algorithm is an approximation algorithm. It is not guaranteed to produce an optimal solution.
– Yuval Filmus
8 hours ago
@YuvalFilmus That's why I am questioning whether I just hit a sub-optimal solution, however, it could also be a result of an error. I am new to the field of graph theory. All the terms are new to me, and so I could likely have made an error. Can you approve I did it right?
– Sebastian Nielsen
7 hours ago
I’m not going to check your solution. I can help you with any conceptual difficulties.
– Yuval Filmus
7 hours ago
Christofides’ algorithm is an approximation algorithm. It is not guaranteed to produce an optimal solution.
– Yuval Filmus
8 hours ago
Christofides’ algorithm is an approximation algorithm. It is not guaranteed to produce an optimal solution.
– Yuval Filmus
8 hours ago
@YuvalFilmus That's why I am questioning whether I just hit a sub-optimal solution, however, it could also be a result of an error. I am new to the field of graph theory. All the terms are new to me, and so I could likely have made an error. Can you approve I did it right?
– Sebastian Nielsen
7 hours ago
@YuvalFilmus That's why I am questioning whether I just hit a sub-optimal solution, however, it could also be a result of an error. I am new to the field of graph theory. All the terms are new to me, and so I could likely have made an error. Can you approve I did it right?
– Sebastian Nielsen
7 hours ago
I’m not going to check your solution. I can help you with any conceptual difficulties.
– Yuval Filmus
7 hours ago
I’m not going to check your solution. I can help you with any conceptual difficulties.
– Yuval Filmus
7 hours ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
4
down vote
As mentioned by Yuval, Christofides’ algorithm is an approximation algorithm to the travelling salesman problem. It is not guaranteed to produce an optimal solution. So it is not unexpected that you could end up with a sub-optimal solution of
On the other hand, you did make a mistake while computing the minimal spanning tree. In your step 1 that calculates the minimum spanning tree, edge H$alpha$ should be replaced by edge HG.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
As mentioned by Yuval, Christofides’ algorithm is an approximation algorithm to the travelling salesman problem. It is not guaranteed to produce an optimal solution. So it is not unexpected that you could end up with a sub-optimal solution of
On the other hand, you did make a mistake while computing the minimal spanning tree. In your step 1 that calculates the minimum spanning tree, edge H$alpha$ should be replaced by edge HG.
add a comment |
up vote
4
down vote
As mentioned by Yuval, Christofides’ algorithm is an approximation algorithm to the travelling salesman problem. It is not guaranteed to produce an optimal solution. So it is not unexpected that you could end up with a sub-optimal solution of
On the other hand, you did make a mistake while computing the minimal spanning tree. In your step 1 that calculates the minimum spanning tree, edge H$alpha$ should be replaced by edge HG.
add a comment |
up vote
4
down vote
up vote
4
down vote
As mentioned by Yuval, Christofides’ algorithm is an approximation algorithm to the travelling salesman problem. It is not guaranteed to produce an optimal solution. So it is not unexpected that you could end up with a sub-optimal solution of
On the other hand, you did make a mistake while computing the minimal spanning tree. In your step 1 that calculates the minimum spanning tree, edge H$alpha$ should be replaced by edge HG.
As mentioned by Yuval, Christofides’ algorithm is an approximation algorithm to the travelling salesman problem. It is not guaranteed to produce an optimal solution. So it is not unexpected that you could end up with a sub-optimal solution of
On the other hand, you did make a mistake while computing the minimal spanning tree. In your step 1 that calculates the minimum spanning tree, edge H$alpha$ should be replaced by edge HG.
edited 5 hours ago
answered 6 hours ago
Apass.Jack
4,6351329
4,6351329
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f100618%2fchristofides-algorithm-by-hand-suboptimal-solution-is-it-my-fault%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Christofides’ algorithm is an approximation algorithm. It is not guaranteed to produce an optimal solution.
– Yuval Filmus
8 hours ago
@YuvalFilmus That's why I am questioning whether I just hit a sub-optimal solution, however, it could also be a result of an error. I am new to the field of graph theory. All the terms are new to me, and so I could likely have made an error. Can you approve I did it right?
– Sebastian Nielsen
7 hours ago
I’m not going to check your solution. I can help you with any conceptual difficulties.
– Yuval Filmus
7 hours ago