# NOAI 2026: Maze Information Prediction

**Note: This problem will be evaluated in an environment based on the `noai:2026v1.1` image. Participants should select `noai:2026v1.1` as the training image.**



## 1. Task Description

This problem provides a four-connected grid maze composed of $30\times30$ cells.

Each cell in the maze is represented by one of the following five characters:

| Character | Meaning                                                      |
| --------- | ------------------------------------------------------------ |
| `S`       | Start point, treated as open space, passable                 |
| `T`       | End point, treated as open space, passable                   |
| `.`       | Known open space, passable                                   |
| `#`       | Known obstacle, impassable                                   |
| `?`       | Unknown cell; its state in the true maze is either `.` or `#`, but is not directly given in the observation data |

In a four-connected maze, four-connectivity means: each step can only move to an adjacent cell (up, down, left, or right), and movement is only allowed through passable cells, i.e., `S`, `T`, or `.`.

For a given observed maze, participants must predict the following 4 numerical metrics for the corresponding true maze:

- Total number of obstacle cells;
- Total number of open-space cells reachable from `S`;
- Number of four-connected components formed by all passable cells; A four-connected component: following the movement rules above, if a group of non-obstacle cells can mutually reach each other by repeatedly moving up, down, left, or right, those cells belong to the same four-connected component. A four-connected component is the **maximum region of non-obstacle cells** satisfying this condition.
- Length of the shortest path from `S` to `T`.



## 2. Dataset

### 2.1 Data Scale

Each maze is a $30\times30$ grid, flattened into a string of length 900 in top-to-bottom, left-to-right row order; each maze is guaranteed to contain exactly one `S` and one `T`. For all mazes in the dataset, `S` and `T` are guaranteed to be connected in the true maze.

| Split                       | # Samples | Description                           |
| --------------------------- | --------- | ------------------------------------- |
| Training Set (Train)        | 5,000     | `train_data.csv` + `train_answer.csv` |
| Validation Set (Validation) | 3,000     | `val_data.csv` (unlabeled)            |
| Test Set (Test)             | 3,000     | `test_data.csv` (unlabeled)           |

### 2.2 Data Format

**Observed maze (`train_data.csv` / `val_data.csv` / `test_data.csv`):**

Each row contains 900 characters (30×30 flattened), representing one observed maze with `?` cells.

**Answer file (`train_answer.csv`):**

Each row contains 4 integers, representing the following metrics of the true maze for that sample:

| Index | Meaning                                   |
| ----- | ----------------------------------------- |
| y1    | Total number of obstacles                 |
| y2    | Number of open spaces reachable from S    |
| y3    | Number of open-space connected components |
| y4    | Shortest path length from S to T          |

### 2.3 Training Data Access

During the development phase, participants can only directly access the training set. The validation set and test set are only available in the official evaluation environment; participants must read their storage paths via specified environment variables. Please refer to the [baseline ](https://www.bohrium.com/notebooks/44754561216)Notebook for the specific access method.

The figure below shows the layout of the first 4 maze samples in the training set.

![train_first4_mazes](https://bohrium-ioai-test.oss-cn-zhangjiakou.aliyuncs.com/article/76715/4c7f5ff083e045aba657c4ccc1237ea7/a5410249-aadd-4d00-84be-11949784c8df.jpeg)



## 3. Example Explanation

The following uses a simplified $5\times5$ maze as an example to explain the meaning of the 4 labels.

![statement_5x5_examples](https://bohrium-ioai-test.oss-cn-zhangjiakou.aliyuncs.com/article/76715/4c7f5ff083e045aba657c4ccc1237ea7/5e889bce-b0ff-4f72-9686-0119adce9bfd.jpeg)

From left to right:

1. **Observed maze**: `?` represents unknown regions;
2. **True maze**: each `?` is restored to a specific `.` or `#`, with a total of 9 obstacle `#` cells;
3. **Open spaces reachable from S**: the reachable region is marked with `A`, totaling 12 cells (including `S` and `T`);
4. **Open-space connected components**: all open spaces are divided into 4 four-connected components;
5. **Shortest path**: the shortest path is marked with `*`, with a length of 8, meaning 8 steps are needed to move from `S` to `T`.

The 4 labels for this maze are:

```
9, 12, 4, 8
```



## 4. Task

Participants must predict the following 4 values for the corresponding true maze of each observed maze in the validation set and test set: total number of obstacles, number of open spaces reachable from S, number of open-space connected components, and shortest path length.

- **Input**: A 900-character maze string (containing `S`, `T`, `.`, `#`, `?`)
- **Output**: 4 real numbers



## 5. Submission

Participants must submit a Notebook named `submission.ipynb`. This Notebook should include the complete workflow for data reading, data processing, model training, prediction, and submission file generation, and must be runnable from scratch in the evaluation environment.

### 5.1 Input and Output

- **Input**: Training set `train_data.csv` + `train_answer.csv`; validation set and test set data are obtained at submission time via environment variables (see [baseline](https://www.bohrium.com/notebooks/44754561216) code for details).
- **Output**: A compressed file named `submission.zip`, containing:
  - `submission_val.csv` — validation set prediction results
  - `submission_test.csv` — test set prediction results

### 5.2 File Structure

Please refer to the complete file structure in the [baseline](https://www.bohrium.com/notebooks/44754561216) Notebook.

### 5.3 Submission CSV Format

Each CSV file contains 4 real numbers per row (no header), aligned with the input sample order:

```csv
12.5,85.3,3.1,18.0
9.0,120.0,5.0,22.0
```

### 5.4 Only one Notebook file may be submitted for this problem; additional datasets or other files are not permitted.



## 6. Scoring

### 6.1 Metrics

The four prediction targets are scored independently, with each target worth a maximum of 0.25 points. Scoring uses Mean Absolute Percentage Error (MAPE) and Top 10% Mean Percentage Error (Max10PE).

For a single prediction target, let the number of samples be $n$, the true values be $y_{1\sim n}$, and the predicted values be $\hat{y}_{1\sim n}$:

**Absolute Percentage Error:**

$$\text{APE}_i = \frac{|\hat{y}_i - y_i|}{|y_i|}$$

**Mean Absolute Percentage Error:**

$$\text{MAPE} = \frac{1}{n}\sum_{i=1}^{n}\text{APE}_i$$

**Top 10% Mean Percentage Error:** Let $k = \lceil 0.1n \rceil$; sort APE values from largest to smallest and average the top $k$:

$$\text{Max10PE} = \frac{1}{k}\sum_{i=1}^{k}\text{APE}_{(i)}$$

**Sub-score for a single prediction target:**

$$0.2 \times e^{-\text{MAPE}} + 0.05 \times e^{-\text{Max10PE}}$$

**The final score** is the sum of the sub-scores for all 4 prediction targets, with a maximum of 1.0.

### 6.2 Public Leaderboard and Private Leaderboard

- **Public Leaderboard (A)**: Calculated based on the Validation Set;
- **Private Leaderboard (B)**: Calculated based on the Test Set, and published after the competition ends.

### 6.3 Zero-Score Rules

The following situations result in a direct score of 0:

| Violation          | Description                                                  |
| ------------------ | ------------------------------------------------------------ |
| Format error       | The row or column count of `submission_val.csv` or `submission_test.csv` is incorrect, or contains NaN/Inf (it is recommended to detect and handle these separately) |
| Abnormal behavior  | Using irregular methods to influence the scoring program     |
| Network access     | The program attempts to access the internet during evaluation |
| File operations    | The program attempts to open or create files or directories outside of what is specified during evaluation |
| Process invocation | The program attempts to run other programs during evaluation |



## 7. Constraints

- Downloading or using any external data beyond the dataset provided for this problem is not allowed; however, participants may construct features, transform data, or perform secondary annotation based on the provided data;
- Using external large language model APIs (such as GPT or Claude) for prediction, feature generation, data annotation, or model ensembling is not allowed;

- The evaluation environment does not provide internet access; participant programs must not perform any network operations, nor install additional dependencies via `pip install`. Participants may only use packages pre-installed in the specified image;

- This problem uses a **CPU** for training and evaluation; the total time for training + inference must not exceed 25 minutes.



## 8. Baseline Score and Reference Score

- **Leaderboard B Baseline Score ([baseline](https://www.bohrium.com/notebooks/44754561216))**: 0.4508
- **Scientific Committee Reference Solution B Leaderboard Score (Reference Result)**: 0.8653



## 9. Acknowledgements

Thanks to teacher XR of the Scientific Committee for providing this problem.