Skip to content

Instantly share code, notes, and snippets.

@coolcomputery
coolcomputery / 4x4->4x6.txt
Created March 21, 2023 15:15
6x6 (Dijkstra's + "L-conjugations"): 4x4->4x6 GN<=20, 4x6->6x6 GN<=21
% java -Xmx10g src/DijkstraRegion.java
6x6: [0, 1, 2, 3, 6, 7, 8, 9, 12, 13, 14, 15, 18, 19, 20, 21] --> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
#canonical_seqs=88
canonical_seqs=[[4C], [3R, 4C, 3R'], [2R, 4C, 2R'], [1R, 4C, 1R'], [0R', 5C, 0R], [1R, 4C2, 1R'], [3R, 4C2, 3R'], [0R', 5C2, 0R], [2R, 4C2, 2R'], [1R, 4C3, 1R'], [2R, 4C3, 2R'], [0R', 5C3, 0R], [3R, 4C3, 3R'], [1R, 4C4, 1R'], [2R, 4C4, 2R'], [3R, 4C4, 3R'], [0R', 5C4, 0R], [1R, 4C', 1R'], [4C'], [3R, 4C', 3R'], [2R, 4C', 2R'], [0R', 5C', 0R], [0R, 4C, 0R'], [1R', 5C, 1R], [2R', 5C, 2R], [3R', 5C, 3R], [5C], [2R', 5C2, 2R], [0R, 4C2, 0R'], [3R', 5C2, 3R], [1R', 5C2, 1R], [3R', 5C3, 3R], [0R, 4C3, 0R'], [2R', 5C3, 2R], [1R', 5C3, 1R], [0R, 4C4, 0R'], [3R', 5C4, 3R], [2R', 5C4, 2R], [1R', 5C4, 1R], [0R, 4C', 0R'], [2R', 5C', 2R], [3R', 5C', 3R], [5C'], [1R', 5C', 1R], [5R], [5R'], [3C', 5R3, 3C], [3C', 5R4, 3C], [3C', 5R', 3C], [3C', 5R, 3C], [3C', 5R2, 3C], [2C', 5R4, 2C], [2C', 5R', 2C], [2C', 5R, 2C],
@coolcomputery
coolcomputery / 6x6_111111x111111-010111x010111-010101x010101_threshold=23_stdout.txt
Created April 11, 2022 13:17
6x6: 111111x111111-010111x010111-010101x010101 GN <= 23
state0=111111x111111 state1=010111x010111 state2=010101x010101
threshold=23
check=false
'0 1 '2 3 4 5
6 7 8 9 10 11
'12 13 '14 15 16 17
18 19 20 21 22 23
24 25 26 27 28 29
30 31 32 33 34 35
f2a=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35]
401541478
421146853
422309873
425740636
425741381
425741393
425741656
429447916
429448673
456037902
@coolcomputery
coolcomputery / code_used.txt
Last active August 23, 2021 14:59
6x6: 4x4->4x5->5x5 GN <= 26
LoopoverBFS.java: https://github.com/coolcomputery/Loopover-Brute-Force-and-Improvement/blob/db7ad5ee6e6c916a40c90f85dd4827557d4093dc/LoopoverBFS.java
LoopoverBFSImprove.java: https://github.com/coolcomputery/Loopover-Brute-Force-and-Improvement/blob/db7ad5ee6e6c916a40c90f85dd4827557d4093dc/LoopoverBFSImprove.java
change main method:
public static void main(String[] args) {
long st=System.currentTimeMillis();
LoopoverBFSImprove.improve(6,6,"000011x000011","000001x000001",
26,
new String[] {
"000011x000001",
@coolcomputery
coolcomputery / LoopoverBFS.java
Created August 22, 2021 23:05
5x5 phases 3x3->4x4->5x5 in <= 27 moves
import java.util.*;
public class LoopoverBFS {
private static int mod(int n, int k) {
return (n%k+k)%k;
}
private static boolean[] mask(String s) {
boolean[] out=new boolean[s.length()];
for (int i=0; i<s.length(); i++)
out[i]=s.charAt(i)=='1';
return out;
@coolcomputery
coolcomputery / stdout.txt
Created August 2, 2021 04:20
5x5 NRG all 3-, 4-, 5- cycles of length <=36
code: https://github.com/coolcomputery/Loopover-NRG-Upper-Bounds/blob/4380887e232922ff7ec1f57bb4995cf4dbcb0d01/LoopoverNRGAlgorithmFinder.java
N=5,K=36
10.000 240202132 169902 {3=0, 4=0, 5=0}
56.568 1457862221 892582 {3=0, 4=0, 5=0}
155.884 4088086150 2470352 {3=0, 4=1, 5=0}
320.000 8381902439 4945844 {3=0, 4=2, 5=3}
559.016 14728448782 8575852 {3=0, 4=2, 5=5}
@coolcomputery
coolcomputery / part1.txt
Created August 1, 2021 14:57
5x5: 0x0->3x3cGN <= 17
stdout:
5x5: 11111x11111 --> ... --> 00011x00011
threshold=17, midstates=[10011x10011, 10011x01011, 10011x00111, 01011x10011, 01011x01011, 01011x00111, 00111x10011, 00111x01011, 00111x00111]
0 1 2 3 4
5 '6 '7 8 9
10 '11 '12 13 14
15 16 17 18 19
20 21 22 23 24
ncombos=303600
@coolcomputery
coolcomputery / LoopoverNRGAlgorithmFinder.java
Created July 16, 2021 20:29
Loopover NRG setup search algorithm works on a reduced list of base move sequences
import java.util.*;
public class LoopoverNRGAlgorithmFinder {
//a "blob" in a NxN Loopover NRG board is a move sequence that has no net displacement on the gripped piece
//a "strict blob" is a blob with the additional constraint that all rows and all columns have no "net shift"
private static int mod(int n, int k) {
return (n%k+k)%k;
}
private static final Comparator<String> algcomp=new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
@coolcomputery
coolcomputery / LoopoverNRGSetup.java
Created July 16, 2021 20:12
Loopover NRG Setup Move Search: two methods
/*
DESCRIPTION:
Shown below are two methods for finding all optimal cycle algorithms, by taking a few base algorithms and applying setup moves to them
i.e. having the move sequence M and repeatedly changing it to m*M*inv(m) for a single move m
What makes this task challenging is that adding setup moves to a move sequence (aka an algorithm) can sometimes cause parts of the sequence
to cancel out or shorten
ex. "LR" becomes "", "RRR" becomes "LL" in 5x5 NRG
This means we cannot use ordinary BFS or Dijkstra's algorithm to perform all possible cyclings of different pieces by optimally applying setup moves,
since there are negative-weight edges in the configuration graph