Int. J. Advanced Networking and Applications Volume: 15 Issue: 01 Pages: 5781 - 5785 (2023) ISSN: 0975-0290 5781 Finding All Graphic Sequences and Generating Random Graphs Brijendra Kumar Joshi Indore Institute of Science and Technology, Indore - 453331 Email: brijendrajoshi@yahoo.com ----------------------------------------------------------------------ABSTRACT-------------------------------------------------------------- Graphs are basic requirement of research in many fields like electrical circuits, computer networks, Genome sequencing, traffic flow, compiler design and cryptography to name a few. There are three fundamental issues one has to address in respect of an undirected graph. First, given a number of nodes, how many unique degree sequences can be there to handle? Second, out of these unique degree sequences, how many are graphic? And third, how to generate random graphs for a degree sequence? This paper presents working solutions for all these issues. An efficient algorithm to find all unique degree sequences for a given number of nodes is presented. An algorithm based on Havel-Kasami algorithm is presented which is more efficient than Erdos-Gallai algorithm to test the connectivity. Finally, an algorithm to generate random graphs is also presented. Keywords – Adjacency list, connected graph, degree sequence, Erdos-Gallai, Havel-Kasami. ----------------------------------------------------------------------------------------------------------------------------------------------------- Date of Submission: April 30, 2023 Date of Acceptance: June 03, 2023 ----------------------------------------------------------------------------------------------------------------------------------------------------- I. INTRODUCTION The first proven application of graphs dates back to as early as 1736. It was Euler who used graphs to solve the classical Kownigsberg bridge problem. Since then, the applications of graphs have exploded exponentially in number. It would not be an exaggeration to say that among all mathematical structures, graphs are most cited and used. Deo [1] and Harary [2] have given excellent treatment to the subject of graphs. One can refer to Choudham [3] for a very basic treatment. Formally, a graph G can be defined as an ordered pair (V, E) i.e., G = (V, E) where V is a finite set of vertices or nodes or points and E is a set of edges or arcs. More formally, V = {v0, v1, …., vn-1}, 1 ≤ |V | < and E = {(vi, vj): vi, vj V and i j }, 0 ≤ |E | < Here, |V| and |E| mean the number of elements in respective sets. If i = j then the edge is called a self-loop. Such graphs and the graphs in which a pair of vertices has more than one edge between them are beyond the scope of this paper. A graph is said to be a directed graph if its edges (vi, vj) are ordered pairs i.e. (vi, vj) is not same as (vj, vi). The first vertex is known as the tail of the edge and the second vertex is known as the head of the edge. There is an arrow mark on the edge (vi, vj) indicating the direction of the edge. In case of un-directed graphs, the pair (vi, vj) is un-ordered i.e., it is same as (vj, vi) and there is no arrow mark on the edge. This paper considers only undirected graphs. Degree of a vertex is the total number of edges incident on it. For undirected graphs, degree of a vertex is the number of distinct edges that either emanate from or terminate on the vertex. A path is a sequence of distinct edges between two distinct vertices vi and vj in which neither any edge nor any vertex is repeated. By definition, every edge is also a path between participating vertices. A graph is said to be connected graph if there is at least one path from every vertex to every other vertex. In other words, it is a graph in which we can reach from any vertex to any other vertex. We can also use the term spanning graph for the purpose. This paper deals with only connected graphs. When we write the degrees of all vertices of a graph in the form of a sequence of non-negative integers, that sequence is referred to as the degree sequence. Obtaining the degree sequence of a graph is straightforward but the reverse is not as simple. The problem could be that the given sequence of integers may not result into a connected graph or may not be realizable into a graph at all. For example, the degree sequence 1, 2, 3 would definitely be impossible to realize into an undirected and connected graph without any self-edges. The sequence of non-negative integers that represents the degree sequence of an undirected and connected graph is known as the graphic sequence. To know whether a degree sequence is unique or not, and if it is, to know whether it graphic or not, and if it is, to find at least one random graph of such a degree sequence is the problem of great interest. Such a large collection of random graphs would be very useful in testing graph isomorphism algorithms. For example, suppose there are three degree sequences, (1, 2, 2), (2, 2, 1) and (2, 1, 2). It is obvious that all the three are identical sequences (written differently), and hence if any one of them is graphic, so would be other two. So, basically there are three problems in one i.e.