Figure-many to many





    

Graph definition and terminology

Insert picture description here
Undirected graph : each edge is
a directed graph without direction: each edge is a
Insert picture description here
complete graph with direction: any two points have an edge connected
Insert picture description here
Undirected complete graph: any two points have an edge, n vertices, n(n-1)/2 edges
directed complete graph: any two points have two edges, n vertices, n(n-1) edges

Sparse graphs : graphs with few edges or arcs (e <n logn).
Dense graph : A graph with many edges or arcs.
Net : Edge/arc graph with weights.
Adjacent : The relationship between two vertices connected by an edge/arc.
If there is (vi, vj), then vi and vj are called adjacent points ;
if there is <vi, vj>, then it is said that vi is adjacent to vj, and vj is adjacent to vi.
Association (attachment) : the relationship between the edge/arc and the vertex.
Exists (vi, vj)/<vi, vj>

The degree of a vertex : the number of edges associated with the vertex, recorded as TD(v).
In a directed graph , the degree of the vertex is equal to the sum of the in-degree and the out-degree of the vertex . The in-degree of
vertex v is the number of directed edges with v as the end point. It is recorded as ID(v) . The out-degree of
vertex v is the number of directed edges with v as the starting point, which is recorded as OD(v)
Insert picture description here
. When the in-degree of one vertex in the directed graph is 0, and the in-degree of the other vertices are all 1, then this is a tree, and it is a directed tree .
Insert picture description here
Path : A sequence of vertices formed by consecutive edges.
Path length : The number of edges or arcs/the sum of weights on the path.
Loop (loop) : The path where the first vertex and the last vertex are the same.
Simple path : A path with different vertices except that the starting point and ending point of the path can be the same.
Simple loop (simple loop) : A path with different vertices except for the same start and end points.

Connected graph (strongly connected graph)
In the non-directed graph G=(V, {E}), if there is a path from v to u for any two vertices v, u, then G is called a connected graph ( Strongly connected graph).

Insert picture description here

Weights and nets : the correlation numbers of edges or arcs in the graph are called weights . Indicates the distance or cost from one vertex to another.
Weighted graphs are called nets .

Subgraph
is provided with two graphs G = (V, {E}if V1∈V, E1∈E, G1 is G, called sub FIG .

Insert picture description here

Connected component (strongly connected component)

  • Undirected graph G maximal connected subgraph called G of connected components .
    The maximum connected subgraph means that the subgraph is a G connected subgraph, and any vertices of G that are not in this subgraph are added, and the subgraph is not connected.

Insert picture description here

  • Directed graph G of maximal connected subgraph called G of strongly connected components .
    The maximally strongly connected subgraph means that the subgraph is a strongly connected subgraph of G, and any vertices of D that are not in the subgraph are added, and the subgraph is no longer strongly connected.
    Insert picture description here
    Minimal connected subgraph : This subgraph is a connected subgraph of G. If any edge is deleted from this subgraph, the subgraph is no longer connected.
    Spanning tree : a minimal connected subgraph containing all vertices of the undirected graph G. Spanning
    forest : For a non-connected graph, a collection of spanning trees of each connected component.
    Insert picture description here

Graph type definition

The abstract type data of the graph is defined as follows:
Insert picture description here
Insert picture description here

Graph storage structure

The logical structure of the
Insert picture description here
graph : many-to-many The graph does not have a sequential storage structure, but you can use a two-dimensional array to represent the relationship between elements

Guess you like

Origin blog.csdn.net/diviner_s/article/details/106544116