TeachMap

Vietnam has 5,091 surplus teachers coexisting with a shortage of 62,877 in remote, mountainous areas. This means thousands of children never have access to subjects like English or IT.

TeachMap is an equitable teacher allocation optimization system for provincial education officers — built around a Min-Cost Max-Flow algorithm and a government-grade interface designed to replace Excel spreadsheets and phone calls.

20
Mountainous provinces — replicable architecture
3
Use cases designed and shipped
MCMF
Core optimization algorithm
Next.js Web UI
Flask API Request routing
C++ Core Engine MCMF + Greedy baseline + KPI
JSON results → Next.js statistics dashboard
Tony Nguyen
Full-stack developer
Ngan Huong
Backend developer, data scientist
Kien Han
Math, MCMF algorithm, backend developer
Linh Nguyen — me
Product strategy, problem framing, UX/UI, pitch
  • Led problem, gap and user analysis, scoped to itinerant teacher pool
  • Prioritized and designed 3 use cases and core UX/UI flow
  • Architected CSV data schemas; generated synthetic datasets for Hà Giang and Lai Châu via Python
  • Authored evidence-based problem document for government, NGO, and hackathon audiences

The allocation paradox

description Preliminary Research
"The localized surplus and shortage is not only at the provincial level — within a single school, there is structural mismatch."
— National Assembly Chair Vương Đình Huệ
Before and after TeachMap
Available teachers
👩‍🏫
English T1
Hanoi
👨‍🏫
IT T2
Hanoi
👩‍🏫
Math T3
Hanoi
Greedy/convenient placement
→ urban
→ urban
→ ?
62,877
shortage
Schools
Urban school
Already staffed ✓
👩‍🏫👨‍🏫
Remote school
Hà Giang, 18 schools
1 English teacher for 76 classes
The Allocation Gap
Same system — opposite crises
5,091
surplus
teachers
vs
62,877
teacher
shortage
7.5% 92.5%
Remote Reality · Hà Giang
1
English
teacher
18
schools
Satellite Schools Affected
26,000+
each dot
≈ 100 schools
Satellite / remote
Urban / adequate
Province Coverage
63 provinces · coverage split
42 deficit
21 surplus
Completion Rate
Upper secondary by group
Kinh (majority) 87%
Tày / Nùng 72%
H'Mông / Dao 46.4%
Remote avg. ~55%
40.6-pt gap between majority and most remote ethnic groups
Policy Failure
Incentives not moving teachers
30%
Early attrition
Remote teachers quit
within first 2 years
Incentive experiment
100M₫
bonus offered
0
applications

What are Sở officer's user stories?

These are the jobs we designed for.

touch_app click any card to expand
calendar_month
The annual allocation crunch
August · New academic year approaching
200+ teachers 80 schools 6 weeks Excel + phone calls
"When I have 200+ teachers to assign across 80 schools in 6 weeks, and my only tools are Excel sheets and phone calls to district officers who each advocate for their own area, I want to generate an optimized assignment plan that accounts for subject gaps, distance, and school priority — so I can stop making decisions based on whoever called me last and start making decisions I can actually defend."
TeachMap addresses this with
UC1 Annual Allocation Planning · Gap matrix · Optimizer produces full draft in seconds
warning
The invisible shortage
October · Teacher quits mid-year
Dìn Chin school 4 Grade 3 classes 3 weeks no English
"When a school principal in Dìn Chin calls me saying their only English teacher quit in October and 4 classes of Grade 3 students haven't had English for 3 weeks, and I have no way to quickly see which nearby teacher has capacity without disrupting another school's coverage, I want to instantly query the current allocation state and find the least-disruptive reassignment option — so students don't lose an entire semester of a mandatory subject while I make phone calls for two weeks."
TeachMap addresses this with
UC2 Mid-Year Emergency Reallocation · Nearest available teacher query · Disruption minimization
bar_chart
Directing resources to those in need
Budget meeting · Director/donor asks
No data Vague regional knowledge UNICEF reporting
"When I'm in a budget meeting and my director asks which schools are most underserved and I have no answer beyond vague regional knowledge, I want a coverage map that shows exactly which schools have unmet demand by subject and how large the gap is — so I can stop guessing and start directing resources to those in need."
TeachMap addresses this with
UC3 Equity Audit · Coverage map · Exportable unmet demand report by school and subject
swap_horiz
The rotation that might never happen
Policy exists since 2006 · Than Uyên: 6 years without rotation
5 years hardship post Chain of moves Coverage gap risk
"When a teacher has been in a hardship post for 5 years and is entitled to rotate back, but every time I try to move them I can't find a replacement who fits without creating a worse gap somewhere else, I want to see the full chain of moves required to honor that rotation without dropping coverage — so I can actually implement the policy that's been on paper since 2006 instead of telling that teacher to wait another year."
TeachMap addresses this with
Rotation constraints encoded as inputs · System enforces hardship caps automatically

What I built

Hover each node for more details

arrow_forward hover the nodes
01
Problem Definition
What I did
Reframed surplus/shortage paradox as a placement logic failure, not a supply gap. This changed what the system needed to optimize for and how it communicated results to government users.
02
Scope Design
What I did
Defined Tier 1 (intra-district) vs Tier 2 (cross-district) boundary. Scoped the system to the itinerant teacher pool — 5–15% of workforce — as the tractable intervention point.
03
Use Case Design
What I did
Designed 3 use cases with distinct trigger logic, input conditions, and output formats — Annual Planning, Emergency Reallocation, and Equity Audit — each serving different stakeholder needs.
04
Data Architecture
What I did
Defined CSV schemas for teachers and schools. Generated synthetic data for Hà Giang and Lai Châu via Python pipeline — province-prefixed IDs, flat demand columns, non-diacritic names for encoding safety.
05
Integration Schema
What I did
Authored the JSON request/response contract between frontend and algorithm team. This prevented dependency bottlenecks and let both tracks run in parallel throughout the sprint.
06
UI Prototyping
What I did
Built full HTML/CSS 3-panel interface for all use cases — designed for a Sở officer in their 40s-50s, comfortable with Excel. Not a data scientist. The UI's job was to make the optimization output feel like a decision the officer made, not a machine.
07
Research & Docs
What I did
Evidence-based problem analysis from MOET national statistics, UNICEF Vietnam country reports, World Bank Human Capital assessments, and academic research on teacher attrition in mountainous provinces.
08
Pitch Strategy
What I did
12-slide deck with story-first arc. Opened with a personal experience learning English, contrasted against a highland child with no English teacher due to placement failure. Audience-segmented talking points for judges, NGOs, and government.

What the system does

assignment
UC1
Annual Allocation Planning
User
Sở GD&ĐT provincial officer
Timing
July–August, before each school year
Trigger
New teachers graduate or get approved biên chế slots; existing teachers request transfers; some retire
System action
Officer uploads teacher pool + school demand → MCMF solver returns optimized assignment matrix, minimizing total travel cost while satisfying subject demand per school
Output
Coverage %, total travel km, assignment list by school and teacher — exportable
emergency
UC2
Mid-Year Emergency Reallocation
User
Sở officer, notified by school principal
Timing
Anytime a teacher quits, dies, or goes on extended leave
Trigger
A school loses its only teacher for a mandatory subject mid-year
System action
Finds nearest available teacher with matching subject capacity; proposes reassignment with minimal disruption to other current assignments
Output
Replacement proposal with ripple impact preview — weeks to hours
map
UC3
Equity Audit and Reporting
User
Sở leadership, MOET, NGOs (UNICEF, GPE), World Bank
Timing
Before budget cycles or donor reporting periods
Trigger
Run optimizer on current vs. optimal allocation. The gap quantifies inequity
System action
Province-level map of teacher distribution weighted by school remoteness priority (1–5 scale). Under-served schools flagged automatically
Output
Exportable report for Sở GD-ĐT submission — "the problem is exactly this large, in these specific locations"

Schema design decisions

FieldTypeWhy
teacher_idHG001, LC001Province prefix multi-province pipeline compatible
namestring (romanized)Encoding safe non-diacritic for Python/pandas safety
base_lat / base_lngfloatDistance cost input to MCMF solver
subjectssemicolon-separatedFlat CSV keeps structure flat, no nested arrays
capacity_hours_per_weekintCapacity constraint for flow solver
FieldTypeWhy
school_idHG-S012Province prefix consistent with teacher ID system
priority1–5 scaleRemoteness weight in equity audit output
demand_Mathint (hours)Flat columns not nested — simplifies solver ingestion
demand_Englishint (hours)Separate column per subject for direct query
lat / lngfloatGeographic distance calculation to teachers
Province-prefixed IDs
Using HG001, LC001 instead of sequential integers means the pipeline can process multiple provinces simultaneously without ID collisions. One decision in the schema made the system scalable to all 51 provinces without a single code change.
Flat demand columns
demand_Math, demand_English as separate columns instead of nested JSON means the MCMF solver reads demand directly with pandas without any parsing step. Reduced integration complexity significantly under time pressure.

The interface contract

I authored the JSON schema as the contract between my frontend work and the algorithm team's solver. Both tracks ran in parallel throughout the sprint. No dependency bottlenecks.

"allocation_request": {
"province_code": "HG", scope identifier
"district_id": "HG-D03",
"teachers": [...], from CSV pipeline
"schools": [...],
"constraints": {
"max_distance_km": 50, hard cap
"fairness_weight": 0.3 equity vs. efficiency
}
}
"allocation_response": {
"assignments": [{
"teacher_id": "HG001",
"school_id": "HG-S012",
"subject": "Math",
"hours_per_week": 18,
"distance_km": 12.4 travel cost
}],
"unmet_demand": [...], must surface failures
"solver_meta": {
"total_cost": 482.3,
"fairness_score": 0.87 traceable audit
}
}
The unmet_demand field was a deliberate product decision, as a tool that can hide its own failures loses trust immediately. A tool that explicitly says "here are the 6 schools we could not cover, and here is why" becomes a planning instrument government officers will actually use.

Three audiences, three messages

The pitch opened with my personal experience learning English, contrasted with a highland child who has no English teacher because placement logic failed. Personal and verifiable — no fictional character.

gavel
Hackathon Judges
Core message
Technical rigor + real problem
Hook
Algorithm solves a graph problem no tool currently addresses. MCMF on a real dataset from 2 provinces.
What they needed to believe
This could actually work in production, not just in a hackathon demo
volunteer_activism
NGOs / UNICEF
Core message
Equity and access
Hook
Children in highland communes lose subject access due to placement failure. 46.4% rural upper secondary completion. 1 in 3 Hmong girls never enters school.
What they needed to believe
The tool transforms "we know there's a problem" into granular data they can report to donors
account_balance
Government / DOET
Core message
Operational efficiency
Hook
Officers make better decisions faster with zero new data collection required. 3–4 weeks of Excel → hours. Every decision has a traceable audit trail.
What they needed to believe
This fits within their existing workflow and doesn't require new hiring or new data sources

What we shipped in a sprint

0
Use cases shipped
Fully functional optimization engine
0
Provinces — replicable architecture
0
Pitch deck slides
StakeholderBeforeAfter TeachMap
Sở officer 3–4 weeks making allocation calls manually with Excel and phone calls Hours to run, review, adjust, and export decision
Remote school Receives assignment based on who they know or luck Receives assignment based on objective coverage priority score
Ethnic minority student May not have English or IT teacher for the entire year Higher probability of having one — priority-flagged schools go first
UNICEF / World Bank Knows problem exists, no granular data to report Province-level coverage maps, unmet demand by subject and location — exportable
MOET Cannot see allocation quality across provinces Could aggregate data nationally if multiple provinces adopt the system
Reflection

12 hours, one privilege put to work

In 12 hours, we used the privilege of having learned English, learned to code, to try to build something for people who had neither. That asymmetry — between what we were given and what a child in a highland commune receives — is the gap TeachMap was designed to close.

We didn't have time to finish the UI. But every small decision — the CSV template with province-prefixed IDs, the unmet demand field surfaced explicitly, the priority score traceable to real data — was optimized for one specific user: the Sở officer who makes allocation calls that determine whether a child in Dìn Chin has an English teacher this year.

That officer is not a data scientist. They're someone who has been making these decisions with Excel and phone calls for years. Every product decision we made was in service of making their job — and through it, those children's chances — better.