1.1 first talk about the one stroke Theorem
In 1736, Euler published the "one stroke Theorem" (and proved that the seven bridges problem does not exist at all ):
To complete a graph with one stroke, you must meet two conditions:
A. the graph is closed and connected.
B. The number of singularity (points connected to an odd edge) in the graph is 0 or 2. (That is, the number of vertices with an odd number in the graph is 0 or 2)
Note:
Odd vertex: vertex with an odd number of connected Edges
Even vertex: vertex with even edges
2.1 In terms of graph theory,
It is to determine whether the graph can traverse all the edges without repeating them. Such an image is calledEurope. The traversal path is calledEuler's path(A circle or a chain). If the path is closed (a circle), it is calledEuler Loop
2.2.1. Determination of whether an undirected graph has an Euler's path or loop: (the path here refers to a chain that is not connected at the beginning and end)
Euler's path: Graph connectivity. There are only two nodes with an odd degree in the graph (that is, the two endpoints of the Euler's path)
Euler's loop: Graph connectivity; all nodes in the diagram are even
2.2.2. Determine whether a directed graph has an Euler's path or loop: (the path here indicates that the first and end are not connected, but a chain)
Euler's path: Graph connectivity; inbound = outbound for other nodes except the two endpoints; inbound for one endpoint greater than outbound 1; inbound for one endpoint smaller than outbound 1
Euler's loop: Graph connectivity; inbound of all nodes = outbound
2.3 draw a stroke
■ A connected graph composed of even points can be written in one stroke. When you draw a picture, you can take any even point as the starting point, and you will be able to finish the painting with this point as the end point.
■ A connected graph with only two singularity (the rest are even points) can be drawn in one stroke. When painting, one singularity must be taken as the starting point and the other singularity endpoint.
■ You cannot draw any image in other situations. (If there are even singular points divided by two, you can calculate the number of strokes required for this graph .)
For example, the figure below: (a) IS (1), so one stroke can be taken; (B) (c) (d) is not in line with the above two situations, so one stroke is not allowed.
3.1 example
3.1.1 seven bridges (this is an abstraction of the seven bridges problem)
First, the model obtained after the seven bridges problem is abstracted. It consists of four vertices and seven edges. Note that the four vertices are all odd vertices. From the theorem, we can't draw one stroke.
3.1.2 Chinese Characters
Is the model obtained after the Chinese "string" is abstracted. Since only the vertices at the top and bottom are odd vertices, we can draw one stroke from Theorem 1.
Refer:
[1] Euler Loop http://zh.wikipedia.org/wiki/%E6%AC%A7%E6%8B%89%E5%9B%9E%E8%B7%AF
[2] one stroke problem http://baike.baidu.com/view/429465.htm
Repost this article please indicate the author and the source [Gary's influence] http://garyelephant.me, do not for any commercial purposes!
Author: Gary Gao focuses on the internet, distributed, high concurrency, automation, and software teams