尚未检测到更新。GitHub 发布版本后会显示在这里。
制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗A machine learning system that learns to solve dynamic routing problems. Visit as many valuable locations as possible within a time budget and deadline constraints.
Live Demo: https://web-mu-two-jcjd89kwmw.vercel.app
The Problem: You have 50 locations to visit, 24 hours, and each location has a deadline. Rewards decrease over time. How do you maximize total reward?
The Solution: A Pointer Network trained with REINFORCE (policy gradient RL) learns optimal node selection. At inference, beam search finds near-optimal routes.
The Stack:
pip install torch numpy matplotlib pandas
python train.py
Takes ~5-10 min on GPU. Saves weights to optw_model.pth and metrics to training_log.csv.
python run_pipeline.py
Compares greedy vs. beam search on a test problem.
cd web && npm install
npm run dev
Open http://localhost:3000 → Create a run → Click nodes on the map → See live recommendations.
The web/ app is deployed on Vercel (project web, team anushkas-projects-cfaf755b).
Live: https://web-mu-two-jcjd89kwmw.vercel.app
To deploy a new build to production:
cd web
npx vercel --prod
The directory is already linked via web/.vercel/project.json (not committed — see web/.vercel/README.txt). If the link is ever lost or points to the wrong team, relink with:
npx vercel link --project web --scope anushkas-projects-cfaf755b
├── env.py # OPTW environment (vectorized, 32 instances parallel)
├── model.py # Pointer Network + Transformer layers
├── train.py # REINFORCE trainer (300 epochs)
├── run_pipeline.py # Greedy & beam search inference
├── optw_model.pth # Trained weights
├── training_log.csv # Epoch metrics
│
└── web/ # Full Next.js app
├── src/lib/services/optimizer.service.impl.ts # Beam search impl
├── src/components/route-map.tsx # Interactive map
├── src/components/comparison-view.tsx # Greedy vs beam
└── README.md # Web-specific setup
Static Input (coordinates, times, reward)
↓ embed (64-dim)
Dynamic Input (time urgency, decay)
↓ embed (64-dim)
↓ concat (128-dim)
Transformer Layers (8-head attention with feasibility masking)
↓
LSTM (tracks decision history)
↓
Pointer Mechanism → output probabilities over all nodes
Key insight: Pre-softmax masking ensures the model only selects feasible next nodes.
for epoch in 300:
env.reset() # Random problem
while episode_active:
probs = model(state, masks)
action = sample(probs)
reward, next_state = env.step(action)
loss = -mean((reward - baseline) × log_probs)
backprop + grad_clip + optimizer.step()
| Metric | Value |
|---|---|
| Training epochs | 300 |
| Greedy avg reward | ~17 |
| Beam (width=16) avg reward | ~22 |
| Improvement | +29% |
| Greedy inference time | ~5ms |
| Beam inference time | ~50ms |
Key Findings:
# env.py
self.num_nodes = 50 # → 30, 75, 100, etc.
Then retrain: python train.py
# env.py
self.enable_forecast_events = True
Now forecasts update every 4 hours with perturbations (non-stationary environment).
# train.py
BATCH_SIZE = 32 # instances per batch
EPOCHS = 300 # training steps
LR = 1e-4 # learning rate
GRAD_CLIP_NORM = 1.0 # gradient clipping
Steps:
python train.py or cd web && npm run devIdeas:
Papers:
Libraries:
MIT License
model.py, env.pyHappy optimizing! 🚀