Euler circuit problem

Euler circuit

There is a river called Pregel that passes through the city of Konigsberg. There are seven bridges in the city, connecting the two islands in the river with the river bank. Local residents are keen on a difficult problem: whether there is a route that can walk across the 7 bridges without repeating. This is the famous seven bridge problem. It was first proposed by the great mathematician Euler, and gave a perfect solution, as shown in the figure.
seven bridges problem
Euler first rewrote the seven bridges problem in graph (a) into graph (b) in the language of graph theory, then the problem becomes: can a road be made from a node in the undirected graph, and each edge Exactly once. Such a route is called the Euler path (enlerian path), which can be vividly called "one-stroke painting".
It is not difficult to find that in the Euler road, "in" and "out" are corresponding - except for the start point and end point, the number of "in and out" points should be equal, in other words, except for the start point and end point, other points The degrees of should have even numbers. Unfortunately, in the Seven Bridges problem, all 4 points have odd degrees (such points are also called singularities), so there cannot be an Euler path. The above conditions are also sufficient conditions - if an undirected graph is connected and has at most two singularities, then there must be an Euler path. If there are two singularities, you must start from one of them and end at the other; if there is no singularity, you can start from any point, and you will eventually return to this point (called an Euler circuit).

Guess you like

Origin blog.csdn.net/m0_68111267/article/details/130149615