Data structures-basic terminology of graphs

Source: Internet
Author: User

Graph (graph) concept
 图(Graph)是一种比线性表和树更为复杂的数据结构。   线性结构:研究数据元素之间的一对一关系。除第一个和最后一个元素外,任何一个元素都有唯一的一个直接前驱和直接后继。   树结构:是研究数据元素之间的一对多的关系。每个元素对下(层)可以有0个或多个元素相联系,对上(层)只有唯一的一个元素相关,数据元素之间有明显的层次关系。

Graph structure: A study of many-to-many relationships between data elements. In this structure, there may be a relationship between any two elements. That is, the relationship between nodes can be arbitrary, and any element in the diagram may be related.
The graph is widely used and has infiltrated into other branches such as linguistics, logic, physics, chemistry, Telecommunications, computer science, and mathematics.

Definition and terminology of graphs
  图:是由顶点构成的有穷非空集合和顶点之间边的集合组成。通常表示为G=(V,E) 。其中:  G:表示一个图;  V:G中顶点(Vertex)的集合,记为V(G);  E:图G中边的集合,记为E(G) 。

Note the point:
1. Figure data Element, called Vertex (Vertex) (linear table: element; tree: node)
2, Vertex set has poor non-empty (linear table: Empty table; tree: Empty tree)
3, any two nodes in the graph may have a relationship, the logical relationship between vertices is represented by edges. (linear table: linear relationship; tree: Hierarchical relationship)

Graph without direction (undirected graphs)

Graph without direction (undirected graphs)
No edge: The edge between vertices v to W has no orientation. Denoted by an unordered pair (V, W).

No map: The edges between any two vertices in the graph are non-forward edges.

In an no-show diagram, right? (v,w)? E (G), with (W,V)? E (g), that is, E (g) is symmetric, either (v,w) or (W,v) represents an edge between V and W.

Direction graph (Directed graphs)

Directed Edge: The edge between the vertices V to W has a direction. A forward edge is also called an arc (ARC), denoted by an ordered pair (V, W). V is called the arc Tail (tail) or the initial point (initial node), and W is called the Arc Head (head) or the endpoint (terminal node).

Forward graph: The edges between any two vertices in the graph are forward edges.

Completely non-graphic
对于无向图,若图中顶点数为n ,边的数目为e,则e ?[0,n(n-1)/2 ] 。完全无向图:具有n(n-1)/2条边的无向图;即:图中任意两个不同的顶点间都有一条无向边。数学定义:   对于无向图G=(V,E),对?vi,vj?V ,当vi ≠vj,有<vi ,vj>?E。
Anbang to Figure
对于有向图,若图中顶点数为n ,弧的数目为e,则e?[0,n(n-1)] 。完全有向图:具有n(n-1)条边的有向图;即:图中任意两个不同的顶点间都存在方向相反的两条弧。数学定义:        对于有向图G=(V,E),对?vi,vj?V ,当vi ≠vj时,有<vi ,vj>?E∧<vj , vi >?E ,

Graphs with few edges or arcs (E

The relationship between vertices and edges of graphs

The relationship of the vertex to the edge of a graph:
The adjacency of vertices, the g= (V, E), if there is an arc (V,W)? E, it is said
Vertex v "adjacency to" Vertex W,
Vertex w "adjacency from" Vertex V,
Arcs (V,W) are associated with vertices V and W.
The penetration and the degree of the vertex: g= (V, E), vi? V
The number of forward edges (arcs) with VI as the starting point (arc tail) is called the outdegree of the Vertex VI, which is recorded as OD (vi);
The number of forward edges (arcs) with VI as the end point (Arc Head) is called the entry of Vertex VI (Indegree), which is recorded as ID (vi).
The degree of the dimension of the Vertex VI and the sum of the degrees of the degree of VI is called TD (VI). That
TD (vi) =od (vi) +id (vi)

path, path length, loop

For undirected graph g= (v,e), if the W is reached from vertex v through several edges, the vertex v and W are connected, also called Vertex v to W path (path). Whose path is a sequence of vertices
(v=vi0vi1...vim=w), Vij? V and (vij-1, Vij)? E j=1,2, ..., M
For the graph g= (v,e), there is a forward path from Vertex v to W, which refers to the ability to reach W from Vertex v through several pairs of edges (arcs). That
(v=vi0vi1...vim=w), Vij? V and (vij-1, Vij)? E j=1,2, ..., M

The length of the path: the number of edges on the path or a forward edge (ARC).
Simple path: In one path, the same vertices are not duplicated;
Loop (loop): The same path as the first vertex and the last vertex;
Simple loop (simple loop): In one loop, the remaining vertices do not recur except for the first and last vertex.

Connected graphs, connected components

To the g= graph (v,e),
If you have any two vertex vi in the diagram, VJ? V,vi and VJ are connected, it is said that figure G is a connected graph, otherwise known as a non-connected graph.
If G is a non-connected graph, then the maximal connected sub-graph is called the connected component of G. (if there is a path from vertex v to W, it is said that V and W are connected.) )
To the graph g= (v,e),
What if? VI, VJ? V, VI≠VJ have a path from VI to VJ and from VJ to VI, called graph G is a strong connected graph, otherwise known as non-strong connected graph.
If G is a non-strong connected graph, the strongly connected sub-graph is called the strong connected component of G.
Meaning of "great": Refers to the sub-graph and then increase the other vertices in Figure g, the child diagram is no longer connected.

Spanning tree

Spanning tree: The spanning tree of a connected graph (undirected graph) is a minimal connected sub-graph that contains all n vertices in the graph and only the n-1 edges that are sufficient to form a tree, called the spanning tree of the graph.
Several conclusions about the spanning tree of the non-direction graph:
A spanning tree with n vertices has only n-1 edges;
If a graph has n vertices and is less than n-1 edges, it is a non-connected graph;
If more than n-1 edge, then there must be a ring;
A graph with n-1 edges is not necessarily a spanning tree.

To trees, to build a forest

There is a direction tree: Only one vertex has an entry degree of 0, and the remaining vertices have a forward graph of 1.
Generate Forest: A graph-generated forest consists of a number of tree-trees, containing all the vertices in the graph, but only enough to form several disjoint arcs of the tree.

Network

Weighted graph: A graph with a weighted value attached to each edge (or arc).
NET or network: A weighted connected graph (including a weakly connected, undirected graph).
A network is a commonly used concept in engineering to denote a project or a process.

Data structures-basic terminology 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.