14 research outputs found

    Finding a negative cycle in a directed graph

    No full text
    We present an algorithm implemented on a pointer machine which can find a negative Cycle in a directed graph in worst case Time O(n.e), where n is the number of nodes and e the number of edges, using only linear Space O(n+e). The best previous result was due to D.Maier [5]. His algorithm is running on a random access machine in worst case Time O(n(e+nlog n/log nlog n)) and uses Space O(e+nlog n/log nlog n)

    String regularities with don't cares

    Get PDF
    We describe algorithms for computing typical regularities in strings x = x[1..n] that contain don't care symbols. For such strings on alphabet Σ, an O(n log n log |Σ|) worst-case time algorithm for computing the period is known, but the algorithm is impractical due to a large constant of proportionality. We present instead two simple practical algorithms that compute all the periods of every prefix of x; our algorithms require quadratic worst-case time but only linear time in the average case. We then show how our algorithms can be used to compute other string regularities, specifically the covers of both ordinary and circular strings
    corecore