This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
401541478 | |
421146853 | |
422309873 | |
425740636 | |
425741381 | |
425741393 | |
425741656 | |
429447916 | |
429448673 | |
456037902 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BFS.java: https://github.com/coolcomputery/Loopover-Brute-Force-and-Improvement/blob/6b8509c0f6aaab0413a810ee316196457e5ac87f/BFS.java | |
BFS2improve.java: https://github.com/coolcomputery/Loopover-Brute-Force-and-Improvement/blob/3aaf37d8e94059b41622e17c2d2cd4779ccac4e3/BFS2improve.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |