Graph Structure Basic and Code Implementation
Prerequisites
Before reading this article, you should first learn:
Summary in One Sentence
A graph structure is an extension of the multi-ary tree structure.
In a tree structure, a parent node can only point to child nodes, and there are no child-to-parent links, nor links between sibling nodes. In contrast, a graph has fewer restrictions, allowing nodes to interconnect, forming a complex network structure.
Originally, I intended to include the graph data structure as an extension of the binary tree structure. However, considering the rich variety of algorithms unique to graph structures, I've created a separate chapter to discuss graph structures and algorithms, which also facilitates updates to the site's content.
Graph structures allow for the abstraction of more complex problems, leading to more sophisticated graph theory algorithms. Some classic examples include the Bipartite Graph Algorithm, Topological Sorting, Shortest Path Algorithm, and Minimum Spanning Tree Algorithm. These will be introduced in later sections.
This article focuses on the basic concepts of graphs and how to implement graph structures in code.