# The Batch Solver - Generate large algorithm sets automatically!

#### trangium

##### Member
The Batch Solver

Batch Solver Tutorial by OreKehStrah

Introduction
Before the batch solver, generating algorithms involved inputting each and every case into Cube Explorer, running the search for that one case, testing out the generated algorithms to determine the best one for that case, then repeating the process for all cases in the set. For algorithm sets with 50, 100, or even 500+ cases, this quickly becomes extremely tedious and a huge time commitment. The batch solver automates most of this process. Given a suitable input, it will automatically generate algorithms for every case using the specified move groups and depths, and it will also sort the algorithms, making finding the fastest ones less time-consuming. It also automatically generates images for each case (for supported puzzles).

Supported Puzzles
The natively supported puzzles (with pre-loaded puzzle definitions) are 3x3, 2x2, Pyraminx, Megaminx, and Skewb. In addition, the batch solver supports any custom puzzle that's non-bandaging and non-commutative. More specifically, any particular move must always affect the pieces in the same location the same way, in addition to the previous requirements. This includes all WCA puzzles except Square-1 and Clock.

Capabilities
The batch solver can generate any algorithm set where the ending state is defined by just ignoring the orientation or permutation of certain pieces (separation of pieces is also supported). There are pretty much no restrictions on the starting state.
To illustrate an example output, here is the batch solver's generated algs for OCLL:

History
Source Code
May 10, 2020 - The start of what would eventually become the Batch Solver. I named it TORCS (Trangium's Other Replacement Cube Solver) because I originally intended for this to be similar to HARCS. At this point, all the program could do was solve a predetermined set of pieces on the 3x3x3 (e.g. X-Cross).
October 11, 2020 - Subsolver created - Short for "Subgroup Solver". I added the ability to only use a certain subgroup of moves when searching (e.g. only finding <RUF> solutions). This is actually still on my website. I also pretty drastically changed the structure of my code (for admittedly minor performance optimizations).
November 26, 2020 - MCC created - This would allow me to automatically rank the algorithms by how fast they could be executed. Although the ranking is far from perfect, it's at least better at sorting cases than merely STM.
May 27, 2021 - Algdesk created - I now implemented the Puzzle field, Unique Orientations & Equivalences field, and Scramble field, so at this point I basically had an early version of the batch solver except without batch solving - it could only solve one case at a time. Also, I drastically changed the structure of my code AGAIN, pretty much reverting it back to how it was before October 2020. Oh well.
July 22, 2021 - Batch solver created - The core functionality of the batch solver, i.e. generating algs for an entire algset at once, was done. However, there were a lot of smaller things (such as bugs, images, bugs, sorting, bugs, bugs, input sanitization, bugs, statistics, bugs, and did I forget to mention, bugs?) that I had to iron out.
May 8, 2022 - Video tutorial released (thanks OreKehStrah!) and batch solver (pretty much) finished. What a journey.

#### Athefre

##### Member
I highly recommend this program. All of APB, ACMLL, and some Nautilus algorithm sets were generated using the batch solver. It made the development process so much easier.

Something that isn't mentioned is that this program is also good for testing. If you have an idea, you can try various movesets then generate the algset and see if the algorithms are good. I used this to create the EO+RB analysis that I posted some time ago that compared standard Petrus with APB, Mehta, and a few others.

#### IsThatA4x4

##### Member
Does the batch solver work on mobile? Also, is there a requirement for system memory because last time I tried to generate some PLLs (for fun to test it out), chrome apparently "ran out of memory".
Edit: on mobile (safari), the page reloads after about 30 seconds of searching depth 9.
Edit edit: It was because prune value, after watching the tutorial I understand it much better thank you!

Last edited:

#### trangium

##### Member
Does the batch solver work on mobile? Also, is there a requirement for system memory because last time I tried to generate some PLLs (for fun to test it out), chrome apparently "ran out of memory".
Edit: on mobile (safari), the page reloads after about 30 seconds of searching depth 9.
Edit edit: It was because prune value, after watching the tutorial I understand it much better thank you!
It should work on pretty much all mobile browsers (though the only mobile browser I've tested is Safari).

The amount of system memory that is required depends on the prune value you use. For mid-range devices, I recommend these prune values for 3x3:
2-gen: 9/10
3-gen: 6/7
4-gen: 5/6
5-gen or higher: 4/5
If you have a higher-end computer, you may be able to get away with increasing these by up to ~25%. Because the amount of memory required grows exponentially in the depth, increasing it much beyond that is almost certainly going to result in a memory error.

#### abunickabhi

##### Member
This is super good piece of software. I would love to use it to get lot of alternatives for the 5-style algs that I am generating!

Good work @trangium

#### Silky

##### Member
Amazing job on the tutorial. SUPER clear. I've been genning algs for the last few days (mostly for fun). Any advice for finding a balance between Batch and Cube Explorer? I definitely still find better algs using the later (not by anything insane of course). Seems the Cube Explorer is good for 5+ Gen algs and batch is better for 3-4 Gen algs. Usually just run cube explorer algs through MCC afterwards.

#### OreKehStrah

##### Member
Amazing job on the tutorial. SUPER clear. I've been genning algs for the last few days (mostly for fun). Any advice for finding a balance between Batch and Cube Explorer? I definitely still find better algs using the later (not by anything insane of course). Seems the Cube Explorer is good for 5+ Gen algs and batch is better for 3-4 Gen algs. Usually just run cube explorer algs through MCC afterwards.
Typically I'll use the batch solver first, and then manually check any cases that stand out as being particularly subpar with CE.

#### trangium

##### Member
Amazing job on the tutorial. SUPER clear. I've been genning algs for the last few days (mostly for fun). Any advice for finding a balance between Batch and Cube Explorer? I definitely still find better algs using the later (not by anything insane of course). Seems the Cube Explorer is good for 5+ Gen algs and batch is better for 3-4 Gen algs. Usually just run cube explorer algs through MCC afterwards.
Usually, if I only have to generate a few cases, I'll use Cube Explorer, but if it's a substantial number (20+) I'll use batch solver. Also, cube explorer is much faster for 4-6 gen subgroups with no wide or slice moves, and batch solver is significantly faster when slices are involved and is the only option when wide moves are involved.

#### Silky

##### Member
What I've been doing is genning first by MMC and then by STM. Afterwards I run the STM batch through MCC and usually get 1-2 better algs. I've been regenning SLS, GLS, and EZD; I should be posting that in a few days.

#### OreKehStrah

##### Member
What I've been doing is genning first by MMC and then by STM. Afterwards I run the STM batch through MCC and usually get 1-2 better algs. I've been regenning SLS, GLS, and EZD; I should be posting that in a few days.
You can have the batch solver sort by STM as the primary metric and then by MCC as the secondary. This will rank the algs at each movecount so you can then decide for yourself if a lower movecount alg is better or not.

#### IsThatA4x4

##### Member
Is there any way to set equivalence by permutation only?
E.g. Solving CPLS
If not, consider adding it, it would definitely be appreciated!

#### trangium

##### Member
Is there any way to set equivalence by permutation only?
E.g. Solving CPLS
If not, consider adding it, it would definitely be appreciated!
There is! Just put 1: before the set of pieces where orientation doesn't matter, but don't put any curly braces around them.
1: UFR UFL UBL UBR
{UF UL UB UR}

#### Silky

##### Member
There is! Just put 1: before the set of pieces where orientation doesn't matter, but don't put any curly braces around them.
1: UFR UFL UBL UBR
{UF UL UB UR}
Is there any way to separate pieces to layers, disregarding permutation? Aka Square-1 EO

#### Filipe Teixeira

##### Member
how can I make it stop searching after finding a few algs?

#### Silky

##### Member
how can I make it stop searching after finding a few algs?
[END SEARCH]

#### trangium

##### Member
Is there any way to separate pieces to layers, disregarding permutation? Aka Square-1 EO
Yep! Just put the set of pieces that are separated in separate curly braces. For example, on 3x3, {UF UL UB UR} {UFR UFL UBL UBR} {DF DL DB DR} {DFR DFL DBL DBR} separates the U/D pieces to their layers.

#### IsThatA4x4

##### Member
I have some requests which I don't know if you're working on them, but could be very beneficial regardless. If any of these are already things, I would love to know how to do them.

1. When generating the output, it would probably be much nicer to have the output table expand both horizontally and vertically, as opposed to just horizontally. You could add options like "# of columns / rows in output table". Currently this is quite an issue for large sets like ZBLL (/PHLL/HPLL if we're doing that), or 1LLL.

2. An option to hide failed cases? That way the empty box doesn't clog up the output, making it harder to find the cases that didn't fail

3. Font size for output. If we have image size, font size could also be a good option to add.

4. Ability to use a group of moves as part of a subset.
This basically means you could put <F R U R' U' F', R' F R F'> into the subset box, and it would solve with only sexy moves and sledgehammers. If this already exists, I don't know how to do it.

5. Relatively small, but an option to display the case probability next to the image. A minor thing but it could help some people.

#### mk8

##### Member
how can i do cube rotations? i know y is like U and D' at the same time, x is like R and L' at the same time and z is like F and B' at the same time. for each, i can copy the clockwise move (U, R and F) from the already written definiton, but i'm not sure how i would define the counter-clockwise move. can somebody explain?

Last edited:

#### Silky

##### Member
@trangium Any idea how you'd set up OL5C for SSC? I tried setting it up as (1) <R, D R D' R D R2 D'>R U D2 and (2) <U, R U R' U R U2 R'>R U D2. Gotten some weird results. Feel like I'm missing something but can't quite tell what it is. Thinking it has to do with the UBL corner.