Note that there are some explanatory texts on larger screens.

plurals
  1. POGenerating ordered sequences using small sequences in python (NP hard)
    primarykey
    data
    text
    <p>I have a problem. I think it is an NP hard problem but I am not sure of it. First, let me describe the space;</p> <p>Assume that I have the events <code>a,b,c,d,e,f</code> then, consider all possibilities of 3-length ordered sequences generated from these events. Like,</p> <pre><code>list1: ['a','b','c'] list2: ['a','b','d'] list3: ['a','b','e'] .... .... list120: .... </code></pre> <p>Order is important for the sequences so there will be total 120 3-length sequences (permutation of 6 events). Moreover, all of these 3-length sequences will be its own value between 0 and 1.</p> <p>Now consider a 6-length sequence.</p> <pre><code>seq = ['a','b','c','d','e','f'] </code></pre> <p>Value of <code>seq</code> can be determined as summing up all 3-length sequences in <code>seq</code>.</p> <p>All 3-length sequences from <code>seq</code> can be found by taking any 3 events from <code>seq</code> without changing its order. Some examples of them;</p> <pre><code>seq1: ['a','b','c'] seq2: ['a','b','d'] seq3: ['a','b','e'] seq4: ['a','b','f'] .... .... seq20: ['d','e','f'] </code></pre> <p>The question is;</p> <p>I need to find a <em>6-length sequence</em> which has smallest (or largest) value among all possible 6-length sequences. As you can guess, this is just a simple example. I need to work on largest spaces having 20-100 events. Hence generating all 6-length sequences space is not a solution.</p> <p>I know it is real hard to find smallest (or largest), so it may be also acceptable to find a sequence whose value is close to smallest (or largest). I would appreciate it if you can suggest an algorithm or a way which I can implement on Python.</p> <p>Thanks,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload