Basic concepts of graphs

Source: Internet
Author: User

A graph is a more complex data structure than a tree structure. There is no limit to the number of precursors and successors of a node in the graph, and there may be a direct relationship between any two nodes.

Diagram definition: Figure g is a set of V and E consisting of a two-tuple, recorded as g= (V,e), where V is a non-empty finite set of vertices in the graph, E is a finite set of edges in the graph. From the point of view of the logical relationship of a data structure, any vertex in the graph may have relations with other vertices, and all vertices in the graph may have a relationship with a vertex. In the figure, the data elements in the structure are represented by vertices, and the relationships between the data elements are represented by edges.

① to graph. If each side of the graph has a direction, then the relationship between vertices is represented by <vi,vj>, and he shows that there is a forward edge (also known as an arc) from VI to VJ. VI is the beginning of the forward edge, called the arc Tail; VJ is the end point of the forward edge, called the arc head. A graph with a direction on all sides is called a directed graph.

The ② graph is not shown. If each edge in the diagram is non-directional, The Edge (VI,VJ) between Vertex VI and VJ is represented. Therefore, in a direction graph, <vi,vj> and <vj,vi> represent two edges respectively, whereas in an VI,VJ diagram (VJ,VI) The same edge is represented.

③ full picture. If there are n vertices in an n-1 graph, and each vertex has an edge between the other vertices, it is called a full graph without direction. Obviously, there are N (n-1)/2 edges in an absolute total graph with n vertices. Similarly, the number of edges in a directed full graph with n vertices is n (n-1), meaning that there are two edges with opposite directions between any of the two different vertices.

④ degrees, degrees and degrees of penetration. The degree of Vertex v refers to the number of edges associated with the vertex, which is recorded as D (v). If G is a forward graph, the degree of the vertex indicates the sum of the degrees and degrees of the vertex. The degree of vertex penetration is the number of forward edges with the vertex as the end point, and the degree of the vertex is the sum of the number of forward edges with the vertex as the starting point, recorded as ID (v) and OD (v), respectively.

⑤ path. In Figure g, the path length between two vertices refers to the number of edges passing through the path. The same path as the first vertex and the last vertex is called a loop or loop. If only the beginning and end vertices of a path are the same, the remaining vertices are not the same, it is called a simple path.

⑥ Sub-chart. If there are two graphs, g= (v,e) and g1= (V1,E1), if V1 is contained in V, and E1 is contained in E, then G1 is called a sub-graph of G.

⑦ connected graph and Unicom component. In undirected graph G, if there is a path from vertex v1 to vertex v2, the vertex v1 and vertex v2 are connected. If any of the two vertices in the undirected graph G are connected, it is called a connected graph. The maximal connected sub-graph of undirected graph G is called the connected component of G.

⑧ Strong connected graphs and strong connected components. In directed graph G, if the v1,v2 for each pair of fixed points is V and V1 is not equal to V2, there are paths from vertex v1 to vertex v2 and from vertex v2 to vertex v1, it is said that figure G is a strong connected graph. The maximal connected sub-graph in a forward graph is called a strongly connected component of a forward graph.

The two-part sub-graph of left-right separation is called connected component

⑨ Net. A graph of edges (or arcs) with weights is called a net.

⑩ to a tree. If a direction graph has a vertex with a degree of 0 and the remaining vertices are 1, it is a tree with a direction.

Basic concepts of graphs

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.