A Constant Amortized Time Algorithm for Generating Left-Child Sequences in Lexicographic Order

Author(s):  
Kung-Jui Pai ◽  
Jou-Ming Chang ◽  
Ro-Yu Wu
2012 ◽  
Vol 23 (02) ◽  
pp. 375-387
Author(s):  
SEBASTIAN SMYCZYŃSKI

The shapes of binary trees can be encoded as permutations having a very special property. These permutations are tree permutations, or equivalently they avoid subwords of the type 231. The generation of binary trees in natural order corresponds to the generation of these special permutations in the lexicographic order. In this paper we use a stringologic approach to the generation of these special permutations: decompositions of essential parts into the subwords having staircase shapes. A given permutation differs from the next one with respect to its tail called here the working suffix. Some new properties of such working suffixes are discovered in the paper and used to design effective algorithms transforming one tree permutation into its successor or predecessor in the lexicographic order. The algorithms use a constant amount of additional memory and they look only at those elements of the permutation which belong to the working suffix. The best-case, average-case and worst-case time complexities of the algorithms are O(1), O(1), and O(n) respectively. The advantages of our stringologic approach are constant time and iterative generation, while other known algorithms are usually recursive or not constant-memory ones. In this paper we also present a new compact non-recursive linear time algorithm solving a related problem of decoding the shape of a binary tree from its corresponding tree permutation.


2019 ◽  
Vol 268 ◽  
pp. 223-236 ◽  
Author(s):  
Kung-Jui Pai ◽  
Jou-Ming Chang ◽  
Ro-Yu Wu ◽  
Shun-Chieh Chang

10.29007/v68w ◽  
2018 ◽  
Author(s):  
Ying Zhu ◽  
Mirek Truszczynski

We study the problem of learning the importance of preferences in preference profiles in two important cases: when individual preferences are aggregated by the ranked Pareto rule, and when they are aggregated by positional scoring rules. For the ranked Pareto rule, we provide a polynomial-time algorithm that finds a ranking of preferences such that the ranked profile correctly decides all the examples, whenever such a ranking exists. We also show that the problem to learn a ranking maximizing the number of correctly decided examples (also under the ranked Pareto rule) is NP-hard. We obtain similar results for the case of weighted profiles when positional scoring rules are used for aggregation.


2018 ◽  
Vol 1 (3) ◽  
pp. 2
Author(s):  
José Stênio De Negreiros Júnior ◽  
Daniel Do Nascimento e Sá Cavalcante ◽  
Jermana Lopes de Moraes ◽  
Lucas Rodrigues Marcelino ◽  
Francisco Tadeu De Carvalho Belchior Magalhães ◽  
...  

Simulating the propagation of optical pulses in a single mode optical fiber is of fundamental importance for studying the several effects that may occur within such medium when it is under some linear and nonlinear effects. In this work, we simulate it by implementing the nonlinear Schrödinger equation using the Split-Step Fourier method in some of its approaches. Then, we compare their running time, algorithm complexity and accuracy regarding energy conservation of the optical pulse. We note that the method is simple to implement and presents good results of energy conservation, besides low temporal cost. We observe a greater precision for the symmetrized approach, although its running time can be up to 126% higher than the other approaches, depending on the parameters set. We conclude that the time window must be adjusted for each length of propagation in the fiber, so that the error regarding energy conservation during propagation can be reduced.


Algorithmica ◽  
2021 ◽  
Author(s):  
Édouard Bonnet ◽  
Nidhi Purohit

AbstractA resolving set S of a graph G is a subset of its vertices such that no two vertices of G have the same distance vector to S. The Metric Dimension problem asks for a resolving set of minimum size, and in its decision form, a resolving set of size at most some specified integer. This problem is NP-complete, and remains so in very restricted classes of graphs. It is also W[2]-complete with respect to the size of the solution. Metric Dimension has proven elusive on graphs of bounded treewidth. On the algorithmic side, a polynomial time algorithm is known for trees, and even for outerplanar graphs, but the general case of treewidth at most two is open. On the complexity side, no parameterized hardness is known. This has led several papers on the topic to ask for the parameterized complexity of Metric Dimension with respect to treewidth. We provide a first answer to the question. We show that Metric Dimension parameterized by the treewidth of the input graph is W[1]-hard. More refinedly we prove that, unless the Exponential Time Hypothesis fails, there is no algorithm solving Metric Dimension in time $$f(\text {pw})n^{o(\text {pw})}$$ f ( pw ) n o ( pw ) on n-vertex graphs of constant degree, with $$\text {pw}$$ pw the pathwidth of the input graph, and f any computable function. This is in stark contrast with an FPT algorithm of Belmonte et al. (SIAM J Discrete Math 31(2):1217–1243, 2017) with respect to the combined parameter $$\text {tl}+\Delta$$ tl + Δ , where $$\text {tl}$$ tl is the tree-length and $$\Delta$$ Δ the maximum-degree of the input graph.


2021 ◽  
Vol 11 (1) ◽  
Author(s):  
Tomotaka Kuwahara ◽  
Álvaro M. Alhambra ◽  
Anurag Anshu
Keyword(s):  

Sign in / Sign up

Export Citation Format

Share Document