@iyulab/u-routing 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -1
- package/package.json +1 -1
- package/u_routing_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -168,7 +168,28 @@ Solve a capacitated VRP with optional time windows. Four solver methods availabl
|
|
|
168
168
|
}
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
GA uses `population_size`, `max_generations`, `mutation_rate`, `elite_ratio`.
|
|
171
|
+
**GA config** uses `population_size`, `max_generations`, `mutation_rate`, `elite_ratio`.
|
|
172
|
+
**ALNS config** uses `max_iterations`. Both accept `seed`.
|
|
173
|
+
|
|
174
|
+
**Config constraints:**
|
|
175
|
+
|
|
176
|
+
| Parameter | Method | Constraint | Default |
|
|
177
|
+
|---|---|---|---|
|
|
178
|
+
| `population_size` | GA | >= 2 | 50 |
|
|
179
|
+
| `max_generations` | GA | >= 1 | 200 |
|
|
180
|
+
| `mutation_rate` | GA | 0.0 – 1.0 (clamped) | 0.1 |
|
|
181
|
+
| `elite_ratio` | GA | 0.0 – 1.0; must not fill entire population | 0.1 |
|
|
182
|
+
| `max_iterations` | ALNS | >= 1 | 500 |
|
|
183
|
+
| `seed` | Both | any u64 (optional) | random |
|
|
184
|
+
|
|
185
|
+
**Error handling:**
|
|
186
|
+
|
|
187
|
+
`solve_vrp()` returns a JS error (string) for:
|
|
188
|
+
- Invalid JSON input (missing required fields, wrong types)
|
|
189
|
+
- Unknown method name
|
|
190
|
+
- Invalid config values (e.g., `population_size: 0`, `max_iterations: 0`)
|
|
191
|
+
|
|
192
|
+
Errors are returned as rejected promises — they never cause `RuntimeError: unreachable` panics.
|
|
172
193
|
|
|
173
194
|
**Output:**
|
|
174
195
|
```json
|
package/package.json
CHANGED
package/u_routing_bg.wasm
CHANGED
|
Binary file
|