## Brief 

The setup can be briefly described as follows: 

- central (solution) state off the puzzle -- a sorted vector of length 296 with 49 zeros, 49 ones and so on up to 5
- moves -- a set of permutations on the set of 296 elements
- states of the puzzle -- permutations of the central state. Not every permutation is valid -- a valid state can be obtained from the central one by applying a sequence of moves
- Input data - a set of valid randomly generated states (1005 vectors)
- Solution (of a valid state) - a sequence of moves to transform a valid state to a central one. The challange is to find the solutions for all input data.
- To apply move-vectors to state-vector -  just do numpy reindexing: 
```python
state_vector[ move1_vector][move2_vector]...[moveN_vector]
```  
- Central state, move names and corresponding vectors are stored in [puzzle_info.json](https://www.kaggle.com/competitions/cayley-py-777-cube/data?select=puzzle_info.json). There are 42 moves, their names:  'f0, '-f0', 'f1', ... . See last section for comments on moves names and their visualizations.
- Submission: should contain the sequences of move names separated by dots for each sample, e.g. d0.-f1
- Evaluation: sum of the lengths of solutions (how many moves used in total - i.e.  first count number of moves for each test sample and then sum over all 1005 samples).

## Details

Here we reiterate with more details what was briefly described above.

### States and moves  are integer vectors  (permutations)


In the scope of this competition our puzzle has 296 tiles, each with one of 6 unique "colors" (from 0 to 5). There are 25 tiles per each color. The puzzle is called to be "solved" if the **solution state** is achieved:
 
```python
solution_state =[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]
```  

The full set of the moves can be found in [puzzle_info.json](https://www.kaggle.com/competitions/cayley-py-777-cube/data?select=puzzle_info.json).

### Input data - 1005 integer vectors ("initial states" - permutations) 

Submissions are evaluated on a set of **initial states** of the puzzle. There are 1005 states in the test set. Last 1000 stats are obtained by appying random sequences of moves: the first state is obtained by applying a single random move, the second one -- by applying 2 constitutive random moves (independently from the previous sample), the third one -- by 3 moves and so on up to 1005. The moves are sampled uniformly from the set of all possible moves. The first 5 states are taken from [Santa 2023](https://www.kaggle.com/competitions/santa-2023) challenge (only for the same central state as ours, zero wildcards)

For each **initial state** the participant needs to provide a set of moves to get to the **solution state**. If there is a path in submission which doesn't lead to the **solution state**, the whole submission is considered invalid.

### Evaluation: score = number of moves

For a valid submission the final score are the sums of the lengths of all paths:

$$ score = \sum_{path \in Test}\mathrm{len}(path) $$

The lower the score the better the result is.

The paths used for generation the samples are provided in [sample_submission.csv](https://www.kaggle.com/competitions/cayley-py-777-cube/data?select=sample_submission.csv). These paths are highly non-optimal, however they can be used to get a valid submission.

## Submission File
For each initial_state_id in the test set, you need to generate a path from the **initial state**(from [test.csv](https://www.kaggle.com/competitions/cayley-py-777-cube/data?select=test.csv) to the **solution state** . 

The path is a string of dot-separated generator names. The generator are assumed to be applied to the **initial state** to the **solution state** starting from left to right.  The generators and the solution state can be found in [puzzle_info.json](https://www.kaggle.com/competitions/cayley-py-777-cube/data?select=puzzle_info.json)

Make sure that the values in  **initial_state_id** column are ordered from 0 to 1034.


| initial_state_id | path |
| :-------- | :-------: |
| 0 | f1 |
| 1 | -d3.-r3 |
| 2 | -f0.d0.-f0|
|...|...|
