Sampling Arborescences in Parallel

Total Page:16

File Type:pdf, Size:1020Kb

Sampling Arborescences in Parallel Sampling Arborescences in Parallel Nima Anari1, Nathan Hu1, Amin Saberi1, and Aaron Schild2 1Stanford University, {anari,zixia314,saberi}@stanford.edu 2University of Washington, [email protected] December 18, 2020 Abstract We study the problem of sampling a uniformly random directed rooted spanning tree, also known as an arborescence, from a possibly weighted directed graph. Classically, this problem has long been known to be polynomial-time solvable; the exact number of arborescences can be computed by a determinant [Tut48], and sampling can be reduced to counting [JVV86; JS96]. However, the classic reduction from sampling to counting seems to be inherently sequential. This raises the question of designing efficient parallel algorithms for sampling. We show that sampling arborescences can be done in RNC. For several well-studied combinatorial structures, counting can be reduced to the computation of a determinant, which is known to be in NC [Csa75]. These include arborescences, planar graph perfect matchings, Eulerian tours in digraphs, and determinantal point processes. However, not much is known about efficient parallel sampling of these structures. Our work is a step towards resolving this mystery. 1 Introduction Algorithms for (approximately) counting various combinatorial structures are often based on the equiva- lence between (approximate) counting and sampling [JVV86; JS96]. This is indeed the basis of the Markov Chain Monte Carlo (MCMC) method to approximate counting, which is arguably the most successful ap- proach to counting, resolving long-standing problems such as approximating the permanent [JSV04] and computing the volume of convex sets [DFK91]. Approximate sampling and counting are known to be equivalent for a wide class of problems, including the so-called self-reducible ones [JVV86; JS96]. This equivalence is nontrivial and most useful in the direction of reducing counting to sampling. However, for some problems, the “easier” direction of this equivalence, namely the reduction from sampling to counting, proves useful. For these problems, almost arXiv:2012.09502v1 [cs.DS] 17 Dec 2020 by definition, we can count via approaches other than MCMC. One of the mysterious approaches to counting is via determinant computations. A range of counting problems can be (exactly) solved by simply computing a determinant. A non-exhaustive list is provided below. • Spanning trees in a graph can be counted by computing a determinant related to the Laplacian of the graph, a result known as the matrix-tree theorem [Kir47]. • Arborescences in a directed graph can be counted by computing a determinant related to the directed Laplacian [Tut48]. • The number of perfect matchings in a planar graph can be computed as the Pfaffian (square root of the determinant) of an appropriately signed version of the adjacency matrix, a.k.a. the Tutte matrix [Kas63]. • The number of Eulerian tours in an Eulerian digraph is directly connected to the number of arbores- cences, and consequently the determinant related to the directed Laplacian [AB87; TS41]. 1 Rd [n] • Given vectors v1,..., vn ∈ , the volume sampling distribution on subsets S ∈ ( d ) can be defined as follows: P 2 [S] ∝ det ([vi]i∈S) . ⊺ The partition function of this distribution is simply det(∑i vivi ) [see, e.g., DR10]. • The number of non-intersecting paths between specified terminals in a lattice, and more generally applications of the Lindström-Gessel-Viennot lemma [Lin73; GV89]. Efficient counting for these problems follows the polynomial-time computability of the associated deter- minants. In turn, one obtains efficient sampling algorithms for all of these problems; we remark that ot all of these problems are known to be self-reducible, but nevertheless “easy” slightly varied sampling to counting reductions exist for all of them. While polynomial-time sampling for all of these problems has long been settled, we reopen the investiga- tion of these problems by considering efficient parallel sampling algorithms. We focus on the computational model of PRAM, and specifically on the complexity classes NC and RNC. Here, a polynomially bounded number of processors are allowed access to a shared memory, and the goal is for the running time to be polylogarithmically bounded; the class RNC has additionally access to random bits. Determinants can be computed efficiently in parallel, in the class NC [Csa75], and as a result there are NC counting algorithms for all of aforementioned problems. However, the sampling to counting reductions completely break down for parallel algorithms, as there seems to be an inherent sequentiality in these reductions. Take spanning trees in a graph as an example. The classic reduction from sampling to counting proceeds as follows: for each edge e do A ← number of spanning trees containing e B ← total number spanning trees Flipping a coin with bias A/B, decide whether e should be part of the tree. Either contract or delete the edge e based on this decision. Each iteration of this loop uses a counting oracle to compute A, B. However the decision of whether to include an edge e as part of the tree affects future values of A, B for other edges, and this seems to be the inherent sequentiality in this algorithm. The sampling-to-counting reduction for all other listed problems encounters the same sequentiality obstacle. In this paper, we take a step towards resolving the mysterious disparity between counting and sampling in the parallel algorithms world. We resolve the question of sampling arborescences in weighted directed graphs, and as a special case spanning trees in weighted undirected graphs, using efficient parallel algo- rithms with access to randomness, a.k.a. the class RNC. We remark that the special case of sampling spanning trees in unweighted undirected graphs was implic- itly solved by the work of Teng [Ten95a], who showed how to simulate random walks in RNC. When combined with earlier work of Aldous [Ald90] and Broder [Bro89], this algorithm would simulate a ran- dom walk on the graph, and from its transcript extract a random spanning tree. However, adding either weights or directions to the graph results in the need for potentially exponentially large random walks, which cannot be done in RNC. Our work removes this obstacle. Theorem 1. There is an RNC algorithm which takes a directed graph G = (V, E) together with edge weights R w : E → ≥0 as input and outputs a random directed rooted tree T, a.k.a. an arborescence. The output T follows the distribution P[T] ∝ ∏ w(e). e∈T 1.1 Related Work and Techniques There is a long line of research on algorithms for sampling and counting spanning trees and more gen- erally arborescences. The matrix-tree theorem of Kirchhoff [Kir47] showed how to count spanning trees 2 W 1 ... W 1 Figure 1: Starting from left it Figure 2: A random walk started from the left node covers all n takes Θ(W) steps to cover. nodes in time Θ(2n). in undirected graphs, and later Tutte [Tut48] generalized this to arborescences in digraphs. Somewhat surprisingly Aldous [Ald90] and Broder [Bro89] showed that random spanning trees and more generally random arborescences of a graph can be extracted from the transcript of a random walk on the graph itself. The main focus of subsequent work on this problem has been on improving the total running time of sequential algorithms for sampling. After a long line of work [Wil96; CMN96; KM09; MST15; Dur+17b; Dur+17a], Schild [Sch18] obtained the first almost-linear time algorithm for sampling spanning trees. More recently Anari, Liu, Oveis Gharan, and Vinzant [Ana+20] improved this to nearly-linear time. Many of these works are based on speeding up the Aldous-Broder algorithm. Our main result, Theorem 1, is also built on the Aldous-Broder algorithm, but we focus on parallelizing it instead of optimizing the total running time. No almost-linear time algorithm is yet known for sampling arborescences in digraphs, as opposed to spanning trees in undirected graphs. While sampling spanning trees has a multitude of application [see Sch18], there are a number of applications for the directed graph generalization. Most notably, there is a many-to-one direct correspondence between Eulerian tours in an Eulerian digraph and arborescences of the graph. This correspondence, known as the BEST theorem [AB87; TS41] allows one to generate random Eulerian tours by generating random arborescences [see Cre10]. We leave the question of whether the correspondence in the BEST theorem is implementable in NC to future work, but note that sampling Eulerian tours has interesting applications in biology and sequence processing [Jia+08; Riv+08]. We remark that, unlike directed graphs, generating random Eulerian tours of undirected Eulerian graphs in polynomial time is a major open problem [TV01]. In a slightly different direction related to this work, Balaji and Datta [BD13] considered the space com- plexity of counting arborescences. They showed this problem is in L for graphs of bounded tree-width, obtaining algorithms for counting Eulerian tours in these digraphs as well. Perhaps in the first major result of its kind in the search for RNC sampling algorithms, Teng [Ten95b] showed implicitly how to sample spanning trees in undirected graphs in RNC. Teng [Ten95b] showed how to parallelize the simulation of a random walk on a graph; more precisely, he showed how to output a length L trace of a walk on size n Markov chains in parallel running time polylog(L, n) using only poly(L, n) many processors. The Aldous-Broder algorithm extracts an arborescence from the trace of a random walk by extracting the so-called first-visit edge to each vertex. If a random walk is simulated until all vertices are visited at least once, the trace of the random walk has enough information to extract all such first-visit edges. This allows RNC sampling of arborescences in graphs where the number of steps needed to visit all vertices, known as the cover time, is polynomially bounded.
Recommended publications
  • The Number of Euler Tours of Random Directed Graphs
    The number of Euler tours of random directed graphs P´aid´ıCreed∗ Mary Cryanyz School of Mathematical Sciences School of Informatics Queen Mary, University of London University of Edinburgh United Kingdom United Kingdom [email protected] [email protected] Submitted: May 21, 2012; Accepted: Jul 26, 2013; Published: Aug 9, 2013 Mathematics Subject Classifications: 05A16, 05C30, 05C80, 68Q25 Abstract In this paper we obtain the expectation and variance of the number of Euler tours of a random Eulerian directed graph with fixed out-degree sequence. We use this to obtain the asymptotic distribution of the number of Euler tours of a random d-in/d-out graph and prove a concentration result. We are then able to show that a very simple approach for uniform sampling or approximately counting Euler tours yields algorithms running in expected polynomial time for almost every d-in/d-out graph. We make use of the BEST theorem of de Bruijn, van Aardenne-Ehrenfest, Smith and Tutte, which shows that the number of Euler tours of an Eulerian directed graph with out-degree sequence d is the product of the number of arborescences and 1 Q the term jV j [ v2V (dv − 1)!]. Therefore most of our effort is towards estimating the moments of the number of arborescences of a random graph with fixed out-degree sequence. 1 Introduction 1.1 Background Let G = (V; A) be a directed graph. An Euler tour of G is any ordering eπ(1); : : : ; eπ(jAj) of the set of arcs E such that for every 1 6 i < jAj, the target vertex of arc eπ(i) is the source vertex of eπ(i+1), and such that the target vertex of eπ(jAj) is the source of eπ(1).
    [Show full text]
  • A Reverse Aldous–Broder Algorithm
    A Reverse Aldous{Broder Algorithm Yiping Hu∗ Russell Lyons† Pengfei Tang‡ October 8, 2020 Abstract The Aldous{Broder algorithm provides a way of sampling a uniformly random spanning tree for finite connected graphs using simple random walk. Namely, start a simple random walk on a connected graph and stop at the cover time. The tree formed by all the first-entrance edges has the law of a uniform spanning tree. Here we show that the tree formed by all the last-exit edges also has the law of a uniform spanning tree. This answers a question of Tom Hayes and Cris Moore from 2010. The proof relies on a bijection that is related to the BEST theorem in graph theory. We also give other applications of our results, including new proofs of the reversibility of loop-erased random walk, of the Aldous{Broder algorithm itself, and of Wilson's algorithm. R´esum´e L'algorithme Aldous{Broder fournit un moyen d'´echantillonner un arbre couvrant uni- form´ement al´eatoirepour des graphes connexes finis en utilisant une marche al´eatoiresimple. A` savoir, commen¸consune marche al´eatoiresimple sur un graphe connexe et arr^etons-nousau moment de la couverture. L'arbre form´epar toutes les ar^etesde la premi`ereentr´eea la loi d'un arbre couvrant uniforme. Nous montrons ici que l'arbre form´epar toutes les ar^etesde derni`ere sortie a ´egalement la loi d'un arbre couvrant uniforme. Cela r´epond `aune question de Tom Hayes et Cris Moore de 2010. La preuve repose sur une bijection qui est li´eeau th´eor`emeBEST de la th´eoriedes graphes.
    [Show full text]
  • The Number of Euler Tours of a Random D-In/D-Out Graph Páidí Creed, Mary Cryan
    The number of Euler tours of a random d-in/d-out graph Páidí Creed, Mary Cryan To cite this version: Páidí Creed, Mary Cryan. The number of Euler tours of a random d-in/d-out graph. 21st International Meeting on Probabilistic, Combinatorial, and Asymptotic Methods in the Analysis of Algorithms (AofA’10), 2010, Vienna, Austria. pp.117-128. hal-01185585 HAL Id: hal-01185585 https://hal.inria.fr/hal-01185585 Submitted on 20 Aug 2015 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Distributed under a Creative Commons Attribution| 4.0 International License AofA’10 DMTCS proc. AM, 2010, 117–128 The number of Euler tours of a random d-in/d-out graph Paid´ ´ı Creed1: and Mary Cryan2; 1Department of Computer Science, Royal Holloway University of London, Egham, Surrey, UK, TW20 0EX, UK. 2School of Informatics, University of Edinburgh, 10 Crichton Street, Edinburgh EH8 9AB, UK. In this paper we obtain the expectation and variance of the number of Euler tours of a random d-in/d-out directed graph, for d ¥ 2. We use this to obtain the asymptotic distribution and prove a concentration result.
    [Show full text]
  • Graph Theory & Combinatorics
    MATH 775: GRAPH THEORY & COMBINATORICS I MATTHEW KAHLE 1. Enumeration The standard references for enumerative combinatorics are Richard Stanley's EC1 and EC2 [11, 12]. 1.1. Factorials, binomial coefficients, multinomial coefficients. The first useful fact in combinatorics is that n! = n × (n − 1) × · · · × 1 is the number of ways to order n objects. Note that when n is large, a useful approximation is Stirling's formula p n! ≈ 2πn(n=e)n: The next useful fact is the binomial theorem n X n (x + y)n = xiyn−i; i i=0 n where the binomial coefficient i is defined by n n! = (n − i)!: i i! Note that 0! = 1 by useful convention. From the binomial theorem, some useful identities can easily be deduced. For example, n X n = 2n; i i=0 or n X n (−1)i = 0: i i=0 Exercise 1.1. Deduce both of these identities without resorting to the binomial theorem. A more general version of the binomial theorem is the multinomial theorem. For three variables, for example. X n! (x + y + z)n = xaybzc; a!b!c! a+b+c=n Exercise 1.2. Write down and prove a k-variable multinomial theorem. Date: November 16, 2011. 1 2 MATTHEW KAHLE Note that multinomial coefficients naturally arise in certain types of counting problems. For example, one easily checks that the number of anagrams of the word \bananacabana" is 12! ; 6!2!1!3! where 6, 2, 1, 3 count the number of a's, b's, c's, and n's, respectively.
    [Show full text]
  • Graph Algorithms
    Graph Algorithms PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Wed, 29 Aug 2012 18:41:05 UTC Contents Articles Introduction 1 Graph theory 1 Glossary of graph theory 8 Undirected graphs 19 Directed graphs 26 Directed acyclic graphs 28 Computer representations of graphs 32 Adjacency list 35 Adjacency matrix 37 Implicit graph 40 Graph exploration and vertex ordering 44 Depth-first search 44 Breadth-first search 49 Lexicographic breadth-first search 52 Iterative deepening depth-first search 54 Topological sorting 57 Application: Dependency graphs 60 Connectivity of undirected graphs 62 Connected components 62 Edge connectivity 64 Vertex connectivity 65 Menger's theorems on edge and vertex connectivity 66 Ear decomposition 67 Algorithms for 2-edge-connected components 70 Algorithms for 2-vertex-connected components 72 Algorithms for 3-vertex-connected components 73 Karger's algorithm for general vertex connectivity 76 Connectivity of directed graphs 82 Strongly connected components 82 Tarjan's strongly connected components algorithm 83 Path-based strong component algorithm 86 Kosaraju's strongly connected components algorithm 87 Application: 2-satisfiability 88 Shortest paths 101 Shortest path problem 101 Dijkstra's algorithm for single-source shortest paths with positive edge lengths 106 Bellman–Ford algorithm for single-source shortest paths allowing negative edge lengths 112 Johnson's algorithm for all-pairs shortest paths in sparse graphs 115 Floyd–Warshall algorithm
    [Show full text]
  • A Graph Theoretical Approach to DNA Fragment Assembly
    AMERICAN JOURNAL OF UNDERGRADUATE RESEARCH VOL. 7, NO. 1 A Graph Theoretical Approach to DNA Fragment Assembly Jonathan Kaptcianos‡ Saint Michael’s College Colchester, Vermont 05439 USA Received: September 19, 2007 Accepted: April 1, 2008 ABSTRACT Built on prior work on sequencing by hybridization, fragment assembly is a newly explored method of determining whether or not a reassembled strand of DNA matches the original strand. One particular way to analyze this method is by using concepts from graph theory. By constructing data models based on these ideas, it is possible to come to various conclusions about the original problem regarding reassembled strands of DNA. In this paper we will detail this approach to DNA fragment assembly and present some related graph theoretical proofs in the process, including the BEST theorem. Further, we will explore the Eulerian superpath problem and its role in aiding fragment assembly, in addition to other recent applications of graph theory in the field of bioinformatics. I. Introduction both of which are used in counting Eulerian circuits in a directed graph. In recent years, scientists and Further, this paper will briefly survey researchers have emphasized DNA the current state of DNA sequencing and sequencing and fragment assembly with the fragment assembly, such as the problems hopes of enhancing their abilities to that arise, and how they are addressed reconstruct full strands of DNA based on the using graph theory. We will see how graphs pieces of data they are able to record. are being constructed using DNA data, and Complications arise with fragment assembly how these graphs inform the problem.
    [Show full text]
  • Notices of the American Mathematical Society ABCD Springer.Com
    ISSN 0002-9920 Notices of the American Mathematical Society ABCD springer.com Highlights in Springer’s eBook Collection of the American Mathematical Society June/July 2009 Volume 56, Number 6 NEW NEW Using representation theory and This self-contained text off ers a host of Editor-in-Chief: Steven G. Krantz invariant theory to analyze the new mathematical tools and strategies The Journal of Geometric Analysis is a symmetries arising from group actions, which develop a connection between high-quality journal devoted to and with emphasis on the geometry analysis and other mathematical publishing important new results at the and basic theory of Lie groups and Lie disciplines, such as physics and interface of analysis, geometry and algebras, this book reworks an earlier engineering. A broad view of math- partial diff erential equations. Founded highly acclaimed work by the author. ematics is presented throughout; the 17 years ago by its current Editor-in- This comprehensive introduction to Lie text is excellent for the classroom or Chief the journal has maintained theory, representation theory, invariant self-study. standards of innovation and excellence. theory and algebraic groups is more 2009. XX, 452 p. 10 illus. Softcover accessible to students and includes a ISSN 1050-6926 (print ) ISBN 978-0-387-77378-0 7 $79.95 broader ranger of applications. ISSN 1559-002X (online) 2009. XX, 716 p. 10 illus. (Graduate Texts in Mathematics, Volume 255) Hardcover ISBN 978-0-387-79851-6 7 $69.95 For access check with your librarian Fractional Diff erentiation Risk and Asset Allocation Groups and Symmetries Inequalities A.
    [Show full text]
  • The Number of Euler Tours of a Random D-In/D-Out Graph
    Discrete Mathematics and Theoretical Computer Science DMTCS vol. (subm.), by the authors, 1–1 The number of Euler tours of a random d-in/d-out graph Paid´ ´ı Creed1 and Mary Cryan2 1Department of Computer Science, Royal Holloway University of London, Egham, Surrey, UK, TW20 0EX, UK. [email protected]. Supported by EPSRC grants EP/F01161X/1 and EP/D043905/1. 2School of Informatics, University of Edinburgh, 10 Crichton Street, Edinburgh EH8 9AB, UK. Supported by EPSRC grant EP/D043905/1 In this paper we obtain the expectation and variance of the number of Euler tours of a random d-in/d-out directed graph, for d ¥ 2. We use this to obtain the asymptotic distribution and prove a concentration result. We are then able to show that a very simple approach for uniform sampling or approximately counting Euler tours yields algorithms running in expected polynomial time for almost every d-in/d-out graph. We make use of the BEST theorem of de Bruijn, van Aardenne-Ehrenfest, Smith and Tutte, which shows that the number of Euler tours of a d-in/d-out graph is the product of the number of arborescences and the term rpd ¡ 1q!sn{n. Therefore most of our effort is towards estimating the asymptotic distribution of the number of arborescences of a random d-in/d-out graph. Keywords: Euler tours, Random graphs, Directed graphs, Counting, Sampling 1 Introduction Let G pV, Eq be a directed graph. An Euler tour of G is any ordering eπp1q, . , eπp|E|q of the set of arcs E such that for every 1 ¤ i |E|, the target vertex of arc eπpiq is the source vertex of eπpi 1q, and such that the target vertex of eπp|E|q is the source of eπp1q.
    [Show full text]
  • Algebraic and Geometric Methods in Enumerative Combinatorics
    Algebraic and geometric methods in enumerative combinatorics Federico Ardila∗ 0 Introduction Enumerative combinatorics is about counting. The typical question is to find the number of objects with a given set of properties. However, enumerative combinatorics is not just about counting. In \real life", when we talk about counting, we imagine lining up a set of objects and counting them off: 1; 2; 3;:::. However, families of combinatorial objects do not come to us in a natural linear order. To give a very simple example: we do not count the squares in an m × n rectangular grid linearly. Instead, we use the rectangular structure to understand that the number of squares is m · n. Similarly, to count a more complicated combinatorial set, we usually spend most of our efforts understanding the underlying structure of the individual objects, or of the set itself. Many combinatorial objects of interest have a rich and interesting algebraic or geometric structure, which often becomes a very powerful tool towards their enumeration. In fact, there are many families of objects that we only know how to count using these tools. This chapter highlights some key aspects of the rich interplay between algebra, discrete geometry, and combinatorics, with an eye towards enumeration. About this survey. Over the last fifty years, combinatorics has undergone a radical transformation. Not too long ago, combinatorics mostly consisted of ad hoc methods and clever solutions to problems that were fairly isolated from the rest of mathematics. It has since grown to be a central area of mathematics, largely thanks to the discovery of deep connections to other fields.
    [Show full text]
  • Arxiv:1907.10196V2 [Math.PR] 26 Mar 2021 Let Introduction 1 Reuigsml Admwl on Walk Random Simple Using Tree T Nvriyo Ahntn Email: Washington
    A Reverse Aldous–Broder Algorithm Yiping Hu∗ Russell Lyons† Pengfei Tang‡ March 29, 2021 Abstract The Aldous–Broder algorithm provides a way of sampling a uniformly random spanning tree for finite connected graphs using simple random walk. Namely, start a simple random walk on a connected graph and stop at the cover time. The tree formed by all the first-entrance edges has the law of a uniform spanning tree. Here we show that the tree formed by all the last-exit edges also has the law of a uniform spanning tree. This answers a question of Tom Hayes and Cris Moore from 2010. The proof relies on a bijection that is related to the BEST theorem in graph theory. We also give other applications of our results, including new proofs of the reversibility of loop-erased random walk, of the Aldous–Broder algorithm itself, and of Wilson’s algorithm. R´esum´e L’algorithme Aldous–Broder fournit un moyen d’´echantillonner un arbre couvrant uniform´ement al´eatoire pour des graphes connexes finis en utilisant une marche al´eatoire simple. A` savoir, com- men¸cons une marche al´eatoire simple sur un graphe connexe et arrˆetons-nous au moment de la couverture. L’arbre form´epar toutes les arˆetes de la premi`ere entr´ee a la loi d’un arbre couvrant uniforme. Nous montrons ici que l’arbre form´epar toutes les arˆetes de derni`ere sortie a ´egalement la loi d’un arbre couvrant uniforme. Cela r´epond `aune question de Tom Hayes et Cris Moore de 2010.
    [Show full text]
  • An Efficient Algorithm for Enumerating Eulerian Paths
    TCS -TR-A-14-77 TCS Technical Report An Efficient Algorithm for Enumerating Eulerian Paths by Muhammad Kholilurrohman and Shin-ichi Minato Division of Computer Science Report Series A October 3, 2014 Hokkaido University Graduate School of Information Science and Technology Email: [email protected] Phone: +81-011-706-7682 Fax: +81-011-706-7682 An Efficient Algorithm for Enumerating Eulerian Paths Muhammad Kholilurrohman1 and Shin-ichi Minato1;2 1 Graduate School of Information Science and Technology, Hokkaido University, Sapporo, Japan 2 ERATO MINATO Discrete Structure Manipulation System Project, Japan Science and Technology Agency, Sapporo, Japan Abstract. Although a mathematical formula for counting the number of Eulerian circles in a directed graph is already known [1, 2], no formula is yet known for enumerating such circles if the graph is an undirected one. In computer science, the latter problem is known to be in #P-complete [3], enumerating the solutions of such problem is known to be hard. In this paper, an efficient algorithm to enumerate all the Eulerian paths in an undirected graph, both simple graph and multigraph, is proposed. Keywords: enumeration, Eulerian circle, Eulerian path, graph theory, undirected graph 1 Introduction In graph theory, Eulerian path (or Eulerian trail) is a path in a graph which visits every edge exactly once. If the path starts and ends on the same vertex, then it is called an Eulerian circle. Eulerian path problem dates back to 1736, when for the first time Leonhard Euler discuss in his paper [4] the famous Seven Bridges of K¨onigsberg problem. He proved the necessary condition for the existence of Eulerian circle that all the vertices of the connected graph must have an even degree, while the necessity condition was proved later by Carl Hierholzer [5] in 1873.
    [Show full text]
  • Hints and Comments for Some Exercises
    Hints and Comments for Some Exercises Chapter 1 1.5 Consider A(Hn)2 and use Exercise 1.3. V ,V ,...,V 1.6 (a) First count the number of sequences i0 i1 i for which there exists a closed walk with vertices v0,v1,...,v = v0 (in that order) such that vj ∈ Vij . 1.11 Consider the rank of A(), and also consider A()2. The answer is very simple and does not involve irrational numbers. 1.12 (b) Consider A(G)2. Chapter 2 2.2 Give an argument analogous to the proof of Theorem 8.8.9. 2.3 This result is known as the “middle levels conjecture” and was proved by Torsten Mütze in 2016. 2.5 (c) Mimic the proof for the graph Cn, using the definition χu,χv= χu(w)χv(w), w∈Zn where an overhead bar denotes complex conjugation. Chapter 3 3.4 You may find Example 3.1 useful. 3.8 It is easier not to use linear algebra. 3.9 See previous hint. © Springer International Publishing AG, part of Springer Nature 2018 245 R. P. Stanley, Algebraic Combinatorics, Undergraduate Texts in Mathematics, https://doi.org/10.1007/978-3-319-77173-1 246 Hints and Comments for Some Exercises 3.11 First show (easy) that if we start at a vertex v and take n steps (using our random walk model), then the probability that we traverse a fixed closed walk W is equal to the probability that we traverse W in reverse order. 3.13 See hint for Exercise 3.8.
    [Show full text]