Summary of Euler's loop

Source: Internet
Author: User

Related Concepts

Euler's loop goes through each side of the graph once and only once, and passes through each vertex's loop.
The Euler path passes through the path of each vertex once and only once in the graph.
A diagram of the Euclidean loop exists in the European region.
A semi-EU diagram with Euler's path.

 

Determination of undirected Europe

An undirected graph has a sufficient condition for the Euler Loop: It is connected and has no odd vertices.

A sufficient condition for an undirected graph to have an Euler's path: connected and the number of odd vertices is 2.

 

Owner's determination

A sufficient condition for a directed graph to have an Euler Loop: The base graph is connected and the inbound degrees of all vertices are equal to the outbound degrees.

A directed graph has a sufficient condition for the existence of an Euler's path: the base graph is connected and the entry degree of a certain vertex is 1 greater than the exit degree, the other vertex is 1 greater than the inbound degree, and the rest of the vertex is equal to the exit degree.

 

Euler's loop nature

Property 1: set C to a simple loop in the European Union g, and delete the edges in C from the graph G to get a new graph G ', then every extremely connected subgraph of G' has an Euler loop.
Property 2 let C1 and C2 be the two without public edges of graph G, but there is at least one Euler Loop of Public vertices. We can combine them into a new Euler Loop C '.

An algorithm for finding an undirected Euler's loop

Find any loop C in the figure;
Delete the edge that belongs to C in the figure;
Calculate the Euler Loop in each major connected component of the residual graph;
Merge the Euler Loop in each major connected component into C.

 

 

Euler's loop and Euler's path

Definition:
Euler's loop: each side exactly goes once and can return to the starting path.
Euler path: the path goes through each edge once, but it is not required to return to the starting point.

① First, let's look at the determination of the existence of Euler's loop:

1. undirected graph
If the degrees of each vertex are even, there is an Euler loop.

2. Directed Graph (all edges are unidirectional)
If the inbound degree of each node vertex is equal to the outbound degree, there is an Euler loop.

3. Euler's loop of the hybrid Graph
The Euler loop of the hybrid graph uses network streams.
The undirected edge of the graph is directed randomly to calculate the inbound and outbound degrees of each vertex. If the difference between the degree of entry and exit of a certain point is odd, there is certainly no Euler loop. Because the Euler Loop requires that each entry degree = exit level, that is, the total degree is an even number, there must be an Euler Loop for an odd degree point.
Now, the difference between the inbound and outbound degrees of each vertex is an even number. Divide this even number by 2 to get X. That is to say, for each vertex, as long as the X edge changes the direction (inbound> outbound is changed to inbound, outbound> inbound is changed to outbound), the inbound = outbound is guaranteed. If each vertex is inbound, it is obvious that this graph has an Euler loop.
Now the question is: which side should I change to allow each point to exit =? Construct a network flow model. First, the directed edge cannot be changed. It is useless to delete it. Didn't the undirected edge be targeted at the beginning? Set the direction of the network, and the maximum side length is 1. Create another S and T. For the inbound> outbound vertex u, the connection edge (u, T) and capacity are X. For the outbound> inbound vertex v, the connection edge (S, V ), the capacity is X (note that X is different for different points ). Then, check whether there is a full stream allocation. There is an Euler loop, and there is no or no. What is the Euler loop? View the stream value allocation, and reverse the edges of all traffic other than 0 (the upper limit is 1, and the stream value is not 0 or 1) to obtain the inbound degree =
Outdegree.
Because the stream is full, each inbound> outbound vertex has x edges. The incoming edges are reversed, OK, and inbound = outbound. The same is true for the entry point. So what should I do if it is not connected to S or t? The connection condition with S is "out"> "in", and "T" is "in"> "out", so this is neither a point connected with s nor T, as early as the beginning, = has been satisfied. In the network flow process, these points are "intermediate points ". We know that the traffic at the intermediate point is not allowed to accumulate. In this way, the incoming traffic will come out as much as possible. After the reverse flow, we will naturally continue to maintain a balance.
So, in this case, the Euler Loop problem of the hybrid graph is solved.


②. Determine the existence of Euler's path

I. Undirected graph
An undirected graph has an Euler's path. if and only when the degrees of all vertices in the graph are even or if the two degrees are odd, all the other vertices are even.

II. Directed Graph
A directed graph has an Euler's path. If the degree of all vertices in the graph is zero, the degree of one vertex is 1, the degree of the other vertex is-1, and the degree of other vertices is 0.

3. Hybrid image Euler's path
In fact, this part of the entire article is only written by me. I am very embarrassed. It's just that the online comrades have done a great job and there is no need to repeat the work. Do you know if you have found any of them, the first step to finding the Euler's path must be to find the Euler's loop, which is no exception in the hybrid diagram. How can we determine the existence of the Euler's loop problem in the hybrid diagram? First, we use the method mentioned above to determine whether the image has an Euler loop. If it exists, the Euler path must exist. If the Euler loop does not exist, we can enumerate the start and end points of the Euler path, connect a undirected edge, and then use the maximum flow to determine whether there is an Euler loop.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.