A simple Havel-Hakimi type algorithm to realize graphical degree sequences of directed graphs (original) (raw)
Related papers
Constructing and sampling directed graphs with given degree sequences
New Journal of Physics - NEW J PHYS, 2012
The interactions between the components of complex networks are often directed. Proper modeling of such systems frequently requires the construction of ensembles of digraphs with a given sequence of in- and out-degrees. As the number of simple labeled graphs with a given degree sequence is typically very large even for short sequences, sampling methods are needed for statistical studies. Currently, there are two main classes of methods that generate samples. One of the existing methods first generates a restricted class of graphs and then uses a Markov chain Monte-Carlo algorithm based on edge swaps to generate other realizations. As the mixing time of this process is still unknown, the independence of the samples is not well controlled. The other class of methods is based on the configuration model that may lead to unacceptably many sample rejections due to self-loops and multiple edges. Here we present an algorithm that can directly construct all possible realizations of a given b...
Constructing bounded degree graphs with prescribed degree and neighbor degree sequences
Discrete Applied Mathematics
Let D = d 1 , d 2 ,. .. , d n and F = f 1 , f 2 ,. .. , f n be two sequences of positive integers. We consider the following decision problems: is there a i) multigraph, ii) loopless multigraph, iii) simple graph, iv) connected simple graph, v) tree, vi) caterpillar G = (V, E) such that for all k, d(v k) = d k and w∈N (v k) d(w) = f k (d(v) is the degree of v and N (v) is the set of neighbors of v). Here we show that all these decision problems can be solved in polynomial time if max k d k is bounded. The problem is motivated by NMR spectroscopy of hydrocarbons.
On the Swap-Distances of Different Realizations of a Graphical Degree Sequence
Combinatorics, Probability and Computing, 2013
One of the first graph-theoretical problems to be given serious attention (in the 1950s) was the decision whether a given integer sequence is equal to the degree sequence of a simple graph (orgraphical, for short). One method to solve this problem is the greedy algorithm of Havel and Hakimi, which is based on theswapoperation. Another, closely related question is to find a sequence of swap operations to transform one graphical realization into another of the same degree sequence. This latter problem has received particular attention in the context of rapidly mixing Markov chain approaches to uniform sampling of all possible realizations of a given degree sequence. (This becomes a matter of interest in the context of the study of large social networks, for example.) Previously there were only crude upper bounds on the shortest possible length of such swap sequences between two realizations. In this paper we develop formulae (Gallai-type identities) for theswap-distances of any two re...
A Sequential Algorithm for Generating Random Graphs
Algorithmica, 2009
We present a nearly-linear time algorithm for counting and randomly generating simple graphs with a given degree sequence in a certain range. For degree sequence (d i) n i=1 with maximum degree d max = O(m 1/4−τ), our algorithm generates almost uniform random graphs with that degree sequence in time O(md max) where m = 1 2 i d i is the number of edges in the graph and τ is any positive constant. The fastest known algorithm for uniform generation of these graphs (McKay and Wormald in J. Algorithms 11(1):52-67, 1990) has a running time of O(m 2 d 2 max). Our method also gives an independent proof of McKay's estimate (McKay in Ars Combinatoria A 19:15-25, 1985) for the number of such graphs. We also use sequential importance sampling to derive fully Polynomial-time Randomized Approximation Schemes (FPRAS) for counting and uniformly generating random graphs for the same range of d max = O(m 1/4−τ). Moreover, we show that for d = O(n 1/2−τ), our algorithm can generate an asymptotically uniform d-regular graph. Our results improve the previous bound of d = O(n 1/3−τ) due to Kim and Vu (Adv. Math. 188:444-469, 2004) for regular graphs.
Uniform sampling of undirected and directed graphs with a fixed degree sequence
Computing Research Repository, 2009
Many applications in network analysis require algorithms to sample uniformly at random from the set of all graphs with a prescribed degree sequence. We present a Markov chain based approach which converges to the uniform distribution of all realizations for both the directed and undirected case. It remains an open challenge whether these Markov chains are rapidly mixing. For the
Fast Sequential Creation of Random Realizations of Degree Sequences
Internet Mathematics, 2016
We examine the problem of creating random realizations of very large degree sequences. Although fast in practice, the Markov chain Monte Carlo (MCMC) method for selecting a realization has limited usefulness for creating large graphs because of memory constraints. Instead, we focus on sequential importance sampling (SIS) schemes for random graph creation. A difficulty with SIS schemes is assuring that they terminate in a reasonable amount of time. We introduce a new sampling method by which we guarantee termination while achieving speed comparable to the MCMC method.
Degree-based graph construction
Journal of Physics A: Mathematical and Theoretical, 2009
Degree-based graph construction is an ubiquitous problem in network modeling , ranging from social sciences to chemical compounds and biochemical reaction networks in the cell. This problem includes existence, enumeration, exhaustive construction and sampling questions with aspects that are still open today. Here we give necessary and sufficient conditions for a sequence of nonnegative integers to be realized as a simple graph's degree sequence, such that a given (but otherwise arbitrary) set of connections from a arbitrarily given node are avoided. We then use this result to present a swap-free algorithm that builds all simple graphs realizing a given degree sequence. In a wider context, we show that our result provides a greedy construction method to build all the f -factor subgraphs (Tutte, [3]) embedded within K n \S k , where K n is the complete graph and S k is a star graph centered on one of the nodes.
Finding All Graphic Sequences and Generating Random Graphs
Eswar Publications, 2023
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.
Directed random graphs with given degree distributions
Stochastic Systems, 2013
Given two distributions F and G on the nonnegative integers we propose an algorithm to construct in-and out-degree sequences from samples of i.i.d. observations from F and G, respectively, that with high probability will be graphical, that is, from which a simple directed graph can be drawn. We then analyze a directed version of the configuration model and show that, provided that F and G have finite variance, the probability of obtaining a simple graph is bounded away from zero as the number of nodes grows. We show that conditional on the resulting graph being simple, the in-and out-degree distributions are (approximately) F and G for large size graphs. Moreover, when the degree distributions have only finite mean we show that the elimination of self-loops and multiple edges does not significantly change the degree distributions in the resulting simple graph.
An efficient algorithm to test forcibly-biconnectedness of graphical degree sequences
2018
We present an algorithm to test whether a given graphical degree sequence is forcibly biconnected or not and prove its correctness. The worst case run time complexity of the algorithm is shown to be exponential but still much better than the previous basic algorithm presented in Wang2018. We show through experimental evaluations that the algorithm is efficient on average. We also adapt Ruskey et al's classic algorithm to enumerate zero-free graphical degree sequences of length n and Barnes and Savage's classic algorithm to enumerate graphical partitions of an even integer n by incorporating our testing algorithm into theirs and then obtain some enumerative results about forcibly biconnected graphical degree sequences of given length n and forcibly biconnected graphical partitions of given even integer n. Based on these enumerative results we make some conjectures such as: when n is large, (1) the proportion of forcibly biconnected graphical degree sequences of length n among...