• Welcome to the Speedsolving.com, home of the web's largest puzzle community!
    You are currently viewing our forum as a guest which gives you limited access to join discussions and access our other features.

    Registration is fast, simple and absolutely free so please, join our community of 40,000+ people from around the world today!

    If you are already a member, simply login to hide this message and begin participating in the community!

Jaap's Square-1 Solver with 'Ignore pieces' functionality

dougbenham

Member
Joined
Mar 19, 2009
Messages
152
Location
Arizona
To fix the prunning table issue, I simply suggest to compute table with the following flag :

1/ ignoring edge
2/ edge corect orientation
3/ edge corect permutation

1/ ignoring corners
2/ corners corect orientation
3/ corners corect permutation

The number of table to précompute isn't so important. I you have 2 "don't care permutation" edges, then use the 2 and if you have 2 "don't care orientation" edges, then use the 1 . The pruning table can be sub-optimal in these case, but allox an optimal solution to be found.

To allow automated computations, you should add a paramter xxx move more than optimal and xxx move max instead of press n or enter.

Well I understand the concept/theory behind the new tables. I'm just not sure how to programmatically implement it. Perhaps someone that is familiar with the program can help me out.

Here is a snippet of the pruning table calculator:
Code:
l=1;
do{
	n=0;
	if( turnMetric ){
		for( i0=0; i0<NUMSHAPES; i0++ ){
		for( i1=0; i1<70; i1++){
		for( i2=0; i2<70; i2++){
		if( table[i0][i1][i2]==l ){
		for( m=0; m<3; m++){
			j0=i0;j1=i1;j2=i2;
			w=0;
			do{
				j2=sctc.tranTable[j0][j2][m];
				j1=scte.tranTable[j0][j1][m];
				j0=stt.tranTable[j0][m];
				if( table[j0][j1][j2]==0 ){
					table[j0][j1][j2]=l+1;
					n++;
				}
				w++;
				if(w>12){
					exit(0);
				}
			}while(j0!=i0 || j1!=i1 || j2!=i2 );
		}}}}}
	}else{
		for( i0=0; i0<NUMSHAPES; i0++ ){
		for( i1=0; i1<70; i1++){
		for( i2=0; i2<70; i2++){
			if( table[i0][i1][i2]==l ){
				// do twist
				j0=stt.tranTable[i0][2];
				j1=scte.tranTable[i0][i1][2];
				j2=sctc.tranTable[i0][i2][2];
				if( table[j0][j1][j2]==0 ){
					n+=setAll(j0,j1,j2,l+1);
				}
			}
		}}}
	}
	cout<<"     l="<<(int)l<<"  n="<<(int)n<<endl<<flush;
	l++;
}while(n!=0);
 

deadalnix

Member
Joined
Apr 6, 2007
Messages
560
WCA
2008SECH01
I don't know the program source code. But I know it use different tables when different metrics are used. So you should find somewhere a table selection/generation if it doesn't exist. It's where you should handle new cases.

Another solution is to generate the table « on the fly » adapted with the given case as JAcube does.
 

dougbenham

Member
Joined
Mar 19, 2009
Messages
152
Location
Arizona
So you should find somewhere a table selection/generation if it doesn't exist. It's where you should handle new cases.
Thats exactly what I posted above. That code is the code that generates the pruning table.

Another solution is to generate the table « on the fly » adapted with the given case as JAcube does.
This is a given. Of course it is going to need to be generated on the fly. I have looked at JACube source code and found the pruning table generation code, but I am still having difficulty understanding how it implements the 'ignore pieces' functionality.
 

N's-cvt

Member
Joined
Feb 5, 2020
Messages
119
I was trying to use the ignore function in the square-1 solver and it kept closing the program so can someone please take a look and see if there is something I am doing wrong:

D:\Games\sq1opt22>sq1optim.exe A2B3C1D45E6F7G8H -t-k-k-k----------
Jaap's Square-1 Optimizer v2.2 BETA http://www.jaapsch.net/ (modified by Doug Benham, [email protected])

Initializing...
5. Shape transition table..
4. Colouring 1 transition table..
3. Colouring 2 transition table..
2. Colouring 1 pruning table..
1. Colouring 2 pruning table..
0. Finished.

Flags: Turn Metric, Find Only First Solution
Position to solve: A2B3C1D45E6F7G8H
Searching depth 0..

"Has stopped working"
 

dougbenham

Member
Joined
Mar 19, 2009
Messages
152
Location
Arizona
please don't use these file upload sites. Put it on github or something. you can even release binaries there.
What do you mean? This is a Google Drive alternative. What's the difference between downloading it from there or Github?
 

qwr

Member
Joined
Jul 24, 2019
Messages
3,371
YouTube
Visit Channel
What do you mean? This is a Google Drive alternative. What's the difference between downloading it from there or Github?
these kinds of file uploading services never stick around as long as they should, as evidenced by

"The link is deleted by the owner."
-pCloud

Can you make another link?

plus they have annoying popups asking you to signup. since it's source code, you can put the code on github although idk what license it is released under.
 

dougbenham

Member
Joined
Mar 19, 2009
Messages
152
Location
Arizona
these kinds of file uploading services never stick around as long as they should, as evidenced by



plus they have annoying popups asking you to signup. since it's source code, you can put the code on github although idk what license it is released under.
That makes sense. However in this case it was my fault as I really did delete the link a while back by accident. I'll put it on github when I get a moment.
 
Joined
Jun 10, 2022
Messages
3
Location
Boston
Hi all. I'm new to the forum and very excited to join this community. I'm playing with Jaap and Doug's code, and my goal is to build an interactive Square-1 solver.

- Is there any Square-1 graphic library? I could find roofpig for the 3x3, but so far I haven't find anything similar for the Square-1. I really like cubedb.net visuals.

- Is the Square-1 solvable with only top or only bottom rotations, in general? Except for simple hand-built cases, the -onlytop and -onlybottom flags seem to loop forever.

Thanks all.
 
Top