Abstract:In this paper, the author introduces several kinds of important graphs and its generating algorithms in detail, including random graph, K-adjacent graph and Euclidean adjacent graph. For every kind of graph, the author uses C language to describe its formation and algorithms, and analyzes the functions of each algorithm in brief.Meanwhile, the author gets a specific graph after using a set of data to demonstrate every algorithm.