Bubblegum, 165 164 163 162 161 160 bytes
00000000: 1dc6 410a 0231 0c00 c0bf b50a c22a 880a ..A..1.......*..
00000010: e231 b4c1 0697 6449 5aa5 bede c4cb 303b .1....dIZ.....0;
00000020: 2046 5bc2 5b1b 0ead 2b59 5a07 f72c 5eb6 F[.[...+YZ..,^.
00000030: bdb2 f9c5 c75f 4ac8 8c7d 09eb cc60 1818 ....._J..}...`..
00000040: c5b5 12bb 1bea a964 886f d425 2b6c cef8 .......d.o.%+l..
00000050: 5e4b 83ee 4aef 49e5 c3d9 23ae f20c 5fa8 ^K..J.I...#..._.
00000060: f759 9193 4894 4a08 ca7f 15f9 e092 1d04 .Y..H.J.........
00000070: df71 3370 7b69 572f 5ec8 625c 51ed 8c3d .q3p{iW/^.b\Q..=
00000080: 84b1 ded0 bc59 4a53 e093 0443 1566 727d .....YJS...C.fr}
00000090: 5b9b 4784 0017 e2e7 05b1 3e64 789c 6a3f [.G.......>dx.j?
Try it online!
Output
DainesKaineThuneTillisBluntCollinsErnstCoonsEnziBennetKennedyCaseyCassidyCardinCarperMcCainCapitoCrapoCruzSchatzScottBrownCottonCornynCorkerWydenBookerWickerWarnerWarrenHarrisHoevenHassanHatchSasseRischSandersPetersPaulTesterCochranMoranMurrayBurrMurphyLeahyLeeKingReedYoungRounds
How I generated this
Previous versions were generated by simulated annealing, but now I’ve switched strategies to late acceptance hill-climbing. I’m not sure whether it’s fundamentally better or I just got luckier this time, but I do appreciate that LAHC has fewer parameters to tweak to get good results.
from __future__ import print_function
import random
import zlib
try: range = xrange
except NameError: pass
senators = b'Alexander, Baldwin, Barrasso, Bennet, Blumenthal, Blunt, Booker, Boozman, Brown, Burr, Cantwell, Capito, Cardin, Carper, Casey, Cassidy, Cochran, Collins, Coons, Corker, Cornyn, Cortez Masto, Cotton, Crapo, Cruz, Daines, Donnelly, Duckworth, Durbin, Enzi, Ernst, Feinstein, Fischer, Flake, Franken, Gardner, Gillibrand, Graham, Grassley, Harris, Hassan, Hatch, Heinrich, Heitkamp, Heller, Hirono, Hoeven, Inhofe, Isakson, Johnson, Kaine, Kennedy, King, Klobuchar, Lankford, Leahy, Lee, Manchin, Markey, McCain, McCaskill, McConnell, Menendez, Merkley, Moran, Murkowski, Murphy, Murray, Nelson, Paul, Perdue, Peters, Portman, Reed, Risch, Roberts, Rounds, Rubio, Sanders, Sasse, Schatz, Schumer, Scott, Shaheen, Shelby, Stabenow, Strange, Sullivan, Tester, Thune, Tillis, Toomey, Udall, Van Hollen, Warner, Warren, Whitehouse, Wicker, Wyden, Young'.split(b', ')
assert len(senators) == 100
random.shuffle(senators)
score = 9999
best = score
recent = 65536 * [score]
recent_index = 0
while True:
old_score = score
step = random.randrange(2)
if step == 0:
i, j = 100, 100
while i >= 51 and j >= 51:
i, j = random.sample(range(100), 2)
senators[i], senators[j] = senators[j], senators[i]
else:
i, j, k = 100, 100, 100
while i >= 51:
i, j, k = sorted(random.sample(range(101), 3))
senators[i:k] = senators[j:k] + senators[i:j]
bound = max(old_score, recent[recent_index])
z = zlib.compressobj(9, zlib.DEFLATED, -zlib.MAX_WBITS, 9)
sin = b''.join(senators[:51])
sout = bytearray(z.compress(sin) + z.flush())
score = len(sout) * 8
if score - 7 <= bound:
for bit in range(7):
sout[-1] ^= 128 >> bit
try:
if zlib.decompress(bytes(sout), -zlib.MAX_WBITS) == sin:
score -= 1
else:
break
except zlib.error:
break
if score > bound:
if step == 0:
senators[i], senators[j] = senators[j], senators[i]
else:
j = i + k - j
senators[i:k] = senators[j:k] + senators[i:j]
score = old_score
elif score < recent[recent_index]:
recent[recent_index] = score
if score < best:
best = score
print(score, b''.join(senators[:51]).decode())
recent_index = (recent_index + 1) % len(recent)
Palpatine
because he is the Senate? ;) \$\endgroup\$QqOZ
are letters that are unused in the senate. \$\endgroup\$Cortez Masto
also has a "personal space" \$\endgroup\$