# The matching problem of graphs and maximum flow problem (IV.) edge connectivity and point connectivity of graphs

Source: Internet
Author: User
Tags min

Recently a little busy, long time no follow-up, interested friends can first familiar with the first three articles, (i) narrated the basic concept; (b) The principle and proof of the maximum flow algorithm is introduced, and the realization of the Java language is welcomed.

Back to the point of view, first of all, what is the graph of the edge connectivity and points connectivity degree. In general, point connectivity refers to the corresponding graph G, for all point sets U belong V (g), that is, the subset of V (G) makes g-u either a disconnected graph or a trivial graph (that is, a graph that contains only a single point), where the smallest set U is the point connectivity of graph G, Sometimes it is also directly referred to as the connectivity of graphs. Popular point, is a figure g at least to remove how many points will become a non-connected graph or ordinary figure. Of course, for a complete graph kn, its connectivity is n-1.

By the same token, the edge connectivity is for a non-trivial graph G, at least how many edges can be removed to make the graph into a disconnected graph. Our problem is, for any graph, how to find the graph connectivity and edge connectivity? How does this relate to the maximum flow problem?

For simplicity's sake, let's first say how to find the edge connectivity of a graph Lamda (G). (based on the non-graph considerations)

For Fig. G, the u,v is the two vertices on fig g, and the definition R (U,V) is to remove the least edges so that there is no path between U and V. Convert graph G to a stream network H,u as the source, V is the meeting point, the edge capacity is 1, then obviously R (U,V) is the minimum cut of the flow network, according to the introduction in (b), it is equal to the maximum flow of the flow network.

However, we have not solved the problem so far, because it is clear that the edge connectivity Lamda (G) We require is the smallest of all point pairs <u,v> R (u,v). In this case, we have to traverse all the point pairs, and the complexity of the traversal is O (n*n). This is obviously too expensive, and in fact, we don't have to traverse all the point-to-point pairs.

As shown in the figure, set S is the smallest cut set of fig G, then LAMDA (g) =| s|. Set at any point u, if u in L, then there must be at least one point V, so that R (u,v) =| S| (v is formed when R is inside). So, we just need to take a point u, calculate the u and other points of R (U,v), take the smallest, must be equal to the minimum cut set, that is, edge connectivity.

```public class Edgeconnectivity {/** * @param args */public static void main (string[] args)
{Double graph[][]={{0,1,0,1,0,0}, {1,0,1,0,1,0}, {0,1,0,0,0,1},
{1,0,0,0,1,0}, {0,1,0,1,0,1}, {0,0,1,0,1,0}}; Double graph2[][]={{0,1,1,1,1,1}, {1,0,1,1,1,1}, {1,1,0,1,1,1
}, {1,1,1,0,1,1}, {1,1,1,1,0,1}, {1,1,1,1,1,0}};

System.out.println (Edgeconnectivity (GRAPH2)); public static int edgeconnectivity (double graph[][]) {double Min=double.max
_value;
for (int i=1;i<graph.length;i++) {Double Maxflow=fordfulkerson.edmondskarpmaxflow (graph, 0, i);
if (maxflow<min) Min=maxflow;
}  return (int) min; }

}```

For point connectivity, it might be a bit more complicated. The method of finding the point connectivity is to convert to the edge connectivity, so we need to cleverly construct a flow network so that its edge connectivity equals the point connectivity of our original graph. Construct Stream Network N:

If G is a graph without direction:

(1) Each vertex v in the original G graph becomes the two vertices v ' and V ' in the N net, and the vertex v ' to V ' has an arc (there is a direction side) connection, the arc capacity is 1;

(2) Each side of the original G-Map e = UV, in the N-Net has two arcs e ' = u "V", E "=v" U "corresponding to it, E ' arc capacity is ∞, e" arc capacity is ∞

(3) To find the edge connectivity degree of the network

Related Keywords:

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.