
タイトル：
0105 Eulerian Path Solution

概説：

All right. Let's look at the answer.

Here's a particular graph where all the nodes are of even degree.

Let's see what happens when we try to follow an Eulerian path.

Let's just pick any node to startsay Eand go to C.

There are some choices here. Let's follow an edge back to B.

Then maybe to D to C to A to B and to E.

So it looks like we were able to hit all of the edges exactly once.

This graph does have an Eulerian path.

But there's something very special about that path,

and that it is started at E and it ended with E.

Because the path actually started and ended at the same node,

that node should have even degree,

because each time we go into we come out,

except for the first time where we go out but then the last time we come back in.

Everything matches up and you end up with even degree.

This is a special kind of Eulerian path called an "Eulerian Tour."

"To tour" in the sense that we start off in our home city,

and we go around, we visit lots of things, and we come back to our home city.

We kind of did a tour of the graph, and it was very scenic.

That's an Eulerian Tour.

This first answer is definitely not correct.

Such a graph can have an Eulerian path.

No, it doesn't depend on the graph.

It turns out that this is going to be fine no matter what,

because we're going to end up starting and ending at the same node.

We could have actually started and ended on any of the nodes

and it would've worked out the same way. All such graphs do.

All graphs that have only even degree nodes do have Eulerian paths,

specifically Eulerian Tours, but it's not the case that all such graphs do.

Let's make a quick example graph just so that you can see it.

For this to work we need to have a graph where more than two of the nodes has odd degree.

Let's make one where four of the nodes has odd degree.

We have these four nodesF, G, H, and I.

Let's make it so that each of them has odd degree.

Now they all have even degree. Now two of them have odd degree.

If we connect these two guys, then they have odd degree as well.

All the nodes have odd degree. It's not just 0 or 2.

All of them have degree of 3.

Let's see what happens when we try to make an Eulerian path.

We'll pick some node like I.

We'll go I to G, G to F, F to I, I to H, H to F, and now we hit a dead end.

Maybe we didn't want to do that. Let's instead go H to G where we also hit a dead end.

In fact, you can do this all day long, and what you're going to discover

is there's always going to be at least one edge that you just can't visit,

because again, each node in this case has an odd degree.

Every part of the path has to come into the node and out of it,

so it has to have even degree except for the endpoint.

No matter what we're going to be stuck.