Graph data structure (Graph)

A graph (graph) is a form of visual representation of a set of objects in which pairs of objects are connected by links. Interconnected objects are represented by points called vertices, and links that connect vertices are called edges.

What is the graph data structure?

A graph (graph) is a form of visual representation of a set of objects in which pairs of objects are connected by links. Interconnected objects are represented by points called vertices, and links that connect vertices are called edges.

In general, a graph is a set of sets (V, E), where V is a set of vertices and E is a set of edges that connect point pairs. You follow the following graph:

Picture 1 of Graph data structure (Graph)

In the above graph:

V = {a, b, c, d, e}

E = {ab, ac, bd, cd, de}

Graph data structure (Graph)

Mathematical shapes can be represented in data structures. We can represent a shape using an array of vertices and a two-dimensional array of edges. Before continuing, we explore some of the following important concepts:

Vertex (Vertex) : Each node of the shape is represented as a vertex. In the example below, circles represent vertices. Therefore, points from A to G are vertices. We can represent these vertices using an array, where vertex A can be identified by index 0, point B is index 1 . as shown below.

Edge (Edge) : The edge represents a line connecting the two vertices. In the figure below, the lines A and B, B and C, . are the edges. We can use a two-dimensional array to represent these edges. In the example below, AB can be represented as 1 in row 0; BC is 1 in row 1, column 2, .

Juxtaposition : The two vertices are contiguous if they are connected through an edge. In the figure below, B is adjacent to A; C is close to B, .

Road : Line represents a series of edges between two vertices. In the figure below, ABCD represents a line from A to D.

Picture 2 of Graph data structure (Graph)

Basic operations on graph data structure

Following là cơ sở dữ liệu chính chính của một Graph, mà theo sau.

Add vertices : Add a vertex in the graph.

Add edges : Add an edge between two vertices of a graph.

Peak display: Displays a vertex of a graph.

This chapter is only an introduction to the Graphical Data Structure, to refer to this data structure, you can refer to some documents on Tutorialspoint or from any other source.

According to Tutorialspoint

Previous lesson: Quick Sort (Quick Sort)

Next lesson: Deep search algorithm

Update 25 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile