I have 16 permutations each with 104 variables using the standard alphabet. The 104 variable permutation is selected based off of compression complexity. This is one example of the pattern I am able to generate it has a low compression ratio of 1.3 with overhead:
HHHFHHFFHHFHHFFHHFHHHFHAAAAHHHFHHFFHHFHHFFHHFHHHFHAAAAHHHFHHFFHHFHHFFHHFHHHFHAAAAHHHFHHFFHHFHHFFHHFHHHFH
This is a goal pattern I would like to generate it has a better compression ratio of 1.5
mlcllltlgvalvcgvpamdipqtkqdlelpklagtwhsmamatnnislmatlkaplrvhitsllptpednleivlhrwennscvekkvlgektenpkkfkinytvaneatlldtdydnflflclqdtttpiqsmmcqylarvlveddeimqgfirafrplprhlwylldlkqmeepcrf
This is one set of permutation code generation:
static double GetCompressionRatio(string input)
{
if (string.IsNullOrEmpty(input))
throw new ArgumentNullException();
MemoryStream ms = new MemoryStream();
GZipStream gzip2 = new GZipStream(ms, CompressionMode.Compress, true);
byte[] raw = Encoding.UTF8.GetBytes(input);
gzip2.Write(raw, 0, raw.Length);
gzip2.Close();
byte[] zipped = ms.ToArray(); // as a BLOB
int startsize = raw.Length;
double percent = Convert.ToDouble(zipped.Length) / Convert.ToDouble(startsize);
return percent;
}
var query =
from sp1 in polar
...
//22 lines
...
from vp15 in polar
where GetCompressionRatio(sp1+...+vp15)>1.5
select sp1+...+vp15;
foreach (var element in query)
{
//output
}
string[] polar = new string[6];
polar[0]="H";
polar[1]="Q";
polar[2]="N";
polar[3]="K";
polar[4]="D";
polar[5]="E";
string[] nonpolar = new string[5];
nonpolar[0]="F";
nonpolar[1]="L";
nonpolar[2]="I";
nonpolar[3]="M";
nonpolar[4]="V";
string[] all = new string[24];
all[0]="A";
all[1]="B";
all[2]="C";
all[3]="D";
all[4]="E";
all[5]="F";
all[6]="G";
all[7]="H";
all[8]="I";
all[9]="J";
all[10]="K";
all[11]="L";
all[12]="M";
all[13]="N";
all[14]="O";
all[15]="P";
all[16]="Q";
all[17]="R";
all[18]="S";
all[19]="T";
all[20]="U";
all[21]="V";
all[22]="W";
all[23]="Y";
I need it to go much faster like 1000x if possible.