In the context of the project, I need to find k-long sequences in PHP. There are many ways to implement this, but which algorithm is the fastest for PHP?
What algorithm would you follow? (Overview)
Which one is the most efficient and dynamic (numbers, lines, etc.)? (quick ?, time for n-elems?)
How would you implement it? (Example)
Thank!
Post scriptum
I am going to implement the ONISI k-near future algorithm. The longest sequences are visualized in this pattern.
This shematic gives an overview of the ONISI algorithm.
The total / instant-history elements are strings representing the $ state → $ action template. This means that, given the first 3 elements of the scheme (1), data will be displayed, for example:$immediate_history = array( array( "s2" => "a2" ), array( "s3" => "a3" ), array( "s1" => "a1" ) [..] );
?
!