# ksolve+ v1.0 - general-purpose algorithm finder



## qqwref (Oct 17, 2013)

ksolve+ is a C++ program that can find algorithms for many different puzzles - any simple permutation puzzle you can think of, and some not-so-simple ones too. This includes 2x2x2, 3x3x3, Megaminx, Square-1, and so on. You write a definition file defining the puzzle, and a scramble file listing the scrambles, and then ksolve+ will find optimal (or near-optimal, if you want) solutions for your scrambles.

The original ksolve was written by Kare Krig, but it hasn't been updated in a few years and I figured it could use some improvement. Apart from some major code rewriting, there are many improvements and new features. Changes include generating/solving random scrambles, ignoring pieces in the scramble file, reading in move sequences as scrambles, computing God's Algorithm tables, optionally using QTM, limiting the allowed number of each type of move, and looking for suboptimal algs. I also made it about 25% faster.

Download link (v1.3):
http://mzrg.com/rubik/ksolve+/ksolve_v1.3.rar
Apart from ksolve+ itself, I have included a readme, a bunch of sample definition and scramble files, and the source code.

Please let me know if you have any problems or if you find any bugs


----------



## Tim Major (Oct 17, 2013)

It was Ksolve that had the amazing Pyraminx solver. I lost the software and the name, thanks for improving it <3

Edit: Getting this: The program can't start because libgcc_s_dw2-1.dll is missing
http://stackoverflow.com/questions/...t-start-because-libgcc-s-dw2-1-dll-is-missing
I don't really understand what to do.


----------



## qqwref (Oct 17, 2013)

Gotcha. Should be fixed now, give it a try.


----------



## BurntTheCube (Oct 17, 2013)

Can't really get it to open but thats probably because I'm not tech savvy. But it closed like 22 tabs (MY COOKIE CLICKER!!) and downloaded some crappy homepage. 0/10


----------



## qqwref (Oct 17, 2013)

I put it up on my website instead; the download should be more foolproof now.


----------



## Ranzha (Oct 17, 2013)

BurntTheCube said:


> Can't really get it to open but thats probably because I'm not tech savvy. But it closed like 22 tabs (MY COOKIE CLICKER!!) and downloaded some crappy homepage. 0/10



Cookie Clicker autosaves every minute.


----------



## Tim Major (Oct 17, 2013)

qqwref said:


> I put it up on my website instead; the download should be more foolproof now.



I extracted, double clicked on ksolve.exe, it opens a small black window (like cmd) and instantly closes with no error message or anything. I can fraps if you want.


----------



## oranjules (Oct 17, 2013)

you have to launch it from cmd


----------



## Tim Major (Oct 17, 2013)

oranjules said:


> you have to launch it from cmd



Yeah I read the readme, I think I understand how to use it now. Thanks. I probably won't actually use this software. I basically understand how to use it, but it's too difficult to use.


----------



## Renslay (Oct 17, 2013)

If I'm guessing right, one can define a Square-1 by a puzzle with 24 pieces, (12 top, 12 bottom), 8 pairs of them are bandanged, and there are two center pieces (middle layer), where the orientation (permutation?) counts; and define U30, D30 and R180 moves with only permutations.

Edit: well, actually only the orientation of the right "center" counts.


----------



## Kirjava (Oct 17, 2013)

I'm really glad you improved this, will save me a lot of time hacking together quick solvers.


```
Name 3 Colour Cube

# Kirjava
# CORNERS URF, ULF, ULB, URB, DRF, DLF, DLB, DRB
# EDGES UF UL UB UR FR FL BL BR DF DL DB DR

Set CORNERS 8 3
Set EDGES 12 2

Solved
CORNERS
1 2 1 2 2 1 2 1
0 0 0 0 0 0 0 0
EDGES
1 2 1 2 3 3 3 3 1 2 1 2
0 0 0 0 0 0 0 0 0 0 0 0
End

Move U
CORNERS
4 1 2 3 5 6 7 8
0 0 0 0 0 0 0 0
EDGES
4 1 2 3 5 6 7 8 9 10 11 12
0 0 0 0 0 0 0 0 0 0 0 0
End

Move R
CORNERS
5 2 3 1 8 6 7 4
1 0 0 2 2 0 0 1
EDGES
1 2 3 5 12 6 7 4 9 10 11 8
0 0 0 1 1 0 0 1 0 0 0 1
End

Move F
CORNERS
2 6 3 4 1 5 7 8
2 1 0 0 1 2 0 0
EDGES
6 2 3 4 1 9 7 8 5 10 11 12
0 0 0 0 0 0 0 0 0 0 0 0
End

Move D
CORNERS
1 2 3 4 6 7 8 5
0 0 0 0 0 0 0 0
EDGES
1 2 3 4 5 6 7 8 10 11 12 9
0 0 0 0 0 0 0 0 0 0 0 0
End

Move L
CORNERS
1 3 7 4 5 2 6 8
0 2 1 0 0 1 2 0
EDGES
1 7 3 4 5 2 10 8 9 6 11 12
0 1 0 0 0 1 1 0 0 1 0 0
End

Move B
CORNERS
1 2 4 8 5 6 3 7
0 0 2 1 0 0 1 2
EDGES
1 2 8 4 5 6 3 11 9 10 7 12
0 0 0 0 0 0 0 0 0 0 0 0
End
```

Gonna have some fun with this, I always knew there would be a short way to J perm but never thought it'd be like 6 moves.


----------



## JustinJ (Oct 17, 2013)

This is super awesome! I've been thinking about how something like this would be useful recently, and it would be really nice to have this as a library of some kind so people could make GUI solvers easily (I don't mind CLI, but I think a lot of people who want to find algs do). Do you think it might even be possible to compile it to JavaScript with https://github.com/kripken/emscripten/wiki, and then use it to make in-browser solvers easily?


----------



## Kare (Oct 17, 2013)

This is great to see. I have been avoiding any development as I felt a major rewrite was needed to clean up the mess and thanks to the magic of open source I won't have too do that 

Something I have been experimenting with but never released is making the computations on multiple cores. A solver is very well suited to parallelization. With OpenMP it's fairly easy to add to a working single threaded program and I know gcc can get it working on both Windows and Linux. If you want any help with OpenMP I would be happy to lend a hand.


----------



## qqwref (Oct 18, 2013)

Glad this is useful to you guys. I was also thinking of putting up a page of prewritten def files on my site, so if you write up a def file for anything unusual, if you post it or send it over I could put it up.



JustinJ said:


> Do you think it might even be possible to compile it to JavaScript with https://github.com/kripken/emscripten/wiki, and then use it to make in-browser solvers easily?


If you do want to use ksolve+ as a sort of library you definitely could (it's open source and I don't personally mind if you use it in another project). It should be possible to compile to JS too, although I have a feeling the speed would be a problem (a solver specifically written for your puzzle of choice would probably be faster). You're thinking of a solver for a specific puzzle that comes with a prewritten def file, right?



Kare said:


> This is great to see. I have been avoiding any development as I felt a major rewrite was needed to clean up the mess and thanks to the magic of open source I won't have too do that


Glad I could help 



Kare said:


> Something I have been experimenting with but never released is making the computations on multiple cores. A solver is very well suited to parallelization. With OpenMP it's fairly easy to add to a working single threaded program and I know gcc can get it working on both Windows and Linux. If you want any help with OpenMP I would be happy to lend a hand.


Sure, some help with that would be very useful. Would it slow down the program much on a machine with only one or two cores?


----------



## JustinJ (Oct 18, 2013)

qqwref said:


> If you do want to use ksolve+ as a sort of library you definitely could (it's open source and I don't personally mind if you use it in another project). It should be possible to compile to JS too, although I have a feeling the speed would be a problem (a solver specifically written for your puzzle of choice would probably be faster). You're thinking of a solver for a specific puzzle that comes with a prewritten def file, right?



Yeah, pretty much, and that could translate input on a graphical puzzle into something ksolve could solve. Maybe I will look into it when I have a chance.


----------



## qqwref (Oct 23, 2013)

I put up a page on my website with a ksolve+ download and a bunch of .def files: http://mzrg.com/rubik/ksolve+/

I had some new ideas for things to add, so version 1.1 should be coming soon...


----------



## AvGalen (Oct 23, 2013)

This thread is proof that only a few people in the world are creators and all others are users.
It also felt like I was back in 2000 with seeing C++, commandline, missing references, bad downloadlinks.....and then someone asked "can it be used with javascript" 

Great work Michael. I will have a look at it this week and see if I can make a def file for one or more puzzles
BOOKMARKED


----------



## Gunnar (Oct 23, 2013)

*Using openMP*

Kåre is in Manilla for a month so I'm not sure if he will respond here, but I can just tell how I've used openMP to parallelize my own little cube solver.

My basic searchFunction looks like this. The pragma call will split the for-loop to be run on as many threads as there are cores. You'd have to import the library <omp.h> and I had to link "\MinGW\bin\pthreadGC2.dll" and set the compiler flag -fopenMP. I think you may find more info on openmp.org, since I'm not very good at explaining this. 

bool SearchParallel(Cube scramble, int indexEO, int indexCO, int indexCP, int depth)
{
if(depth == 0)
{
if(scramble.isSolved(indexEO, indexCO, indexCP))
{
cout << endl << "Cube is already solved!" << endl;
return true;
}
}

#pragma omp parallel for
for(int i = 0; i < nrOfAllowedMoves; i++)
{
int move = allowedMoves_;
int newIndexEO = transition.transitionTable_EO[PruningTable::SIZE_PRUNE_EO*i + indexEO];
int newIndexCO = transition.transitionTable_CO[PruningTable::SIZE_PRUNE_CO*i + indexCO];
int newIndexCP = transition.transitionTable_CP[PruningTable::SIZE_PRUNE_CP*i + indexCP];
if(Search(scramble.applyMove(move), newIndexEO, newIndexCO, newIndexCP, depth-1, move, -1, moves[move]))
found = true;
}

return false;
}


I also run the creation of the pruning tables in parallel in a manner like this. If the functions execute very quickly the overhead will make it run slower in parallel, but it's great for generating several big pruning tables.

#pragma omp parallel sections
{
#pragma omp section
{
generatePruningTableEO(allowedMoves, nrOfAllowedMoves);
}
#pragma omp section
{
generatePruningTableEP(allowedMoves, nrOfAllowedMoves);
}
#pragma omp section
{
generatePruningTableCO(allowedMoves, nrOfAllowedMoves);
}
}_


----------



## cuBerBruce (Oct 23, 2013)

It appears to me that if I specify "ForbiddenPairs" explicitly, the program still forbids certain pairs of its own. For example, if I add:

```
ForbiddenPairs
UF UB
FL UB
FR UB
UL UR
End
```
to the Helicopter_Cube_6gen.def file, and give it the scramble "UF UB FL", it fails to find any 3-move solutions, even though "UB FL UF" doesn't violate any of the given move restrictions. It finds 11-move solutions. In fact, simply including "FL UB" as a forbidden pair is sufficient to make it fail to find any 3-move solutions.

One other thing, if I forget to enter a name for a scramble, the program crashes.

Generally, though, thanks for implementing these improvements.


----------



## qqwref (Oct 24, 2013)

Yes, the program forbids quite a few pairs of its own. The reason for the problem you encountered is that ksolve+ has apparently already forbidden UB FL due to the two moves being parallel (it always forbids one of the two possibilities when it notices this). When you manually forbid the other possibility (FL UB), it cannot generate UB and FL next to each other in either order. Your move sequence is also equivalent to FL UF UB, which I think is also forbidden by the parallel move code. Thus the 3-move solution is blocked. I think this is more of an unintended effect of your command than an actual bug, since it seems like ksolve+ is working properly given its internal list of forbidden move pairs. I'll add some code to deal with this case, but you should never need to use ForbiddenPairs in the way you did.

I'll look into the nameless scramble thing as well, thanks.


----------



## cuBerBruce (Oct 24, 2013)

qqwref said:


> Yes, the program forbids quite a few pairs of its own. The reason for the problem you encountered is that ksolve+ has apparently already forbidden UB FL due to the two moves being parallel (it always forbids one of the two possibilities when it notices this). When you manually forbid the other possibility (FL UB), it cannot generate UB and FL next to each other in either order. Your move sequence is also equivalent to FL UF UB, which I think is also forbidden by the parallel move code. Thus the 3-move solution is blocked. I think this is more of an unintended effect of your command than an actual bug, since it seems like ksolve+ is working properly given its internal list of forbidden move pairs. I'll add some code to deal with this case, but you should never need to use ForbiddenPairs in the way you did.



So basically, while the original ksolve gives the user full control over defining canonical sequences, with the new version the user don't have any control over that whatsoever. I think it's great that the program can handle canonicalization automatically, but I don't think I particularly like its choice being forced upon me. And it seems to me the ForbiddenPairs feature has been made pretty much obsolete unless you want to prohibit certain non-commuting 2-move sequences for some reason.


----------



## qqwref (Oct 24, 2013)

Well, for ksolve+ v1.1 I've made a change that if you explicitly forbid one of the two parallel possibilities (e.g. FL UB) it will not automatically forbid the other one. The Helicopter Cube example you gave will generate the 3-move sequence now. So you can have control over which of the two canonical sequences it chooses, although if you are looking for the choice of generating both FL UB and UB FL, that is not currently an option.

And yes, ForbiddenPairs/ForbiddenGroups should be pretty much obsolete, although if someone does want to use them (for generating algs without particularly un-ergonomic move sequences, perhaps?) they are still available.


----------



## qqwref (Oct 27, 2013)

Version 1.1 is out: http://mzrg.com/rubik/ksolve+/ksolve_v1.1.rar

- I fixed the two problems Bruce mentioned.
- Orientation is now optional (you can leave it out anywhere and ksolve+ will just use all 0's). This should save time writing definition files, especially for puzzles with no orientation.
- MoveLimits is now in the scramble file instead of the definition file. You can put a limit on single moves (F2 2) or one move and all its powers (F* 2). I also added some optimizations to make move-limited alg searches run a bit faster.


----------



## Lucas Garron (Oct 27, 2013)

This runs great for me in OSX using wine, but I'd prefer a native build for OSX/Linux.
How hard would it be to remove Windows-specific code?

Also, I'd be interested in tracking the revision history. Would you consider posting a versioned repository somewhere? (I'm always a fan of things on GitHub!)


----------



## qqwref (Oct 27, 2013)

I could be wrong, but I think the only Windows-specific code is the stuff in pruning.h that checks which of two files is newer. You're welcome to try to rewrite those small parts (probably shouldn't need much changed) and recompile it.

And no, I really dislike using stuff like GitHub for personal development. There's too much overhead for me (sometimes I can spend more time trying to figure out how to send in the updated code than I actually spent writing it :|). I've just been keeping sub-versions in folders, which I guess I could zip up and send to you if you really want.


----------



## qqwref (Nov 2, 2013)

Version 1.2: http://mzrg.com/rubik/ksolve+/ksolve_v1.2.rar

- Everything runs way faster (roughly 2-3 times for my test cases). This is partly due to turning on gcc's maximum optimization (sorry I didn't think of this sooner ) and partly due to code optimizations which have the biggest effect on bandaged puzzles (such as the Bicube) and on puzzles with permutation-only pieces (such as 2gen Megaminx).
- Various other code improvements


----------



## qqwref (Nov 19, 2013)

Version 1.3: http://mzrg.com/rubik/ksolve+/ksolve_v1.3.rar

- Optimized indexing code for non-unique permutations (so puzzles with indistinguishable pieces will run faster)
- Changed data structure for moves, everything runs faster
- God's Alg tables can be generated for puzzles with > 2^63 positions, although it's slower
- God's Alg command prints algs for antipode positions
- Comments no longer require a space after the #, and they work in scramble files too
- In .def file, can omit parts of a move/solved state


----------



## MarcoRossi (Nov 23, 2013)

Can anyone explain me how the orientations are defined? I don't understand even the 2x2x2 def files.
For example move R is:

CORNERS
1 3 6 4 2 5 7
0 2 1 0 1 2 0

Why the orientation of the piece "3" is 2 and of piece "6" is 1?


----------



## Kare (Dec 7, 2013)

View attachment ksolveParallel.zip

Sorry it took so long to get started with the threading, work came in the way.

I have changed the search to consider each initial move a different task. Eg "find a 12 move solution starting with R" is one task, "find a 12 move solution starting with U2" is another. Each core on the computer will be assigned one task, and when one task is finished the core will get a new one if any remains. Output algs will no longer be sorted.

The only change is in treeSolve(...). 

Program needs to be built with openmp. I think most compilers support that, but it might be an optional item you need to install. I used mingw-gcc on windows and had to install openmp as an optional package. 

With gcc you need to build and link with -fopenmp

With mingw-gcc on windows the exe will be dependant on libgomp-1.dll and pthreadGC2.dll, both was included when I got the openmp package. For linux it seems to just work.

Performance is decent, but I was expecting better scaling than this. On my machine (4 cores, no hyper threading) I get the following for your 3x3x3_RFU computations.

Your binary: 658s
Your source, built by me: 654s
Threaded program, one thread: 653s
Threaded program, two threads: 432s
Threaded program, four threads: 342s


My change looks horrendous with all the code duplication, but when I tried to fix that by breaking it out to a function (ie, treeSearch calling foo() which in turn calls the next treeSearch level) I took a big performance hit.

It would be quite easy to also parallelize the table generation. Each table (edges permutation, corners orientation etc) can be considered one task and easily distributed, but with tables saved on disk it's not that much of an advantage.


----------



## Kirjava (Dec 17, 2013)

Aww yea, I knew this would come in handy


```
# Skewb ksolve+ definition file (tested on v1.3 from http://mzrg.com/rubik/ksolve+/)
#
# Notation is FCN as defined here; 
# http://meep.cubing.net/skewb-fcn.html
#
# Kirjava is cool
#
# CORNERS UFL, UBL, UBR, DFR, DFL, DBL, DBR
# CENTRES U F L B R D
# MOVES U D L R

Name Skewb
Set CORNERS 7 3
Set CENTRES 6 1
Solved
CORNERS
1 2 3 4 5 6 7
CENTRES
1 2 3 4 5 6
End
Move R
CORNERS
1 2 4 6 5 3 7
0 0 2 2 0 2 1
CENTRES
1 2 3 5 6 4
End
Move L
CORNERS
6 2 3 1 5 4 7
2 0 0 2 1 2 0
CENTRES
1 3 6 4 5 2
End
Move U
CORNERS
3 2 6 4 5 1 7
2 1 2 0 0 2 0
CENTRES
4 2 1 3 5 6
End
Move D
CORNERS
1 7 3 4 2 6 5
0 2 0 0 2 1 2
CENTRES
1 2 4 6 5 3
End
```

rob helped fix a mistake


----------



## Robert-Y (Dec 17, 2013)

Hi. I've created a definition file for 3x3x3 <R,r,U,F>, but whenever I run it, my laptop seems to freeze.
Can someone please tell me how to run this successfully and if I've made an error in the code? Thanks...


```
Name 3x3x3 <R,r,U,F>

# def-file by Robert Yau
# Edges: UF UL UB UR FL BR FR DF DB DR
# Corners: UFL UBL UBR UFR DFL DBR DFR
# Centres: U F D B

Set EDGES 10 2
Set CORNERS 7 3
Set CENTRES 4 1

Solved 
EDGES 
1 2 3 4 5 6 7 8 9 10
0 0 0 0 0 0 0 0 0 0
CORNERS
1 2 3 4 5 6 7
0 0 0 0 0 0 0
CENTRES
1 2 3 4
End

Move R
EDGES
1 2 3 7 5 4 10 8 9 6
0 0 0 0 0 0 0 0 0 0
CORNERS
1 2 4 7 5 3 6
0 0 1 2 0 2 1
CENTRES
1 2 3 4
0 0 0 0
End

Move r
EDGES
8 2 1 7 5 4 10 9 3 6
1 0 1 0 0 0 0 1 1 0
CORNERS
1 2 4 7 5 3 6
0 0 1 2 0 2 1
CENTRES
2 3 4 1
0 0 0 0
End

Move U
EDGES
4 1 2 3 5 6 7 8 9 10
0 0 0 0 0 0 0 0 0 0
CORNERS
4 1 2 3 5 6 7
0 0 0 0 0 0 0
CENTRES
1 2 3 4
0 0 0 0
End

Move F
EDGES
5 2 3 4 8 6 1 7 9 10
1 0 0 0 1 0 1 1 0 0
CORNERS
5 2 3 1 7 6 4
2 0 0 1 1 0 2
CENTRES
1 2 3 4
0 0 0 0
End
```

EDIT: I figured it out. I defined two moves R and r but ksolve isn't case sensitive so I had to call r something else like Rw.


----------



## Robert-Y (Dec 17, 2013)

Here's a fun 3x3x3 one 

(Just T perm and rotations!)


```
Name Tperm

# Robert Yau made this...
# CORNERS URF, ULF, ULB, URB, DRF, DLF, DLB, DRB
# EDGES UF UL UB UR FR FL BL BR DF DL DB DR
# CENTRES U F L B R D

Set CORNERS 8 3
Set EDGES 12 2
Set CENTRES 6 1

Solved
CORNERS
1 2 3 4 5 6 7 8
EDGES
1 2 3 4 5 6 7 8 9 10 11 12
CENTRES
1 2 3 4 5 6
End

Move T
CORNERS
4 2 3 1 5 6 7 8
EDGES
1 4 3 2 5 6 7 8 9 10 11 12
CENTRES
1 2 3 4 5 6
End

Move x
CORNERS
5 6 2 1 8 7 3 4
1 2 1 2 2 1 2 1
EDGES
9 6 1 5 10 2 4 12 11 7 3 8
1 0 1 0 0 0 0 0 1 0 1 0
CENTRES
2 6 3 1 5 4
End

Move y
CORNERS
4 1 2 3 8 5 6 7
EDGES
4 1 2 3 8 5 6 7 12 9 10 11
0 0 0 0 1 1 1 1 0 0 0 0
CENTRES
1 5 2 3 4 6
End

Move z
CORNERS
2 6 7 3 1 5 8 4
2 1 2 1 1 2 1 2
EDGES
6 10 7 2 1 9 11 3 5 12 8 4
1 1 1 1 1 1 1 1 1 1 1 1 
CENTRES
3 2 6 4 1 5
End
```


----------



## DrKorbin (Dec 22, 2013)

If def-file or file with scrambles has an empty line at the end, the program crashes.

```
...
Pruning tables found on file.
Pruning tables loaded.
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
```


----------



## cubizh (Jan 4, 2014)

DrKorbin said:


> If def-file or file with scrambles has an empty line at the end, the program crashes.


This specific bug can be easily fixed by editing readdef.h and readscramble.h and locate the following code (around line 40), and add the check for size == 0 like the following, for both files:

```
......
                while(!fin.eof()){
                        string command;
                        fin >> command;
                        // Break if nothing is found on file
                        if (command.size() == 0) {
                                break;
                        }
          
                        if (command == " .......
```
Hope this helps you.

Also, I asked a friend to help me port it to Linux and so I'd like to share a working Ksolve for Linux version, and I would like to ask the developers to see if they can find a way to integrate the changes into the main code so that a system-independent version can be achieved (which I can't do/test).


----------



## Lucas Garron (Jan 5, 2014)

cubizh said:


> Also, I asked a friend to help me port it to Linux and so I'd like to share a working Ksolve for Linux version, and I would like to ask the developers to see if they can find a way to integrate the changes into the main code so that a system-independent version can be achieved (which I can't do/test).



qqwref doesn't like using GitHub for this, but I track his changes on my repo. I've also added your changes on a branch: https://github.com/lgarron/ksolve-plus/tree/unix


----------



## Lucas Garron (Jan 5, 2014)

Merging the parallel code from Kåre worked: https://github.com/lgarron/ksolve-plus/tree/unix

I've got a parallel native binary on OSX now (using GCC 4.2, because apparently clang doesn't support OpenMP).



Kare said:


> My change looks horrendous with all the code duplication, but when I tried to fix that by breaking it out to a function (ie, treeSearch calling foo() which in turn calls the next treeSearch level) I took a big performance hit.


Inline functions?


----------



## cubizh (Jan 5, 2014)

Lucas Garron said:


> Merging the parallel code from Kåre worked: https://github.com/lgarron/ksolve-plus/tree/unix


I'm having problems compiling (actually linking) with gcc 4.7.3, it doesn't seem to recognize OpenMP for some reason.

EDIT: Fixed.


----------



## TheNextFeliks (Jan 5, 2014)

Wow. How do you do something like this? I'm a new programmer but I mostly do web dev like JavaScript. That is pretty cool. I might try to work on a JavaScript one.


----------



## Lucas Garron (Jan 6, 2014)

So, compiling to JS was easy: http://www.cubing.net/ksolve.js/

Unfortunately, memory usage blows up in the browser (I quickly hit 600MB on the 3x3x3 RFU example).


----------



## rokicki (Jan 6, 2014)

Lucas Garron said:


> So, compiling to JS was easy: http://www.cubing.net/ksolve.js/simple-async.html
> 
> Unfortunately, memory usage blows up in the browser (I quickly hit 600MB on the 3x3x3 RFU example).



The substate structure uses unmanaged pointers for its int arrays. Either smart pointers should
be used, or explicit resource management should be done.

(I don't know that this is the only memory leak, but it's the main one I see.)


----------



## Renslay (Jan 7, 2014)

Hi! I just tried it and defined the Floppy cube. It is fun! 


```
Name Floppy

# def-file by Norbert Hantos

Set CORNERS 4 2
Set EDGES 4 2

Solved
CORNERS
1 2 3 4
EDGES
1 2 3 4
End

Move R
CORNERS
1 3 2 4
0 1 1 0
EDGES
1 2 3 4
0 1 0 0
End

Move F
CORNERS
1 2 4 3
0 0 1 1
EDGES
1 2 3 4
0 0 1 0
End

Move L
CORNERS
4 2 3 1
1 0 0 1
EDGES
1 2 3 4
0 0 0 1
End

Move B
CORNERS
2 1 3 4
1 1 0 0
EDGES
1 2 3 4
1 0 0 0
End
```

Edit: Hm, I think the orientation of the corners is not necessary.


----------



## Renslay (Jan 7, 2014)

I just don't understand something. I defined a puzzle:


```
Solved
BIG 
1 1 2 2 3
SMALL
1 1 1 1 1 2 2 2 2 2 3 3 3 3
End
```

And of course I defined the moves. Then I give this scramble:


```
Scramble test
BIG
1 1 2 2 3
SMALL
3 1 2 3 2 2 3 1 1 2 2 3 1 1
End
```

The program solves it in 16 moves, which is nice. However, I try to find a solution where only the permutation of the 1s are interesting for me. Therefore I try:


```
Scramble test
BIG
1 1 2 2 3
SMALL
? 1 ? ? ? ? ? 1 1 ? ? ? 1 1
End
```

This is the same as above, just ? instead of numbers other than 1 on the small pieces. Here, the program couldn't find a solution (it goes even to depth 22 and further, but God's number for the whole puzzle is 21). However, if I give some "hint":


```
Scramble test
BIG
1 1 2 2 3
SMALL
?3 1 ?2 ?3 ?2 ?2 ?3 1 1 ?2 ?2 ?3 1 1
End
```

It finds again the 16 moves solution. What do I do wrong, why the second example does not working?


----------



## Carrot (Jan 7, 2014)

```
Solved
BIG 
1 1 2 2 3
SMALL
1 1 1 1 1 2 2 2 2 2 3 3 3 3
End

Ignore
SMALL
0 0 0 0 0 1 1 1 1 1 1 1 1 1
End
```

You need to put the Ignore in the Def file to activate the ?s


```
Scramble test
BIG
1 1 2 2 3
SMALL
?3 1 ?2 ?3 ?2 ?2 ?3 1 1 ?2 ?2 ?3 1 1
End
```

it may sound silly, but you actually NEED to put a valid piece after the ?. It's silly but I hope it works. if it doesn't I swapped the 0 and 1's in the Ignore in the def. (it's binary for ignore and don't ignore)


----------



## qqwref (Jan 7, 2014)

Lucas Garron said:


> qqwref doesn't like using GitHub for this, but I track his changes on my repo. I've also added your changes on a branch: https://github.com/lgarron/ksolve-plus/tree/unix





Lucas Garron said:


> So, compiling to JS was easy: http://www.cubing.net/ksolve.js/


The Mac version fix is cool, but I'm not particularly happy with you doing all this easy-but-impressive-looking stuff behind my back and attaching your username and/or website to it. You know, this kind of thing makes me a LOT less eager to work on useful tools for the cubing community in the future.



Renslay said:


> This is the same as above, just ? instead of numbers other than 1 on the small pieces. Here, the program couldn't find a solution (it goes even to depth 22 and further, but God's number for the whole puzzle is 21). However, if I give some "hint"


If you aren't also putting an Ignore command in the .def file to tell ksolve you are ignoring pieces, that would be why it isn't working. Basically, if it does not know you are ignoring pieces, it uses the wrong pruning table and thinks a lot of perfectly good solutions are impossible. I'd love to only have this in the scramble file, but then it would have to compute pruning tables for each scramble as it goes, and in almost all cases that'd be way slower.



rokicki said:


> The substate structure uses unmanaged pointers for its int arrays. Either smart pointers should
> be used, or explicit resource management should be done.


Interesting; if I am leaking memory this way I definitely want to fix it. What data structure changes do you recommend I make (put the substate in a smart pointer? put the orientation/permutation arrays in smart pointers? switch to a pair of smart-pointered vectors?)?


----------



## tim (Jan 7, 2014)

qqwref said:


> The Mac version fix is cool, but I'm not particularly happy with you doing all this easy-but-impressive-looking stuff behind my back and attaching your username and/or website to it.



That's totally understandable. But why do you not want to use Github (or any other comparable service)? I think this software would benefit from open sourcing it (in this case I mean: putting it somewhere to make it a) easily accessible and b) easy to contribute to). There are many capable coders in our community (and basically everyone knows C), but sending you files with fixes or improvements (like the linux port) is a pain in the ass and I personally don't want to do it.


----------



## Jakube (Jan 8, 2014)

qqwref said:


> If you aren't also putting an Ignore command in the .def file to tell ksolve you are ignoring pieces, that would be why it isn't working. Basically, if it does not know you are ignoring pieces, it use the wrong pruning table and thinks a lot of perfectly good solutions are impossible. I'd love to only have this in the scramble file, but then it would have to compute pruning tables for each scramble as it goes, and in almost all cases that'd be way slower.



It should only have to be in the scramble file. 
Your comment made me realize, that I had an ignore command in the definition file. It bugged me a while, that it wasn't able to find 12 move solutions in a reasonable time. After removing the command, ksolve finds 13+ solutions in a second. 

Maybe you can save multiple pruning tables and always pick the best one. And if there's a scramble with a new ignore type, the generate a save new ones. I guess, people only use a small number of different ignore definitions, so it wouldn't have to generate the pruning tables at every scramble. Only if it should ignore new pieces. 

Or just simply print a warning, if the program sees, that the current pruning tables doesn't match the scramble, like "Using different ignore setting might speed up the search" or "ksolve might not find all solutions because of wrong ignore settings".


----------



## qqwref (Jan 8, 2014)

Jakube: I agree that's how it should be, but it could mean having to keep track of multiple potentially-large pruning table files, loading and unloading large amounts of data into memory between scrambles, and recalculating any or all of that pruning table data whenever the definition file is changed. Really the problem is that I don't want the software to become bloated and slow just for the sake of a single feature, and I am worried this could do just that. A chunk of extra speed or efficiency could be very valuable to people searching in particularly difficult/complex puzzles.



tim said:


> That's totally understandable. But why do you not want to use Github (or any other comparable service)? I think this software would benefit from open sourcing it (in this case I mean: putting it somewhere to make it a) easily accessible and b) easy to contribute to). There are many capable coders in our community (and basically everyone knows C), but sending you files with fixes or improvements (like the linux port) is a pain in the ass and I personally don't want to do it.


I don't mind using a version control system if people want to actively contribute, and it seems like they do. I really do dislike the way git works (as a program and concept) and find most of its jargon incomprehensible, but if people are absolutely dead set on using git and github over something like SVN/Google Code I'll get down to figuring it out eventually.


----------



## rokicki (Jan 8, 2014)

qqwref said:


> Interesting; if I am leaking memory this way I definitely want to fix it. What data structure changes do you recommend I make (put the substate in a smart pointer? put the orientation/permutation arrays in smart pointers? switch to a pair of smart-pointered vectors?)?



Let's chat by email; mine should be pretty obvious and I'm not sure I remember what yours was.

But for a quick fix I'd recommend (I've never used these myself but I have heard a lot of good things
about them) the reference-counted pointers (std::shared_ptr) for your int* in substate.

You'll probably need to give substate a default constructor, a copy constructor, a destructor, and
an assignment operator, but these are pretty boilerplate.

-tom


----------



## tim (Jan 8, 2014)

qqwref said:


> I don't mind using a version control system if people want to actively contribute. I really do dislike the way git works (as a program and concept) and find most of its jargon incomprehensible, but if people are absolutely dead set on using git and github over something like SVN/Google Code I'll get down to figuring it out eventually.



Yeah, git is unfortunately far from easy to understand, but IMO worth learning. I especially found learning how git works internally very rewarding [1][2]. It's surprisingly simple.
Anyway, SVN+google code or mercurial+bitbucket would be fine as well.

[1] http://www.youtube.com/watch?v=GYnOwPl8yCE
[2] http://www.youtube.com/watch?v=1ffBJ4sVUb4 (funny, but not as accurate and detailed as [1])


----------



## rokicki (Jan 8, 2014)

Another fix is to replace int* with vector<int> in substate and make the relevant other
changes throughout. This may be simpler or may be harder.

Neither of these solutions will be particularly efficient.


----------



## Lucas Garron (Jan 8, 2014)

qqwref said:


> The Mac version fix is cool, but I'm not particularly happy with you doing all this easy-but-impressive-looking stuff behind my back and attaching your username and/or website to it. You know, this kind of thing makes me a LOT less eager to work on useful tools for the cubing community in the future.



I do put an attribution where I can, e.g. "Versioned mirror of Kare's / qqwref's ksolve+ puzzle solver." on the top of GitHub.
This particular time, the demo page didn't have an attribution because it is a minimal test page (i.e. based on this instead of this) but I've added them now.

I'm glad you're open to something like GitHub for collaborative development. There are a few more easy-but-impressive-looking steps to take. ;-)
I personally prefer the flexibility of git and the fact that GitHub focuses on the code itself (plus, most people are already there), but something else would be fine.


----------



## cubizh (Jan 8, 2014)

qqwref said:


> A chunk of extra speed or efficiency could be very valuable to people searching in particularly difficult/complex puzzles.



One feature I would like to see implemented is the save search upon crash or termination and resume. You can imagine how pissed off I was having ksolve running for an entire week (well, 6 days straight) searching for algs and all of a sudden losing everything due to a CPU overheat emergency shutdown.



qqwref said:


> I don't mind using a version control system if people want to actively contribute, and it seems like they do. I really do dislike the way git works (as a program and concept) and find most of its jargon incomprehensible, but if people are absolutely dead set on using git and github over something like SVN/Google Code I'll get down to figuring it out eventually.





tim said:


> Yeah, git is unfortunately far from easy to understand, but IMO worth learning. I especially found learning how git works internally very rewarding [1][2]. It's surprisingly simple.
> Anyway, SVN+google code or mercurial+bitbucket would be fine as well.
> 
> [1] http://www.youtube.com/watch?v=GYnOwPl8yCE
> [2] http://www.youtube.com/watch?v=1ffBJ4sVUb4 (funny, but not as accurate and detailed as [1])





Lucas Garron said:


> I personally prefer the flexibility of git and the fact that GitHub focuses on the code itself (plus, most people are already there), but something else would be fine.


I have used GitHub, but am also not particularly experienced with it beyond the utmost basics, but really mostly because I have not really looked deeply into it. I will look more into it in the future. 
Thanks for the links, tim.


----------



## Renslay (Jan 8, 2014)

Thanks to ksolve, I was able to construct a full solving method for a brand new puzzle!


----------



## Ranzha (Jan 9, 2014)

I made some ksolve+ definition files for Skewb in WCA-style FCN, FCeN, and Hideki Niina's notation that are similar to Thom's def file. The biggest difference is the piece labelling and the inclusion of all pieces. This may cause the solver to run less quickly, but the solver's fast and furious as it is, so no harm done? =D

The piece labelling was meant to mirror Meep's Skewb Solver 2.2. Also, for solvers using Sarah's method (and thus Hideki Niina's notation), choose the set of moves you want to include in your def file. Turns about all eight corners are defined below.

Fixed Corner Notation, WCA-style:

```
# Skewb ksolve+ definition file (tested on v1.3 from http://mzrg.com/rubik/ksolve+/)
#
# Notation is Fixed Corner Notation (FCN) as defined here: 
# https://www.worldcubeassociation.org/regulations/#12h
#
# Ranzha
#
# centres U F R D B L
# corners UFR, UBR, UBL, UFL, DFR, DBR, DBL, DFL
# moves U R L B

Name Skewb
Set corners 8 3
Set centres 6 1
Solved
corners
1 2 3 4 5 6 7 8
0 0 0 0 0 0 0 0
centres
1 2 3 4 5 6
End
Move U
corners
1 7 3 2 5 6 4 8
0 2 1 2 0 0 2 0
centres
5 2 3 4 6 1
End
Move R
corners
1 5 3 4 7 6 2 8
0 2 0 0 2 1 2 0
centres
1 2 4 5 3 6
End
Move L
corners
1 2 3 7 4 6 5 8
0 0 0 2 2 0 2 1
centres
1 6 3 2 5 4
End
Move B
corners
1 2 6 4 5 8 7 3
0 0 2 0 0 2 1 2
centres
1 2 3 6 4 5
End
```


Fixed Centre Notation:

```
# Skewb ksolve+ definition file (tested on v1.3 from http://mzrg.com/rubik/ksolve+/)
#
# Notation is Fixed Centre Notation (FCeN) as defined here: 
# http://ranzha.cubing.net/skewb/notation.html
#
# Ranzha
#
# centres U F R D B L
# corners UFR, UBR, UBL, UFL, DFR, DBR, DBL, DFL
# moves F R L B

Name Skewb
Set corners 8 3
Set centres 6 1
Solved
corners
1 2 3 4 5 6 7 8
0 0 0 0 0 0 0 0
centres
1 2 3 4 5 6
End
Move F
corners
8 2 3 4 5 1 7 6
2 0 0 0 1 2 0 2
centres
1 4 2 3 5 6
End
Move R
corners
1 5 3 4 7 6 2 8
0 2 0 0 2 1 2 0
centres
1 2 4 5 3 6
End
Move L
corners
1 2 3 7 4 6 5 8
0 0 0 2 2 0 2 1
centres
1 6 3 2 5 4
End
Move B
corners
1 2 6 4 5 8 7 3
0 0 2 0 0 2 1 2
centres
1 2 3 6 4 5
End
```


Hideki Niina's notation:

```
# Skewb ksolve+ definition file (tested on v1.3 from http://mzrg.com/rubik/ksolve+/)
#
# Notation is in the style of Hideki Niina as defined here: 
# http://rubikskewb.web.fc2.com/skewb/notation.html
#
# Ranzha
#
# centres U F R D B L
# corners UFR, UBR, UBL, UFL, DFR, DBR, DBL, DFL
# moves F R L B f r l b

Name Skewb
Set corners 8 3
Set centres 6 1
Solved
corners
1 2 3 4 5 6 7 8
0 0 0 0 0 0 0 0
centres
1 2 3 4 5 6
End
Move F
corners
1 4 3 5 2 6 7 8
1 2 0 2 2 0 0 0
centres
2 3 1 4 5 6
End
Move R
corners
6 2 1 4 5 3 7 8
2 1 2 0 0 2 0 0
centres
3 2 5 4 1 6
End
Move L
corners
3 2 8 4 5 6 7 1
2 0 2 1 0 0 0 2
centres
6 1 3 4 5 2
End
Move B
corners
1 7 3 2 5 6 4 8
0 2 1 2 0 0 2 0
centres
5 2 3 4 6 1
End
Move f
corners
8 2 3 4 5 1 7 6
2 0 0 0 1 2 0 2
centres
1 4 2 3 5 6
End
Move r
corners
1 5 3 4 7 6 2 8
0 2 0 0 2 1 2 0
centres
1 2 4 5 3 6
End
Move l
corners
1 2 3 7 4 6 5 8
0 0 0 2 2 0 2 1
centres
1 6 3 2 5 4
End
Move b
corners
1 2 6 4 5 8 7 3
0 0 2 0 0 2 1 2
centres
1 2 3 6 4 5
End
```


Rotations:

```
# Skewb ksolve+ definition file for rotations (tested on v1.3 from http://mzrg.com/rubik/ksolve+/)
#
# Ranzha
#
# moves x y z

Name Skewb
Set corners 8 3
Set centres 6 1
Solved
corners
1 2 3 4 5 6 7 8
0 0 0 0 0 0 0 0
centres
1 2 3 4 5 6
End
Move x
corners
5 1 4 8 6 2 3 7
0 0 0 0 0 0 0 0
centres
2 4 3 5 1 6
End
Move y
corners
2 3 4 1 6 7 8 5
0 0 0 0 0 0 0 0
centres
1 3 5 4 6 2
End
Move z
corners
4 3 7 8 1 2 6 5
0 0 0 0 0 0 0 0
centres
6 2 1 3 5 4
End
```

In my few days of using it, I'd like to commend all contributors to ksolve+. This solver is fast, efficient, well-documented--truly revolutionary.


----------



## qqwref (Jan 23, 2014)

Honestly, because of what lgarron did, I'm really not particularly excited about putting any more time into this thing. I made a ton of huge changes since Kare's version, completely rewrote the readme, and put a lot of time in, but I'm sure soon enough anyone who googles it will just think "oh it's yet another lgarron project, he's so awesome". I'm probably going to release a last version at some point, to fix some bugs, and then that's it. For the record, ksolve was all done by Kare and everything after that and until ksolve+ v1.3 was done by me; the next version I put on my site will have contributions from others.


----------



## joey (Jan 23, 2014)

Nowhere does it say anything about Lucas? Your name is definitely on there.

You could also ask Lucas to take it down, or make your own account on github.


----------



## cubizh (Jan 24, 2014)

qqwref said:


> Honestly, because of what lgarron did, I'm really not particularly excited about putting any more time into this thing. I made a ton of huge changes since Kare's version, completely rewrote the readme, and put a lot of time in, but I'm sure soon enough anyone who googles it will just think "oh it's yet another lgarron project, he's so awesome". I'm probably going to release a last version at some point, to fix some bugs, and then that's it. For the record, ksolve was all done by Kare and everything after that and until ksolve+ v1.3 was done by me; the next version I put on my site will have contributions from others.


I think everyone that matters knows and appreciates your efforts in rebooting ksolve and sharing it openly for the benefits of all, regarding general puzzle solving.


----------



## TheNextFeliks (Feb 3, 2014)

How does one write a proper define file? I am just using the JavaScript one on cubing.net btw and I love it.


----------



## Methuselah96 (Feb 3, 2014)

TheNextFeliks said:


> How does one write a proper define file? I am just using the JavaScript one on cubing.net btw and I love it.



Download the ZIP from the OP. Read the readme and look at the examples.


----------



## TheNextFeliks (Feb 4, 2014)

Ok. This is great. But I can't figure out the Ignore. I am trying to do OLL so avoiding the permutation. Could someone post an example? I am trying to find algs for the I case with bars on both sides.


----------



## Methuselah96 (Feb 4, 2014)

As far as I know (I've never actually run the program) assuming you're using these definitions:
# CORNERS URF ULF ULB URB DRF DLF DLB DRB
# EDGES UF UL UB UR FR FL BL BR DF DL DB DR
and you have the LL on top, the ignore part of the def file would be:
Ignore
CORNERS
1 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0
EDGES
1 1 1 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
End

Because you want to ignore the permutation of the top pieces hence the 1's in the permutation (top) lines.


----------



## Jakube (Feb 4, 2014)

Methuselah96 said:


> Def file would be:
> Ignore
> CORNERS
> 1 1 1 1 0 0 0 0
> ...



And in the scramble file, you have to set the responseble pieces to '?'. Otherwise it would try to solve the permutation. 

Scramble Bar-OLL
CORNERS
? ? ? ? 5 6 7 8
2 1 2 1 0 0 0 0
CENTERS
? ? ? ? 5 6 7 8 9 10 11 12
0 1 0 1 0 0 0 0 0 0 0 0
End


----------



## TheNextFeliks (Feb 4, 2014)

I have this

```
Name 3x3

# .def file by Michael Gottlieb
# CORNERS URF ULF ULB URB DRF DLF DRB
# EDGES UF UL UB UR FR FL BL BR DF DL DB DR

Set CORNERS 7 3
Set EDGES 9 2

Solved
CORNERS
1 2 3 4 5 6 7
0 0 0 0 0 0 0
EDGES
1 2 3 4 5 6 7 8 9
0 0 0 0 0 0 0 0 0
End

Move U
CORNERS
4 1 2 3 5 6 7
EDGES
4 1 2 3 5 6 7 8 9
End

Move R
CORNERS
5 2 3 1 7 6 4
1 0 0 2 2 0 1
EDGES
1 2 3 5 9 6 4 8 7 
0 0 0 1 1 0 1 0 1
End

Move F
CORNERS
2 6 3 4 1 5 7
2 1 0 0 1 2 0
EDGES
6 2 3 4 1 8 7 5 9
End

Ignore
CORNERS
1 1 1 1 0 0 0
0 0 0 0 0 0 0
EDGES
1 1 1 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0
End
```

and

my scramble is this:

```
Scramble Bar-OLL
CORNERS
? ? ? ? 5 6 7
2 1 2 1 0 0 0
EDGES
? ? ? ? 5 6 7 8 9
0 1 0 1 0 0 0 0 0
End
```

And I am getting this:


> Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 536870912, or (2) set Module.TOTAL_MEMORY before the program runs.


----------



## Jakube (Feb 4, 2014)

I guess, a table needs too much memory. At least JavaScript has some problems. Your def- and scramble files are o.k. 

Try using the offline version. It can run your def- and scramble-files without any error. I get the solution
Depth 12
F R' F' R U2 F' U F U' R U2 R'


----------



## Kirjava (Feb 25, 2014)

Ok so, I'm trying to make a solver for a specific subset of something within Square1 BarrelBarrel shape.

The blocking doesn't appear to work correctly, maybe it's something to do with blocking and having two types of blocked pieces that are the same?

Here's my definition file: 



Spoiler





```
Name Sq1orb
     
# Corner Orbitation
# 2 3 = Y
# 4 5 = W
# http://i.imgur.com/tMCVYzA.png
Set EDGES 24 1
     
Solved
EDGES
1 2 3 4 5 1 1 2 3 4 5 1 1 4 5 2 3 1 1 4 5 2 3 1
End
     
Move U
EDGES
12 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24
End
     
Move D
EDGES
1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 13
End
     
Move /
EDGES
1 2 3 4 5 6 24 23 22 21 20 19 13 14 15 16 17 18 12 11 10 9 8 7
End
     
Block
EDGES
2 3
End
     
Block
EDGES
4 5
End

Ignore
EDGES
1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1
End
```




And an example scramble file that produces impossible scrambles: 



Spoiler





```
Slack 2
HTM
Scramble Step_1_case
EDGES
?1 4 5 4 5 ?1 ?1 4 5 4 5 ?1 ?1 2 3 2 3 ?1 ?1 2 3 2 3 ?1
End
```




Can you not have interchangable block pieces? I'm pretty sure this is a bug.


----------



## ryanj92 (Jun 27, 2014)

i've been playing around with ksolve this afternoon, and i occasionally get the following error for certain scrambles: 

Here is an example of a scramble which gives this error and the .def file i am using:


Spoiler: scramble



Scramble purepifliplr
CENTERS
1 2 3 4
0 0 0 0
CORNERS
1 2 3 4 5 6
1 1 2 2 0 0
EDGES
? ? ? ? 5 6 7 8 9
0 1 0 1 0 0 0 0 0
End





Spoiler: .def file



Name 3x3x3 <M,R,r,U>

# Edges: UF UR UB UL DF DR DB FR BR
# Corners: UBL UBR UFR UFL DBR DFR
# Centers: U F D B

Set EDGES 9 2
Set CORNERS 6 3
Set CENTERS 4 1

Solved 
EDGES 
1 2 3 4 5 6 7 8 9
CORNERS
1 2 3 4 5 6
CENTERS
1 2 3 4
End

Move U
EDGES
2 3 4 1 5 6 7 8 9
CORNERS
4 1 2 3 5 6
CENTERS
1 2 3 4
End

Move R
EDGES
1 8 3 4 5 9 7 6 2
CORNERS
1 3 6 4 2 5
0 2 1 0 1 2
CENTERS
1 2 3 4
End

Move r
EDGES
5 8 1 4 7 9 3 6 2
1 0 1 0 1 0 1 0 0
CORNERS
1 3 6 4 2 5
0 2 1 0 1 2
CENTERS
2 3 4 1
End

Move M
EDGES
3 2 7 4 1 6 5 8 9
1 0 1 0 1 0 1 0 0
CORNERS
1 2 3 4 5 6
CENTERS
4 1 2 3
End

Ignore
EDGES
1 1 1 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0
End


what might be causing the error? i've tried inputting the scramble from all angles, but I get the same error each time...

EDIT: Ben managed to work this scramble fine, it may just be the laptop i am using then...


----------



## cubizh (Jun 28, 2014)

This has been discussed earlier in the thread and has been fixed in some of the sources out there.


----------



## ryanj92 (Jul 10, 2014)

Noob question...
I've been trying to generate tables for the <M,R,r,U,F> subset, and it keeps giving up, presumably because its used up it's allocated memory (memory usage hits a peak and then hangs for a while before the program terminates) despite there still being memory available... How can I allocate more memory?

Thanks in advance.


----------



## qqwref (Jul 10, 2014)

Do you mean pruning tables or God's Algorithm tables? How much is it trying to store? And what OS are you using (including 32 bit or 64 bit)?


----------



## ryanj92 (Jul 10, 2014)

qqwref said:


> Do you mean pruning tables or God's Algorithm tables? How much is it trying to store? And what OS are you using (including 32 bit or 64 bit)?



Pruning tables, and it crashes during EP (tablesize 3628800)
Using 64-bit windows 7 (home premium)


----------



## blade740 (Jul 17, 2014)

Is there any way to disable the automatic multiplicator function? I am defining each "move" as a short algorithm, rather than a single move, and so I don't want to search with things like Uperm'. I would rather define things like U2 and U' manually (and UD and UD' and such along the way).


----------



## G2013 (Sep 14, 2014)

Help! I open the program, but it automatically closes itself...


----------



## blade740 (Sep 14, 2014)

It's a command line program - you can't just double-click it in explorer and expect it to do anything. It requires you to open up a command prompt and pass along the .def and scramble files as arguments.


----------



## G2013 (Sep 14, 2014)

blade740 said:


> It's a command line program - you can't just double-click it in explorer and expect it to do anything. It requires you to open up a command prompt and *pass along the .def and scramble files as arguments.*



What? I don't understand that. I have some .def files on my ksolve folder, what do I do with them?


----------



## cubizh (Sep 14, 2014)

G2013 said:


> What? I don't understand that. I have some .def files on my ksolve folder, what do I do with them?


You need to open a cmd line (if you don't know, search on how to use the command line and how to change local directory on a search engine), and to start the program you write something like

```
ksolve filename.def something.txt
```


----------



## G2013 (Sep 14, 2014)

I just want to find a [Rw, U] U perm, and somehow I ended up here... For what I've read, I need to build up a "3x3x3_RwU" file, but I don't know how to use cmd, I don't know how to program or define values, and all that in English is even harder. Sorry for my ignorance


----------



## AvGalen (Sep 14, 2014)

^^It seems there should be a "xksolve" or "winksolve"


----------



## Stefan (Sep 14, 2014)

cubizh said:


> how to change local directory



At least in Windows Explorer, one can hold shift and right-click on or into the folder (not on a file), then select "Open command window here".

Alternatively, one can create a .bat file with a text editor, for example "run.bat" containing this:

```
ksolve filename.def something.txt
pause
```

Sorry that this was just for Windows, I don't know Apple stuff (and if he were using something else, he wouldn't be asking such a question ).


----------



## qqwref (Sep 14, 2014)

AvGalen said:


> ^^It seems there should be a "xksolve" or "winksolve"


ksolve+ *is* for Windows. There's a Linux version too but obviously if you are on Windows you shouldn't use that one. The thing is, there's no GUI, so you can't just click around on a window to set stuff up. Writing a GUI is tricky and can take a lot of time, so you can imagine why I didn't feel like doing it. If someone wants to give it a shot, go ahead...


----------



## G2013 (Sep 14, 2014)

I have managed to get a 3x3x3rU def file and scramble file to find the U perm.

```
Name 3x3rU

# .def file by Guido Toodeepy
# CORNERS ULB URB ULF URF DRF DRB
# EDGES UB UL UR UF FR BR DF DR DB

Set CORNERS 6 3
Set EDGES 9 2

Solved
CORNERS
1 2 3 4 5 6
EDGES
1 2 3 4 5 6 7 8 9
End

Move r
CORNERS
1 4 3 5 6 2
0 1 0 2 1 2
EDGES
4 2 5 7 8 3 9 6 1
1 0 0 1 0 0 1 0 1
End

Move U
CORNERS
3 1 4 2 5 6
0 0 0 0 0 0
EDGES
2 4 1 3 5 6 7 8 9
0 0 0 0 0 0 0 0 0
End
```


```
Slack 3

Scramble Uperm
CORNERS
1 2 3 4 5 6
EDGES
2 3 1 4 5 6 7 8 9
End
```

Now, I want to run it. How do I do? I enter to cmd and type "ksolve 3x3x3_rU.def 3x3x3_rU.txt" but nothing happens.


----------



## Jakube (Sep 14, 2014)

Are you sure you're in the correct directory. You can navigate with 'cd'. 

But if you still fail calling ksolve, simply use the online version of ksolve+ (http://www.cubing.net/ksolve.js/). I guess it's a bit slower, but not much.


----------



## G2013 (Sep 14, 2014)

Jakube said:


> Are you sure you're in the correct directory. You can navigate with 'cd'.
> 
> But if you still fail calling ksolve, simply use the online version of ksolve+ (http://www.cubing.net/ksolve.js/). I guess it's a bit slower, but not much.


Finally!! Thank you so much! Well, I think asking is the best solution.
r2 U2 r U r2 U' r U r U' r2 U r' U' r2 U2 r2 -Uperm
U2 r U r' U' r' U' r U r U' r' U' r' U r U' -Antisune


----------



## AvGalen (Sep 15, 2014)

qqwref said:


> ksolve+ *is* for Windows. There's a Linux version too but obviously if you are on Windows you shouldn't use that one. The thing is, there's no GUI, so you can't just click around on a window to set stuff up. Writing a GUI is tricky and can take a lot of time, so you can imagine why I didn't feel like doing it. If someone wants to give it a shot, go ahead...


with Xksolve or WINksolve I meant that their should be a GUI. I personally love the commandline but it is rarer and rarer for a program to ONLY have a commandline. I think one of the reasons why Cube Explorer is used so much is because it DOES have a nice GUI.


----------



## Robert-Y (Sep 15, 2014)

Are you sure you are in the right directory?


----------



## IQubic (Oct 16, 2014)

How the heck do you write a definition file? How do I tell the program which piece on my puzzle is piece 1 in the code? I tried to follow someone's move, but we numbered the pieces differently. Therefore I got a different result than him.

-IQubic



Ranzha V. Emodrach said:


> Fixed Corner Notation, WCA-style:
> 
> ```
> # Skewb ksolve+ definition file (tested on v1.3 from http://mzrg.com/rubik/ksolve+/)
> ...





Kirjava said:


> Aww yea, I knew this would come in handy
> 
> 
> ```
> ...



How the heck do these both work??? It's the same exact moves written two different ways. The Def files are different. Not the Same. How does this work???


----------



## blade740 (Oct 17, 2014)

IQubic said:


> How the heck do you write a definition file? How do I tell the program which piece on my puzzle is piece 1 in the code? I tried to follow someone's move, but we numbered the pieces differently. Therefore I got a different result than him.
> 
> -IQubic



The software doesn't know or care which piece is where. Make up a numbering scheme when you define the pieces, then just stick to that numbering scheme when you define the moves.


----------



## IQubic (Oct 18, 2014)

I can't get the program to do God's algorithm. I just can't.
EDIT: I only get this issue when trying to use a Skewb Def file I created. 


```
Name Skewb

# IQubic made this
# CENTERS U F R B L D
# CORNERS ULB URB URF ULF DLB DRB DRF DLF
# CO is how many clockwise turns to orient correctly

Set CENTERS 6 1
Set CORNERS 8 3

Solved
CENTERS
1 2 3 4 5 6
CORNERS
1 2 3 4 5 6 7 8
End

Move F
CENTERS
1 3 6 4 5 2
CORNERS
1 2 6 4 5 8 7 3
0 0 1 0 0 1 2 1
End

Move R
CENTERS
1 2 4 6 5 3
CORNERS
1 5 3 4 7 6 2 8
0 1 0 0 1 2 1 0
End

Move B
CENTERS
1 2 3 5 6 4
CORNERS
8 2 3 4 5 1 7 6
1 0 0 0 2 1 0 1
End

Move L 
CENTERS
1 6 3 4 2 5
CORNERS
1 2 3 7 4 6 5 8
0 0 0 1 1 0 1 2
End
```

EDIT 2: I can NOT get Ksolve+ to use my custom Skewb definition. It does not matter what I put a the scramble.


----------



## Jakube (Oct 22, 2014)

IQubic said:


> I can't get the program to do God's algorithm. I just can't.
> 
> 
> Spoiler
> ...



Please describe more precisely what you want and what you tried. Is there any error messages?

I took your def file and it works on my laptop. I can calculate God's algorithm, solve random states, ...


edit: I played a little bit more with the def file. The computation of God's algorithm produces other numbers than the numbers of http://www.jaapsch.net/puzzles/skewb.htm. At least for depth > 5. Strange, I checked the moves definitions and they seem to be correct. (I think you mixed U with U', F with F', and so on, but it should work nevertheless). I'm confused.


----------



## qqwref (Oct 22, 2014)

That's very odd. Do other Skewb def files give your numbers, or Jaap's numbers, or something entirely different?


----------



## Robert-Y (Oct 22, 2014)

I might have figured it out. Create a scramble file that is equivalent to the scramble "y2". Because this is not defined as solved state, ksolve will attempt to do moves in order to achieve an effect equivalent to y2.

Which leads to this question: Does this problem occur anyway with a fixed corner notation def file? I should hope not.


----------



## Ranzha (Oct 22, 2014)

Robert-Y said:


> I might have figured it out. Create a scramble file that is equivalent to the scramble "y2". Because this is not defined as solved state, ksolve will attempt to do moves in order to achieve an effect equivalent to y2.
> 
> Which leads to this question: Does this problem occur anyway with a fixed corner notation def file? I should hope not.



This is what I was going to say.
Some 12-move antipodes are the equivalent to y2. Because of this, for generating God's Algorithm tables, FCN is the way to go.


----------



## qqwref (Oct 22, 2014)

Oh, yeah, good point there Robert. Ksolve+ doesn't use our concept of a rotation, it just checks to see what is generated by the moves you defined. So if the same position can show up in more than one orientation, they will both be in the God's Algorithm table. IQubic fixed the U center, but each center has 2 orientations, so each position could show up in 2 ways.

It's surprising that y2 takes 12 moves, though. I would've expected a shorter sequence.


----------



## IQubic (Oct 22, 2014)

That is the error I get. This error occurs with any scramble.
In the future I will be generating speedsolving alg with this.


----------



## cubizh (Oct 22, 2014)

IQubic said:


> View attachment 4644
> That is the error I get. This error occurs with any scramble.
> In the future I will be generating speedsolving alg with this.


You are using an outdated version of ksolve+ then.
If you read back a couple of pages on this thread, that is a common error derived from a bug in the code and there's a simple way to fix it.
If you can't change code yourself, just make sure there's no empty lines on the scramble and definition file.
Depending on what code you used, you should ask its maintainer to fix this silly issue, or just fix it yourself and recompile.


----------



## IQubic (Oct 23, 2014)

I fixed the code, but still get this error. I also removed the empty lines at the end. I still get the error.


----------



## cubizh (Oct 23, 2014)

Did you compile the changes?
Try using the online version instead then.


----------



## IQubic (Oct 23, 2014)

How does one compile the code? The online version does not work for me. The big go button does nothing for me.


----------



## mark49152 (Nov 24, 2014)

IQubic said:


> View attachment 4644
> That is the error I get.


I get the same error using the Windows binary from github. It also reports its version as 1.0 not 1.3. COuld someone who has already rebuilt it please update the binary? It would save me the effort of installing whatever I would need to recompile it myself. Thanks!


----------



## mark49152 (Nov 25, 2014)

Double post, because I have another question. I am trying to use ksolve+ as an F2L solver. I have added the following to the standard 3x3 defs file:-


```
Ignore
CORNERS
1 1 1 1 0 0 0 0
1 1 1 1 0 0 0 0
EDGES
1 1 1 1 0 0 0 0 0 0 0 0
1 1 1 1 0 0 0 0 0 0 0 0
End
```

When I give it a scramble R U R' U', I would expect the solutions to include R' F R F', U2 R U2 R', etc., but that's not the case. It only gives solutions that fully solve the cube. It appears my "ignore" is being ignored. Can anyone help?

I am using the Javascript version at http://www.cubing.net/ksolve.js/ since I cannot get the Windows .exe to work.


----------



## Jakube (Nov 25, 2014)

ad windows version: Have you tried downloading the zip (containing an exe) from qqref's original post. This version works fine on my laptop (Win 7).

ad F2L-Solver: In the scramble you have to ignore the last layer pieces with a ?. E.G. if your scramble is 1 3 7 9 2 6 ... and you want to ignore the last layer, write ? ? 7 9 ? 6 ...

In the definition file you're only specifying the pieces, which may be ignored. To really ignore them, write ?s.


----------



## mark49152 (Nov 26, 2014)

Jakube said:


> ad windows version: Have you tried downloading the zip (containing an exe) from qqref's original post. This version works fine on my laptop (Win 7).


Thanks for the help. I think that and the github .exe are the same version, as the byte count is identical. Anyway, I found the problem - the advice to not include blank lines at the end means don't append a return to the final "End" either. I should have caught that earlier, must have been half asleep.

Also the 3x3x3.def file on both github and qqwref's site isn't Windows-friendly and needs CRs added before it will work.



Jakube said:


> ad F2L-Solver: In the scramble you have to ignore the last layer pieces with a ?. E.G. if your scramble is 1 3 7 9 2 6 ... and you want to ignore the last layer, write ? ? 7 9 ? 6 ... In the definition file you're only specifying the pieces, which may be ignored. To really ignore them, write ?s.


Yeah I should have read the whole thread, and the (excellent) readme.txt in more detail  However, I still can't get it working. When the pieces are replaced with '?' it fails to find any solution, even U R U' R'. If I include hints then it does find some solutions, but not all of them - only those that also leave solved pieces at URF/UR where the F2L pair started. See below for scramble file and output.



Spoiler



Scramble file:-

```
Scramble Piece configuration as reported by ScrambleAlg R U R' U'
CORNERS
5 2 4 3 1 6 7 8
2 0 0 2 2 0 0 0
EDGES
1 2 4 5 3 6 7 8 9 10 11 12
0 0 0 1 1 0 0 0 0 0 0 0
End

Scramble U layer pieces replaced with ?
CORNERS
5 ? ? ? ? 6 7 8
2 ? ? ? ? 0 0 0
EDGES
? ? ? 5 ? 6 7 8 9 10 11 12
? ? ? 1 ? 0 0 0 0 0 0 0
End

Scramble U layer pieces with ? prepended
CORNERS
5 ?2 ?4 ?3 ?1 6 7 8
2 ?0 ?0 ?2 ?2 0 0 0
EDGES
?1 ?2 ?4 5 ?3 6 7 8 9 10 11 12
?0 ?0 ?0 1 ?1 0 0 0 0 0 0 0
End
```

And the output:-

```
Solving "Piece configuration as reported by ScrambleAlg R U R' U'"
Depth 0
Depth 1
Depth 2
Depth 3
Depth 4
  U R U' R'
Depth 5
Depth 6
Depth 7
Depth 8
  U F' U2 L' U' L F U2
  R2 B' D' R D R2 B R'

Max depth reached, aborting.


Solving "U layer pieces replaced with ?"
Depth 0
Depth 1
Depth 2
Depth 3
Depth 4
Depth 5
Depth 6
Depth 7
Depth 8

Max depth reached, aborting.


Solving "U layer pieces with ? prepended"
Depth 0
Depth 1
Depth 2
Depth 3
Depth 4
  U R U' R'
Depth 5
Depth 6
  L' U R U' L R'
Depth 7
  U F' L' U' L F U
Depth 8
  U F' U L' U2 L U F
  U F' U2 F R U' R' U'
  U F' U2 L' U' L F U2
  U B' R U' R2 U R B
  U B' R U' R' U B U'
  R2 B' D' R D R2 B R'

Max depth reached, aborting.
```


----------



## qqwref (Nov 26, 2014)

I'm not completely sure, but I think you want to do it like this:

```
Scramble U layer pieces with ? prepended
CORNERS
?5 ?2 ?4 ?3 1 6 7 8
?2 ?0 ?0 ?2 2 0 0 0
EDGES
?1 ?2 ?4 ?5 3 6 7 8 9 10 11 12
?0 ?0 ?0 ?1 1 0 0 0 0 0 0 0
End
```


----------



## mark49152 (Nov 26, 2014)

qqwref said:


> I'm not completely sure, but I think you want to do it like this:


Yeah, that works, great, thanks! So the ?s apply to the positions not the cubies initially in them. Doesn't that mean only the hint notation will work? I have to tell it where the F2L pair pieces are although they occupy positions that will be ignored.

Is this the best way to implement an F2L solver? Looking at the 3-colour cube (with repeating piece types) I'm wondering if it would be more efficient to change the def file to have 4 identical corners and 4 identical edges in the U layer. However, could I ignore orientations of those pieces without having to still include the ?s in the scrambles?


----------



## Robert-Y (Nov 26, 2014)

I think you could go further than that and define a 3x3x3 in such a way so that it allows 4 (wanted) solved states.

1. Let the bottom (D) edges be the same
2. Let the bottom (D) corners be the same
3. Let the middle (E slice) edges be the same
4. Omit centres in the definition.

Example:

# CORNERS URF, ULF, ULB, URB, DRF, DLF, DLB, DRB
# EDGES UF UL UB UR FR FL BL BR DF DL DB DR

Set CORNERS 8 3
Set EDGES 12 2

Solved
CORNERS
1 1 1 1 2 2 2 2
EDGES
1 1 1 1 2 2 2 2 3 3 3 3
End

<Define moves>

Ignore
CORNERS
1 1 1 1 0 0 0 0
1 1 1 1 0 0 0 0
EDGES
1 1 1 1 0 0 0 0 0 0 0 0
1 1 1 1 0 0 0 0 0 0 0 0
End

Obviously I haven't defined any moves but if you define the solved state in this way, then solutions containing y,y',y2 will work without the need of "undoing" the rotation from the algorithm.

Also there are "dangers" with this. Perhaps this is not recommended for multislotting cases but hopefully valid yet unwanted algorithms are rare and use more moves...


----------



## mark49152 (Nov 26, 2014)

Robert-Y said:


> I think you could go further than that and define a 3x3x3 in such a way so that it allows 4 (wanted) solved states.
> 
> 1. Let the bottom (D) edges be the same
> 2. Let the bottom (D) corners be the same
> 3. Let the middle (E slice) edges be the same


I haven't tried it yet, but wouldn't that allow pieces in each group to be interchanged? I would expect solutions to preserve the rest of F2L. Also, how would I identify the pieces of the pair I want to solve?


----------



## Robert-Y (Nov 26, 2014)

Yes you are right, this is what I was talking about when I mentioned the "dangers" of defining such a solved state. But if you only have one more pair to solve, then I would imagine that it wouldn't be much of a problem. As for your second question, you would just set up the case as you normally would? I don't see any issues there...


----------



## mark49152 (Nov 26, 2014)

Robert-Y said:


> As for your second question, you would just set up the case as you normally would? I don't see any issues there...


In the scramble I would need to specifically identify the pieces of the pair to be solved. So the sets would have to be something like:-

Solved
CORNERS
1 1 1 1 *3* 2 2 2
EDGES
1 1 1 1 *4* 2 2 2 3 3 3 3
End

This is great software and I'm anticipating hours of fun messing around with it, so many thanks to qqwref and all the contributors! 

I'm not keen on the "ignore" feature though. Given that the question marks denote ignored positions rather than ignored pieces, it means that in the scramble I have to identify pieces which will eventually end up in ignored positions - for example, the corner and edge initially in my target F2L slot. That seems redundant. Also, although the format "?5" is described by the readme as a "hint", it's not. It appears to signify that piece 5 is initially in this position, but we don't care what ends up in this position when solved.

This is based on the assumption that the sets are a sequence of positions giving the numbers of the held pieces, rather than a sequence of pieces giving the number of their positions. I'm not 100% sure that assumption is correct because the readme states that "the 2 in the first spot means that piece number 1 is in [position] 2". However, in practice it appears to be the other way around, so "the 2 in the first spot means that position 1 holds piece number 2". This is evident from the scramble generated for R U R' U' where the edges are cycled such that piece UR is in position UB - note that in the scramble, position 3 (UB) holds piece 4 (UR), not vice-versa.

# EDGES UF UL *UB UR* FR FL BL BR DF DL DB DR
...
EDGES
1 2 *4* 5 3 6 7 8 9 10 11 12

A simpler way to present the "ignore" feature would be to always ignore the pieces/positions as configured in the defs file, and use ? in the scramble to indicate where the ignored pieces are initially.


----------



## Robert-Y (Nov 26, 2014)

mark49152 said:


> In the scramble I would need to specifically identify the pieces of the pair to be solved. So the sets would have to be something like:-
> 
> Solved
> CORNERS
> ...



No you don't?... Like I said before as long you are only solving one pair and all of the other pairs are solved then most of the solutions that are found should work. I'm aware that this can go wrong but I can't see it going completely wrong in this case? I doubt you would have to keep trying many algs until you get one that works.

EDIT: No harm in trying it out. In fact I don't mind trying it out if you have any requests in mind.


----------



## mark49152 (Nov 27, 2014)

Robert-Y said:


> No you don't?


Yes I see what you mean now. That's a neat idea, although I'm not sure what the advantage would be compared to not making the F2L pieces interchangeable. There would have to be a very clear performance advantage to make it worth weeding out all the wrong solutions. Anyhow, I am including multi-slotting cases so it wouldn't work for me.

I do now have ksolve working nicely, solving a big list of cases generated using Perl.

Is there a way to request larger pruning tables, without rebuilding? It's fast up to depth 9, just a minute or two for depth 10, then depth 11 takes ages. Ideally I wanted to search up to 13 but that looks like a non-starter for ~300 cases with my PC resources.


----------



## Robert-Y (Dec 10, 2014)

Lucas Garron said:


> So, compiling to JS was easy: http://www.cubing.net/ksolve.js/
> 
> Unfortunately, memory usage blows up in the browser (I quickly hit 600MB on the 3x3x3 RFU example).


www.cubing.net/ksolve.js/low-memory/

Thanks Lucas


----------



## unsolved (Dec 11, 2014)

*4x4x4 version of ksolve?*

Does anyone have a pre-built settings file for the 4x4x4 Revenge cube?


----------



## Jakube (Dec 11, 2014)

Here's a def file for 4x4x4 centers. http://mzrg.com/rubik/ksolve+/ You can merge it with one of the 3x3x3 corner files, then you only have to write the edge part.


----------



## unsolved (Dec 12, 2014)

Jakube said:


> Here's a def file for 4x4x4 centers. http://mzrg.com/rubik/ksolve+/ You can merge it with one of the 3x3x3 corner files, then you only have to write the edge part.



That sounds like too much work for me. I'll just write my own 4x4x4 solver program. Oh, wait, I already did that, so how about I trade you a free copy of the latest version of it for a ready-to-go version of ksolve so I can compare solving times?


----------



## Robert-Y (Jan 14, 2015)

This is slightly off topic but I have created a facebook group called "Algorithm searchers" https://www.facebook.com/groups/361282697377249/

If you are having trouble getting ksolve to work or you would like some advice/tips, don't be afraid to join


----------



## Ross The Boss (Jan 30, 2015)

*Issues Using Ksolve*

Yes, I thought that I had finally figured out this app, but now I am not so sure. The cube I'm attempting to define is a 3x3x3 which can only have RrFUM turns applied to it, and the unsolved state for which solutions are to be generated is an F1 CMLL(T, no swaps) with the UF and UB edges flipped. Since I'm trying to generate Roux algorithms, edge permutation can be ignored; the orientation is all that matters. 
So I wrote these two things into a .def and a .txt file and they all seem to check out nicely... except for the fact that it takes _forever_ to get nothing done. I left my computer running over night -a relatively good computer, mind you- and upon checking in the morning it had only searched down to a depth of 14, yielding no results. I can tell that this is a load of BS as my two other algs for this case are only 13 moves in length. WHAT AM I DOING WRONG D:?????



Spoiler: .def (cube definition)



Name 3X3X3_RUFM

# CORNERS URF ULF ULB URB DRF DLF DRB
# EDGES UF UL UB UR FR FL BL BR DF DL DB DR

Set CORNERS 7 3
Set EDGES 12 2

Solved
CORNERS
1 2 3 4 5 6 7
EDGES
1 2 3 4 5 6 7 8 9 10 11 12 
End

Move M
CORNERS
1 2 3 4 5 6 7
EDGES
3 2 11 4 5 6 7 8 1 10 9 12
End

Move U
CORNERS
4 1 2 3 5 6 7
EDGES
4 1 2 3 5 6 7 8 9 10 11 12
End

Move R
CORNERS
5 2 3 1 7 6 4
1 0 0 2 2 0 1
EDGES
1 2 3 5 9 6 4 8 7 10 11 12
0 0 0 1 1 0 1 0 1 0 0 0
End

Move r
CORNERS
5 2 3 1 7 6 4
1 0 0 2 2 0 1
EDGES
9 2 1 5 12 6 7 4 11 10 3 8
1 0 1 1 1 0 0 1 1 0 1 1
End

Move F
CORNERS
2 6 3 4 1 5 7
2 1 0 0 1 2 0
EDGES
6 2 3 4 1 8 7 5 9 10 11 12
End

Ignore
EDGES
1 1 1 1 0 0 0 0 1 0 1 0
1 1 1 1 0 0 0 0 1 0 1 0
End





Spoiler: .txt (scramble file)



Slack 3
Scramble UF+UB 
CORNERS
1 2 3 4 5 6 7
0 0 2 1 0 0 0
EDGES
? ? ? ? 5 6 7 8 ? 10 ? 12
1 0 1 0 0 0 0 0 0 0 0 0
End



As you see , no definition for the center pieces have been given. This is because I do not want my results limited to algs that will preserve yellow on bottom or any of that Roux-irrelevant stuff. This ofcourse leaves me open to results where all edges are oriented relative to U/D corners, but the center pieces are off by an M. Robert Yau, i think it was, said that this could be dealt with by defining the solved state of the centers as "1 2 1 2", but this did not work for me. Any suggestions?


----------



## mark49152 (Jan 30, 2015)

In my experience, using IGNORE slows down ksolve tremendously, so ignore as few pieces as possible.


----------



## Ross The Boss (Jan 30, 2015)

mark49152 said:


> In my experience, using IGNORE slows down ksolve tremendously, so ignore as few pieces as possible.



ahh, that's unfortunate. Is there any way that i could make M/U edge permutation irrelevant without using the Ignore command? Like some solve state trickery maybe?


----------



## kcl (Jan 30, 2015)

Ross The Boss said:


> ahh, that's unfortunate. Is there any way that i could make M/U edge permutation irrelevant without using the Ignore command? Like some solve state trickery maybe?



You could maybe define them as permuted? Just always do 1 2 3 4 5 6 7 8 9 10 11 12 for permutation and define orientation as normal.


----------



## Ross The Boss (Jan 30, 2015)

kclejeune said:


> You could maybe define them as permuted? Just always do 1 2 3 4 5 6 7 8 9 10 11 12 for permutation and define orientation as normal.



define them as permuted where? the solve state command? but then wont ksolve only generate solutions that solve the cube fully? that would defeat the purpose of generating roux optimal algs.


----------



## Robert-Y (Jan 30, 2015)

Many things need correcting 

1. You need to give an edge orientation vector for the moves M and F.
2. UF=UB=UR=UL=DF=DB right? So you probably want the solved state for edges to be something like:

1 1 1 1 5 6 7 8 1 10 1 12

or

1 1 1 1 2 3 4 5 1 6 1 7 (whichever seems more sensible)

3. The length of scramble orientation and permutation vectors need to match the solved state. I think maybe you know this, but you just provided the wrong scramble file?


----------



## Ross The Boss (Jan 30, 2015)

yes, that is the incorrect file


----------



## qqwref (Jan 30, 2015)

I'm not sure exactly what's going on here, but if you aren't generating the 13-move algs there must be something wrong with either your move definitions or your scramble. I notice that both U and M don't change orientations of edges, but other than that, I dunno what's wrong. Have you tried applying some alg scrambles and seeing if the results make sense?


----------



## Puggins (Feb 10, 2015)

My exe file is broken. It pops up with a small console then goes away


----------



## kentaro24 (Apr 4, 2015)

I wrote a definition file for Gear Shift.

```
Name Gear Shift

# def-file by Kentaro Nishi
# BIGCORNERS: UBR UFL DFR DBL 
# SMALLCORNERS: UBL UFR DFL DBR
# Move "U" indicates pull U-face and turn small corners in U-face clockwise 72 degrees.
# Move "A" indicates turn all small corners clockwise 72 degrees.

Set BIGCORNERS 4 8
Set SMALLCORNERS 4 5

Solved
BIGCORNERS
1 2 3 4
0 0 0 0
SMALLCORNERS
1 2 3 4
0 0 0 0
End

Move U
BIGCORNERS
1 2 3 4
7 7 0 0
SMALLCORNERS
1 2 3 4
1 1 0 0
End

Move D
BIGCORNERS
1 2 3 4
0 0 7 7
SMALLCORNERS
1 2 3 4
0 0 1 1
End

Move F
BIGCORNERS
1 2 3 4
0 7 7 0
SMALLCORNERS
1 2 3 4
0 1 1 0
End

Move B
BIGCORNERS
1 2 3 4
7 0 0 7
SMALLCORNERS
1 2 3 4
1 0 0 1
End

Move R
BIGCORNERS
1 2 3 4
7 0 7 0
SMALLCORNERS
1 2 3 4
0 1 0 1
End

Move L
BIGCORNERS
1 2 3 4
0 1 0 1
SMALLCORNERS
1 2 3 4
1 0 1 0
End

Move A
BIGCORNERS
1 2 3 4
7 7 7 7
SMALLCORNERS
1 2 3 4
1 1 1 1
End
```


----------



## psi (May 6, 2015)

Quick question: is it possible to model Crazy 3x3 plus cubes in ksolve with the help of "block" command ?
That is meant for external bandaging but crazy cubes have internal bandaging depending on type of center 0 or 1.
Any ideas?
Crazy-3x3-Plus-Cube-Series
How_to_Solve_the_Crazy_3x3_Plus_Cube


----------



## Robert-Y (May 6, 2015)

iirc blocking is limited to 8 blocks (qqwref: can you confirm?).

I think even if it can handle all the blocking, it wont be able to search for long and useful algorithms because there are so many pieces to define. If you're interested in algorithms with minimal effects e.g. swapping two centres then ksolve might be able to handle it fast, depending on the move restriction e.g. <RUF>


----------



## qqwref (May 6, 2015)

I'm not sure about a limit on the number of bandaged pieces - I just remember a limit on the number of pieces of a given type you can ignore at once.

For Crazy 3x3 Plus cubes, though, bandaging pieces is not really what you want, because it's meant for specifying that a group of pieces can only be moved together as a group. All you have to do is, when you define the 6 moves, specify exactly what they each do to the corner-center and edge-center pieces - some of the moves will do two 4-cycles and some will do four.


----------



## psi (May 6, 2015)

qqwref said:


> I'm not sure about a limit on the number of bandaged pieces - I just remember a limit on the number of pieces of a given type you can ignore at once.
> 
> For Crazy 3x3 Plus cubes, though, bandaging pieces is not really what you want, because it's meant for specifying that a group of pieces can only be moved together as a group. All you have to do is, when you define the 6 moves, specify exactly what they each do to the corner-center and edge-center pieces - some of the moves will do two 4-cycles and some will do four.



Ok, I guess this could work for face turns which do not move centers. But I still don't see how I could model a slice turn like M which, for example, changes U center which could then change effect of the next U move (if U center switches from 0 to 1).


----------



## qqwref (May 7, 2015)

Yeah, trying to model slices wouldn't really be possible because of the changing effects of a given move. ksolve expects every move to do a specific thing, and the bandaging really only restricts what moves are possible - it wouldn't allow a given turn to have different effects based on the bandaged state. I suppose you could define some kind of invisible pieces, which would be bandaged together, so that for instance only one of U (turns center) or u (doesn't turn center) is possible at once... but then you'd have two types of each turn and potentially four types of each slice turn, and that would be pretty ugly.

If you are really interested in finding algorithms with slice moves, I'd suggest adding some extra slack (allowing the program to find longer solutions) and then seeing if any of the longer-than-optimal algs have moves like R L' in them.


----------



## psi (May 7, 2015)

qqwref said:


> If you are really interested in finding algorithms with slice moves, I'd suggest adding some extra slack (allowing the program to find longer solutions) and then seeing if any of the longer-than-optimal algs have moves like R L' in them.



Nice, I think a further step with this idea, to force only slice turns, would be to define the move "RL' " in place of R and L. This move would do both turns even though this has the limit that the next U turn would be instead B. Also this would allow only one of the three slices.
Rotations are not possible (moves x,y,z) for the same reason that they switch centers.
Anyway thanks.


----------



## bilde (Oct 20, 2015)

Robert-Y said:


> This is slightly off topic but I have created a facebook group called "Algorithm searchers" https://www.facebook.com/groups/361282697377249/
> 
> If you are having trouble getting ksolve to work or you would like some advice/tips, don't be afraid to join



Hello,

I was wondering if this group is still active? I requested to join it but I'm pretty sure my request was declined :/


----------



## Robert-Y (Oct 20, 2015)

Hiya, I'm sorry I probably declined your request because I was getting a few requests from "random" people. I don't want to let in people who are simply lurking. I would like people to contribute to discussions and/or learn how to search for algorithms. But please request to join again and I'll accept it


----------



## DELToS (Oct 21, 2015)

How do I open the .rar file on my mac? Also I didn't see it on your website


----------



## bilde (Nov 17, 2015)

Hello,

I've been wanting to solve only the corner permutation and leaving only the left "ZZ block" intact (such as the algorithms described in this thread: https://www.speedsolving.com/forum/showthread.php?43236-New-Approach-to-ZZ-d).

I've tried using CubeExplorer for this, and also ksolve+ (ignoring orientation but not permutation), with no luck - I can get algs that permute the corners, but this also makes it so that the corners are in their actual places, while I want the pieces to be scrambled, so that I have a 2gen-scramble.

I figured ksolve+ is probably the tool that most likely can achieve this, but I've had no luck. Is ksolve+ not the right tool for this, or is my approach wrong / do I need to do some other definition file wizardry?


----------



## Lucas Garron (Nov 17, 2015)

bilde said:


> Hello,
> 
> I've been wanting to solve only the corner permutation and leaving only the left "ZZ block" intact (such as the algorithms described in this thread: https://www.speedsolving.com/forum/showthread.php?43236-New-Approach-to-ZZ-d).
> 
> ...



Try ACube for easier ways to ignore orientation and permutation separately on 3x3x3.


----------



## supercavitation (Nov 18, 2015)

Does anyone have a full Square-1 def file (i.e. one that can leave cube shape)? I'm not 100% sure it's possible, but if it is, it would be incredibly useful.


----------



## bilde (Nov 18, 2015)

Lucas Garron said:


> Try ACube for easier ways to ignore orientation and permutation separately on 3x3x3.



Hello, and thanks for the reply!

I've tried ACube aswell, but with no luck. I don't think I explained what I want clearly enough in my first post.



> R U R' F' R U R' U' R' F R2 U' R' L' U' L U2 // setup
> // Input to ACube: (UR UB) (FL UL) (UBR ULF) (DLF ULF) ULB? ULF+ DLF? UFR? UBR? DFR? DBR? [UR UF UL UB FR BR DR]
> ACube solution: U' R U' L' U L R'



However, I want a solution like this one:



> R2 U2 L' U L



I don't know if any program is able to permute corners in this way, and I can't get it to work with ACube either. :-(


----------



## blade740 (Nov 19, 2015)

supercavitation said:


> Does anyone have a full Square-1 def file (i.e. one that can leave cube shape)? I'm not 100% sure it's possible, but if it is, it would be incredibly useful.



I gave it to supercavitation in IRC, but in case anyone else is interested:


```
Name sq1full
 
# def-file by Andrew Nelson
 
# pieces are: UFL UFLx UL UBL UBLx UB UBR UBRx UR UFR UFRx DFL DFLx DL DBL DBLx DB DBR DBRx DR DFR DFRx
# x pieces are bandaged
 
 
Set EDGES 24 1
 
Solved
EDGES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End
 
Move U
EDGES
12 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End
 
Move D
EDGES
1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 13
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End
 
Move R
EDGES
1 2 3 4 5 6 24 23 22 21 20 19 13 14 15 16 17 18 12 11 10 9 8 7
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End
 
Block
EDGES
1 2
End
 
Block
EDGES
4 5
End
 
Block
EDGES
7 8
End
 
Block
EDGES
10 11
End
 
Block
EDGES
13 14
End
 
Block
EDGES
16 17
End
 
Block
EDGES
19 20
End
 
Block
EDGES
22 23
End
```


----------



## ch_ts (Nov 19, 2015)

Hi Bilde!
I threw together a solver that will do what you want. I am not totally familiar with zz-d, but I think this may be correct. Please check the following sample scrambles and solutions to see if this is what you need.

R1U1R3F3R1U1R3U3R3F1R2U3R3L3U3L1U2
R2U1L3U2L1

L3U1L1R2U1F1B3R2F3B1U1R2U1
U1R2U3R1L3U1L1

L3U2L1F1B3R2F3B1U1
R1U3L3U2R1U3R2U3L1

L3U1L1R2U1F1B3R2F3B1U1R2U1
U1R2U3R1L3U1L1

Sorry about the notation if it's inconvenient, I threw the solver together quickly. Hope it is useful for you!


----------



## bilde (Nov 19, 2015)

@ch_ts:

This is exactly what I wanted, so really, thank you very much for taking the time to put this together for me! I really appreciate it. It would be nice to have the solver return non-optimal solutions too, however the solver already seems to already generate decent algorithms, as the ones I want are really just short RUL algorithms. Though now that you've shown me this, I'm really curious as to how you implemented this. Would you mind sharing the source code? I'm totally fine with you not wanting to either, I already appreciate this tons.

Thanks again!

Edit: My apologies to the moderators if this is getting a little off topic from ksolve+.


----------



## Renox (Dec 18, 2015)

Tried running ksolve+, but it didn't work? A window pops up very briefly, but nothing happens after that.


----------



## Berkmann18 (Jan 2, 2016)

Renox said:


> Tried running ksolve+, but it didn't work? A window pops up very briefly, but nothing happens after that.



Because ksolve is a command line program hence you can only use it when calling it from a terminal/command prompt using the synthax as described in the readme.txt.


----------



## JustinTimeCuber (Aug 9, 2016)

Me when trying to write a .def file:

mind = blown

but seriously can someone explain to me how to define orientation in non-trivial cases? 3x3 edges I sorta get, but for instance megaminx corners and edges. How do you define orientation?


----------



## IQubic (Aug 10, 2016)

Does this program run on Linux?


----------



## YTCuber (Aug 10, 2016)

@IQubic:
You can run the file ksolve-master/html/simple-async.html after downloading from github, which is a browser version. Or try wine, a implementation of Windows on Unix.


----------



## AlphaSheep (Aug 10, 2016)

JustinTimeCuber said:


> Me when trying to write a .def file:
> 
> mind = blown
> 
> but seriously can someone explain to me how to define orientation in non-trivial cases? 3x3 edges I sorta get, but for instance megaminx corners and edges. How do you define orientation?



It took me a lot of sitting with my megaminx with a lot of confused turning to figure out. I'll try explain in a way that made sense to me.

For faces other than U or D, you can observe that the effect of a a single one fifth turn on the two corners in the U/D layer is the same as a quarter turn on a 3x3. Since the inverse of a turn must undo the effect, we can say the same for the two corners brought into U/D by that turn. That leaves the one corner on the "equator zig-zag" (don't know what else to call it) as an unknown. Since the total corner twist on the entire puzzle must be a multiple of 3, you can work out that the orientation of the last corner can't be changed with a single fifth turn.

With edge orientation, it's a little trickier. A face turn must flip an even number of edges, but since there are 5 edges per face, at least one edge must keep it's orientation. On a 3x3 orientation is specified relative to an axis that is defined by the line passing through the F and B centres. On a megaminx, you can define a similar axis that doesn't pass through centres, but passes through two corners. It's easiest to explain with colours, I think. Assuming you have a megaminx with the default colour scheme, and hold white on top, green on front. Then the axis for orientation goes from the front-most corner (green-turquoise-pale yellow) to the back-most corner (blue-yellow-light green). Then the following rules for figuring out edge orientation apply:

Turning a face that does not contain the axis corner does not affect edge orientation.
Turning a face that contains an axis corner flips 4 edges. The edge that is not flipped is the edge that is between the corner that moves out of the axis position and the corner that moves into the axis position. Or, the edge that stays on the equator zig-zag does not change orientation.


----------



## xyzzy (Aug 10, 2016)

AlphaSheep said:


> Then the axis for orientation goes from the front-most corner (green-turquoise-pale yellow) to the back-most corner (blue-yellow-light green). Then the following rules for figuring out edge orientation apply:
> 
> Turning a face that does not contain the axis corner does not affect edge orientation.
> Turning a face that contains an axis corner flips 4 edges. The edge that is not flipped is the edge that is between the corner that moves out of the axis position and the corner that moves into the axis position. Or, the edge that stays on the equator zig-zag does not change orientation.



I don't think this leads to a consistent definition of EO for all 12 face turns. Let's say we set up our megaminx with DFL DFR' DFL' DFR2 F' DFR' F and ignore the corners. This is a 3-cycle of edges around the frontmost corner. If we perform an F move, then the F-DFR edge moves to the F-DFL position and is flipped, so the F-DFR edge must originally have been misoriented since it stays on the equatorial zig-zag. By symmetry, this also applies to the DFR and DFL moves, which means that all three edges in this 3-cycle are flipped, but that violates EO parity.

More to the point, Cube Explorer's site shows a way of defining orientation that is guaranteed to be consistent.


----------



## AlphaSheep (Aug 11, 2016)

xyzzy said:


> I don't think this leads to a consistent definition of EO for all 12 face turns


Looking at it again, you're right. I've came up with it about a year ago as part of an idea for an ZZ like approach to megaminx S2L (a terrible idea). Looking at it again now, I think I was on the wrong track trying to make it consistent with the common 3x3 definition of EO. Of course that doesn't matter at all for ksolve's purposes.

I know about the cube explorer's way of defining EO, but I just never thought of applying it to megaminx.


----------



## shadowslice e (Aug 11, 2016)

When I had a look at mega EO, I found that the only way get consistent EO is by using a ring of an even number of faces otherwise you can send an edge around the ring and you will get the edges the other way up.


----------



## ViliusRibinskas (Nov 13, 2016)

So I was trying to generate a 2x2x Leg-1 and it doesn't work I don't know why. I' using this: https://www.cubing.net/ksolve.js/ I used this scramble code or what its called: 
Scramble Leg-T4
CORNERS
1 2 3 4 5 7 6
0 0 1 1 1 1 1
End

ScrambleAlg Leg-T4
R' U' R U' F R2 F' R F R' F' D'
End

So why it doesn't work? Maybe the orientation vectors are wrong or something?


----------



## Robert-Y (Nov 13, 2016)

It cannot read scrambles with moves that have not been defined 

D moves have not been defined (yet). So you'll need to add the definition of a D move to the definition window.


----------



## ViliusRibinskas (Nov 21, 2016)

Oh, I was stupid. What is the command to launch ksolve? In notepad readme file two symbols are missing.


----------



## Robert-Y (Nov 21, 2016)

ksolve puzzle.def scramble.txt

Replace puzzle.def and scramble.txt with your definition and scramble file names.


----------



## Shiv3r (Mar 28, 2017)

Hey guys.
good Job with Ksolve! for people trying to gen algs for unconventional puzzles it is indispensable.


----------



## Filipe Teixeira (Mar 15, 2019)

Hey guys, I'm trying to generate megaminx last layer algs with ksolve but with no success.

These are my files:

DEF -> https://textuploader.com/15x4o
SCRAMBLES -> https://textuploader.com/15x44

When I run it just make tables and close, with no solves, which i'm finding super weird as the other files that came with ksolve+ worked as charm.

Can anyone help? I also want help to generate all pll and oll cases, if someone can help me with this it would be awesome.

I got plls download images from here and programmatically checking the colors to find permutation, but there are 147 images, so some plls are missing

Thanks guys


----------



## CubeBlazer (Jun 15, 2019)

I was trying out some of the example files, but after the pruning tables loaded, it couldn't load the scramble file. What am I doing wrong?


----------



## shadowslice e (Jun 15, 2019)

Could you provide a few screenshots/a video/expand on what you did a little more thoroughly?


----------



## CubeBlazer (Jun 15, 2019)

I switched to the directory ksolve was in then ran the program. It created the pruning tables but couldn't open the scramble file. I have a screenshot attached. 
Am I supposed to use Windows Powershell?


----------



## shadowslice e (Jun 16, 2019)

Well, the first thing to check is that your scramble file is actually called 2x2x2.txt and that it is in the same directory as the solver.

I'd also recommend you try using ksolve++ purely for the reason it's significantly faster than regular ksolve


----------



## CubeBlazer (Jun 16, 2019)

That's why. And I will try using Ksolve++. Is it similar to Ksolve?


----------



## CubeBlazer (Jun 19, 2019)

I have been running Ksolve++ for about 30 minutes and the complete pruning tables are not finished yet. How long does it take for the pruning tables to generate?


----------



## CubeBlazer (Jun 19, 2019)

I answered my question. it took 2137 seconds(36 minutes) to generate edges and 226 seconds(4 minutes) to generate corners. So 40 minutes. At least it works.


----------



## N's-cvt (Apr 9, 2020)

So I am in https://cubing.net/ksolve.js/
and I would love to know how to turn the solutions into Quarter Turn Metric. the readme says to put the command in the scramble file so how should I exactly do that involving hyphons, spaces, and capitilazition?


----------



## ProStar (Apr 9, 2020)

N's-cvt said:


> So I am in https://cubing.net/ksolve.js/
> and I would love to know how to turn the solutions into Quarter Turn Metric. the readme says to put the command in the scramble file so how should I exactly do that involving hyphons, spaces, and capitilazition?



Why would you want it in QTM? The standard is HTM or sometimes STM, so it's probably best to just use that


----------



## sqAree (Apr 9, 2020)

ProStar said:


> Why would you want it in QTM? The standard is HTM or sometimes STM, so it's probably best to just use that


Because QTM does a better job at estimating how fast an algorithm might be.


----------



## N's-cvt (Apr 9, 2020)

Finally figured out how to use the QTM in the scramble file but now that I am learning more about this program and the vectors and stuff I wanted to make a RrU F perm with the RrU download from the Ksolve+ website.
Def file
Name 3x3x3 <R,r,U>

# def-file by Mitchell Stern
# Edges: UF UR UB UL DF DR DB FR BR
# Corners: UBL UBR UFR UFL DBR DFR
# Centers: U F D B

Set EDGES 9 2
Set CORNERS 6 3
Set CENTERS 4 1

Solved
EDGES
1 2 3 4 5 6 7 8 9
CORNERS
1 2 3 4 5 6
CENTERS
1 2 3 4
End

Move U
EDGES
2 3 4 1 5 6 7 8 9
CORNERS
4 1 2 3 5 6
CENTERS
1 2 3 4
End

Move R
EDGES
1 8 3 4 5 9 7 6 2
CORNERS
1 3 6 4 2 5
0 2 1 0 1 2
CENTERS
1 2 3 4
End

Move r
EDGES
5 8 1 4 7 9 3 6 2
1 0 1 0 1 0 1 0 0
CORNERS
1 3 6 4 2 5
0 2 1 0 1 2
CENTERS
2 3 4 1
End

And the scramble file I made
ScrambleAlg FPerm
Corners
1 2 4 3 5 6
0 0 0 0 0 0
Edges
3 2 1 4 5 6 7 8 9
0 0 0 0 0 0 0 0 0
End

Why does cmd say that "move corners in scramble FPerm is unknown"
Fixed by capitalization error.
Now however it states that "unknown set 1 in scramble Fperm"


----------



## shadowslice e (Apr 9, 2020)

N's-cvt said:


> Finally figured out how to use the QTM in the scramble file but now that I am learning more about this program and the vectors and stuff I wanted to make a RrU F perm with the RrU download from the Ksolve+ website.
> Def file
> Name 3x3x3 <R,r,U>
> 
> ...


Just thought it would be worth pointing out that ksolve++ exists and is more flexible and faster than ksolve+. The only real downside is that you need to install a compiler and recompile every time you make a new puzzle.


----------



## N's-cvt (Apr 9, 2020)

Alright So I think I know the basics of how to run this program for PLL's and I have been able to generate an RUF F-perm but one thing I don't get is this in the definition file determining moves...
Move R
CORNERS
5 2 3 1 7 6 4
1 0 0 2 2 0 1
Specifically the corner orientation because the corner permutation I get but what is the key for orientation?


----------



## ProStar (Apr 10, 2020)

N's-cvt said:


> Alright So I think I know the basics of how to run this program for PLL's and I have been able to generate an RUF F-perm but one thing I don't get is this in the definition file determining moves...
> Move R
> CORNERS
> 5 2 3 1 7 6 4
> ...



Why aren't you using ksolve++


----------



## N's-cvt (Apr 10, 2020)

Haha I finally switched and it's fun however I still don't understand orientation of pieces in the def file. And also, I can't figure out how to set certain move weights like it should work under this command:
MoveWeights
R QTM
End
But it says that "weight of move R <0> should be positive, Ignoring command"


----------



## N's-cvt (Apr 11, 2020)

Why doesn't 3x3x3 wide Rw moves work in ksolve++ ?
It keeps crashing the Ksolve++.exe


----------



## paul.edmondson.magician (Apr 17, 2020)

Just downloaded ksolve++ and when I click the exe file or flashes up briefly then does nothing. Anyone any ideas? Running Windows 10. Checked registry

Sent from my CLT-L09 using Tapatalk


----------



## shadowslice e (Apr 17, 2020)

Start up the command line and call the file from there.

EDIT: if you're just trying to start up the ksolve++.exercise file, that wont do anything as it needs a .def file as input: see the readme


----------



## paul.edmondson.magician (Apr 18, 2020)

shadowslice e said:


> Start up the command line and call the file from there.
> 
> EDIT: if you're just trying to start up the ksolve++.exercise file, that wont do anything as it needs a .def file as input: see the readme


I'm literally clicking on the exe file and it does nothing

Sent from my CLT-L09 using Tapatalk


----------



## brododragon (Apr 18, 2020)

paul.edmondson.magician said:


> I'm literally clicking on the exe file and it does nothing
> 
> Sent from my CLT-L09 using Tapatalk


He just said you need a .def file.


----------



## abunickabhi (May 11, 2020)

I am still to figure out how to use ksolve to generate 5style algs for 3x3. I use Cube Explorer for that. It is tough to setup cases of just 5 edges on the ksolve initial condition text file.


----------



## FakeMMAP (May 27, 2020)

Can anyone give me any detailed explanation on how the command "Ignore" works on ksolve++? I can't figure out if the ignored pieces are the pieces themselves or the positions.

In particular I'm working on skewb (with full rubikskewb notation  ) and I'm trying to generate short layers where DBL is solved and DFL is in DBR's place and oriented correctly (Layer on D).

Thanks in advance!


----------



## rcarvalho (Jun 12, 2021)

Trying to use KSOLVE+ for Square-1 using this definiton file 'sq1full.def':

Name sq1full

# def-file by Andrew Nelson

# pieces are: UFL UFLx UL UBL UBLx UB UBR UBRx UR UFR UFRx DFL DFLx DL DBL DBLx DB DBR DBRx DR DFR DFRx
# x pieces are bandaged

Set EDGES 24 1

Solved
EDGES
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End

Move U
EDGES
12 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 17 18 19 20 21 22 23 24
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End

Move D
EDGES
1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 13
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End

Move R
EDGES
1 2 3 4 5 6 24 23 22 21 20 19 13 14 15 16 17 18 12 11 10 9 8 7
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End

DisallowMoves
EDGES
1 2
EDGES
4 5
EDGES
7 8
EDGES
10 11
EDGES
13 14
EDGES
16 17
EDGES
19 20
EDGES
22 23
End

My scramble file is this:

ScrambleAlg MYALG
U2 / D2 / -U
End
MaxDepth 20
Slack 5

Program error is "Move / in scramble MYALG is unknown."

Can anyone please help?


----------



## xyzzy (Jun 13, 2021)

rcarvalho said:


> Program error is "Move / in scramble MYALG is unknown."


Use "R", not "/".


----------

