Graph data structure (Graph)
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:
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.
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
You should read it
May be interested
- How to Make a Bar Graph in Excelthis wikihow teaches you how to make a visual representation of your data in microsoft excel using a bar graph. open microsoft excel. it resembles a white 'x' on a green background.
- Heap data structuredata structure the heap is a special case of a balanced binary tree data structure, where the root node's key is compared to its children and arranged accordingly.
- Instructions on how to graph in Excelinstructions on how to graph in excel. excel helps you to process and calculate data effectively, excel supports you to graph quickly.
- Hash Table data structurethe hash table data structure is a data structure that stores data in a federated manner. in hash table, data is stored in array format, in which data values have their own index values. accessing data becomes faster if we know the index of the data to find.
- How to Make a Line Graph in Microsoft Excelthis wikihow teaches you how to create a line graph from microsoft excel data. you can do this on both windows and mac versions of excel. open microsoft excel. double-click the excel program icon, which resembles a white 'x' on a green...
- Instructions for searching with Facebook Graph Searchgraph search is an old-style search engine on facebook, which allows users to search for friends, pictures, landmarks, ... according to the most complex conditions that users offer.
- How to Import, Graph, and Label Excel Data in MATLABwhether you are an experienced matlab user or a novice, you may not be fully aware of matlab's graphing abilities. matlab allows you to easily customize, label, and analyze graphs, giving you more freedom than the traditional excel graph....
- Structure (Struct) in C programmingarrays in c allow you to define several types of variables that can hold the values of several components of the same type. but the structure is another type of data in the c programming language, which allows you to combine other types of data.
- Facebook gradually improves Graph Searchfacebook said its search system is capable of processing an average of 1 billion searches a day and developers are still actively working to improve the tool.
- What is the best URL structure for SEO?many visitors will reach your website by clicking on a link, so you might be wondering if what's in the url of a particular page is really important.