-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.txt
123 lines (87 loc) · 3.43 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# ICFPC2018
Team Unagi's repository for ICFPC 2018
## Members
- Takuya Akiba
- Kentaro Imajo
- Hiroaki Iwami
- Yoichi Iwata
- Toshiki Kataoka
- Naohiro Takahashi
## Build and Run
### Requirements
* Rust
* C++
* Bazel
* Mono
### Build
```
cargo build --release
make install
```
### Rust
Example for assembly problems:
```
./target/release/solve2 <TARGET_MODEL_FILE> a 40 x | ./bin/trace_binarize <OUTPUT_TRACE_FILE>
```
Examples for disassembly problems:
```
./target/release/destroy_iwiwi '' <SOURCE_MODEL_FILE> > <OUTPUT_TRACE_FILE>
```
```
./target/release/destroy_tos '' <SOURCE_MODEL_FILE> > <OUTPUT_TRACE_FILE>
```
### C#
Example:
```
mono ./bin/chokudai-solver/014.exe <TARGET_MODE_FILE> | ./target/release/run_postproc <TARGET_MODE_FILE> /dev/stdin | ./bin/trace_binarize <OUTPUT_TRACE_FILE>
```
### Shell
Examples (for reassembly problems)
```
./bin/solvers/iwiwi-004+chokudai-014 <TARGET_MODEL_FILE> <SOURCE_MODEL_FILE> > <OUTPUT_TRACE_FILE>
```
```
./bin/solvers/iwiwi-004+wata-008 <TARGET_MODEL_FILE> <SOURCE_MODEL_FILE> 40 x > <OUTPUT_TRACE_FILE>
```
## Solution Approcach
### Solutions for Assembly Problems
#### Solution 1
`wata/src/bin/solve2.rs`
Our construction solver uses the following strategy. We construct one or two layers at a time (e.g., construct the layer y=0, 1, 2, ...). In order to keep everything grounded, we simultaneously construct support pillars. These supports are deconstructed at the end of the construction. For constructing a layer, we first devide the voxels in the layer into several regions. Then each robot greedily chooses a near region and fills the region by using GFill operations.
#### Solution 2
`chokudai/Program.cs`
Basically we create each layer, one by one, from the bottom one.
To keep the groundedness, it postpones some parts that requires to go down.
With this technique, it can output solutions without harmonics for all assembly inputs, although it is not guaranteed that it can work with any inputs.
When it is able to create large rectangles,
it greedily enumerate rectangles, and uses GFill operations.
### Solutions for Disassembly Problems
#### Solution 1
`wata/src/bin/destroy_iwiwi.rs`
We place bots in a 2D grid form, and repeat plane gvoid (with offset (0, -1, 0)).
By using four steps, they destruct the plane directly below them.
Then, they go down, and remove the next plane.
If the field is large, it repeats the above procedure at different places.
#### Solution 2
`wata/src/bin/destroy_tos.rs`
This disassembles relatively small models by 3-dim GVoid operations. Firstly the model is projected onto xz-plane and then divided into 31x31 cells.
If there's no 2x2 block of cells, there are free lines for nanobots to work.
Example: Full voxels in the model `problemsF/FD083_src.mdl` only exist in the following 3 cells out of 5x5.
```
..... -> z [0, 1, 17, 48, 69, 70]
..#..
..#..
..#..
.....
|
v
x [0, 1, 7, 38, 69, 70]
```
### Solutions for Reassembly Problems
For each reassembly problem, we applied disassembly and assembly solvers for the source and target models, respectively.
Then, we just concatenated the outputs of them.
### Other
#### fusion_all
With this routine, all bots fusion into a bot and move to the origin, at last parts of algorithms. Basically each bot follows BFS-search from the origin. To reduce traffic jams, further 1-step search is done.
#### fission_to
By reversing the fusion_all routine, an algorithm can start with any configuration of initial (reachable) positions.