P4Learned Delivery Routing
1

Code and data line · 01 of 13

Codebase

A single Python package, delivery/, split by responsibility: data, nn, search, csp, integration and eval, with four entry-point scripts and a pytest suite. 2,849 lines in total.

Package
delivery/
Entry points
4 scripts
Tests
tests/, 38 cases
Download
Source, .zip (88 KB)

Files

FileRoleLines
delivery/data.pyDownload, filter and split the TLC trips216
delivery/instances.pySeeded generator for orders, windows and vans140
delivery/nn.pyMulti-layer perceptron, Adam, Huber loss, early stopping239
delivery/baselines.pyHistorical average and distance-linear baselines63
delivery/travel_time.pyHourly time matrices, FIFO interpolation, lower bounds66
delivery/search.pyUCS, Greedy, A* and brute force271
delivery/csp.pyAssignment CSP: backtracking, forward checking, AC-3247
delivery/integration.pyThe feedback loop and the no-solution report183
delivery/eval.pyMetrics and the replay of held-out trips93
delivery/pipeline.pyEnd-to-end helpers27
delivery/plots.pyFigures107
delivery/config.pySeeds, paths, constants31
tests/test_search.pySearch tests145
tests/test_csp.pyCSP tests97
tests/test_integration.pyIntegration tests71
tests/test_nn_data.pyModel and data tests68
tests/conftest.pyShared fixtures34
make_data.pyEntry point: data78
train_nn.pyEntry point: training79
run_demo.pyEntry point: demo364
run_experiments.pyEntry point: experiments230
requirements.txtPinned requirements19

Every file opens in the viewer with line numbers.