260 research outputs found

    An Efficient Dynamic Programming Algorithm for the Generalized LCS Problem with Multiple Substring Exclusion Constrains

    Full text link
    In this paper, we consider a generalized longest common subsequence problem with multiple substring exclusion constrains. For the two input sequences XX and YY of lengths nn and mm, and a set of dd constrains P={P1,...,Pd}P=\{P_1,...,P_d\} of total length rr, the problem is to find a common subsequence ZZ of XX and YY excluding each of constrain string in PP as a substring and the length of ZZ is maximized. The problem was declared to be NP-hard\cite{1}, but we finally found that this is not true. A new dynamic programming solution for this problem is presented in this paper. The correctness of the new algorithm is proved. The time complexity of our algorithm is O(nmr)O(nmr).Comment: arXiv admin note: substantial text overlap with arXiv:1301.718

    A note on the largest number of red nodes in red-black trees

    Full text link
    In this paper, we are interested in the number of red nodes in red-black trees. We first present an O(n2logn)O(n^2\log n) time dynamic programming solution for computing r(n)r(n), the largest number of red internal nodes in a red-black tree on nn keys. Then the algorithm is improved to some O(logn)O(\log n) time recursive and nonrecursive algorithms. Based on these improved algorithms we finally find a closed-form solution of r(n)r(n)

    Complete Solutions for a Combinatorial Puzzle in Linear Time

    Full text link
    In this paper we study a single player game consisting of nn black checkers and mm white checkers, called shifting the checkers. We have proved that the minimum number of steps needed to play the game for general nn and mm is nm+n+mnm + n + m. We have also presented an optimal algorithm to generate an optimal move sequence of the game consisting of nn black checkers and mm white checkers, and finally, we present an explicit solution for the general game

    Potentialities of Hubble parameter and expansion rate function data to alleviate Hubble tension

    Full text link
    Taking advantage of Gaussian process (GP), we obtain an improved estimate of the Hubble constant, H0=70.41±1.58H_0=70.41\pm1.58 km s1^{-1} Mpc1^{-1}, using Hubble parameter [H(z)H(z)] from cosmic chronometers (CCH) and expansion rate function [E(z)E(z)], extracted from type Ia supernovae, data. This result is higher than those obtained by directly reconstructing CCH data with GP. In order to estimate the potential of future CCH data, we simulate two sets of H(z)H(z) data and use them to constrain H0H_0 by either using GP reconstruction or fitting them with E(z)E(z) data. We find that simulated H(z)H(z) data alleviate H0H_0 tension by pushing H0H_0 values higher towards 70\sim70 km s1^{-1} Mpc1^{-1}. We also find that joint H(z)H(z) + E(z)E(z) data favor higher values of H0H_0, which is also confirmed by constraining H0H_0 in the flat concordance model and 2-order Taylor expansion of H(z)H(z). In summary, we conclude that more and better-quality CCH data as well as E(z)E(z) data can provide a new and useful perspective on resolving H0H_0 tension.Comment: 11 pages, 8 figure

    Multiagent Collaborative Governance for Targeted Poverty Alleviation from the Perspective of Stakeholders

    Get PDF
    open access articleAs a social problem involving a wide range of objects, targeted poverty alleviation governance needs to clearly define stakeholders and identify their behaviour choices, so as to seek a multiagent collaborative governance strategy, and strive to jointly promote the realization of a targeted poverty alleviation goals in an atmosphere to win-win cooperation and benefit sharing. By constructing a three-subject evolutionary game model of local government, social organization, and poverty group in the process of targeted poverty alleviation, this paper discusses the influence of their behavioural decisions on multisubject collaborative governance of targeted poverty alleviation and selects samples to carry out simulation experiments on the model. The results show that, first, superior government support has little effect on the evolution of tripartite competition, and the conclusion is inconsistent with the general cognition. However, the enhancement of support from local governments and social organizations can effectively promote the transformation of the willingness of the poor groups to cooperate. Second, a modest increase in the punishment of social organizations and poor groups can have a binding effect on the behavioural strategy choices of both sides and ultimately promote the process of targeted poverty alleviation. Third, the increase in the benefits of social organizations and poor groups can significantly improve the willingness of both sides to cooperate, so the “endogenous driving force” of the poor groups should be enhanced to achieve the Pareto optimal state of targeted poverty alleviation
    corecore