Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omitting piece types for Corner Helicopter 2x2, missed optimal #76

Open
DougCube opened this issue Dec 24, 2024 · 4 comments
Open

Omitting piece types for Corner Helicopter 2x2, missed optimal #76

DougCube opened this issue Dec 24, 2024 · 4 comments

Comments

@DougCube
Copy link

I created a definiton file for the "Corner Helicopter 2x2" (CH2) puzzle. I'm trying to create a multi-phase solver for it.
But I was suprised with extremely poor runitmes. As an experiement I ran with omitting all the pieces except for the induced 2x2 using this command: ./build/bin/twsearch -c 1 --omit WING,TIP,MIDGE full.tws ch2_steven_1.scr. But I let it hit depth 14 before killing it -- turns out there is a solution at depth 6.

I modified the scramble file to remove the moves that don't alter the 2x2 state and instead ran with the sample 2x2x2 definition file like this: ./build/bin/twsearch -c 1 --moves U,F,R samples/main/2x2x2.tws ch2_steven_1_only_2x2.scr which immediately found an optimal solution at depth 6 (U2 R' F' U F2 R). The relavent files are attached below.

This seems to be a bug. I suspect that it's being slowed down by moves in the scramble that only affect omitted pieces. Is the tool smart enough to ignore searching moves which only impact omitted pieces?

Using the same basic definition file (but with some sets removed and/or identical piece usage) and also modifing the scramble to remove the useless moves, it runs as expected. Thus, I don't believe there's any problem with my underlying defnition files. In the past, I got it to a 14-stage solver that combined to produce solutions that actually solve a random scramble after a lot of manual effort.

ch2_testcase.tar.gz

@DougCube
Copy link
Author

On an unrelated note.. While creating the modified scramble in this example, I noticed that it doesn't support using # to comment at the end of scramble lines and I had to insert line breaks to make it work.

@rokicki
Copy link
Collaborator

rokicki commented Dec 24, 2024 via email

@rokicki
Copy link
Collaborator

rokicki commented Dec 24, 2024 via email

@DougCube
Copy link
Author

--moves supports a comma-separated list, but --omit does not AND does not issue an error or warning when the set name does not exist in the definition file. This seems like a problem to me. The result was that the tool wasn't running what I expected it to be running.

Then using multiple --omit options, I am seeing the "bad move name" error now. But if instead of using a ScrambleAlg, I use a Scramble state, then it will probably run as expected... and indeed it does. So a workaround would be to convert the ScrambleAlg to a state using --showpositions then put that into a .scr file and run it instead. But it should be possible to support ignoring those moves in the ScrambleAlg. Not sure why it's so complicated -- could just internally convert it to a state and drop the omitted piece sets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants