Scoring rules
How VIGHNAWAY decides
These rules come straight from the route engine that runs on the phone and in this console, so this page cannot drift from the code.
Rules version 1
Ranking cost
C(r) = sum over edges of (travel time x congestion multiplier) + sum over incidents on the route of (severity penalty x verification weight x age factor) + data-gap penalty
- Congestion multiplier
- Verified or corroborated congestion multiplies edge travel time, so the displayed ETA changes.
- Value: heavy: 2.5; moderate: 1.5; none: 1; standstill: 4
- Unverified congestion
- Unverified congestion adds a ranking penalty equal to the extra time it would add x 0.4. The displayed ETA does not change.
- Value: 0.4
- Severity penalty (seconds, ranking only)
- Ranking-only seconds for debris and accidents (and medium for ankle-deep water). Never shown as time.
- Value: high: 900; low: 60; medium: 300
- Default severity
- Severity assumed when a debris or accident report gives none.
- Value: medium
- Verification weight
- Scales the severity penalty by how well the incident is supported.
- Value: corroborated: 0.75; dismissed: 0; resolved: 0; unverified: 0.4; verified: 1
- Age factor
- Penalty weight is 1.0 for reports under 30 min old, falling linearly to 0.6 at 3 h, and 0.6 after that. Older reports are labelled Stale, never dropped.
- Value: floor: 0.6; floorAtS: 10800; fullUntilS: 1800
- Stale after (seconds)
- A report older than 3 simulated hours (strictly more than 10,800 s) is labelled Stale. Hard blocks from stale reports stay in force until an operator resolves them, and confidence drops to Low.
- Value: 10800
- Unverified blockage penalty (seconds)
- An unverified closure, unverified knee-or-deeper flood, or unverified impassable report adds 1,800 s to ranking and a visible warning; the route stays viable.
- Value: 1800
- Ankle-deep water
- Ankle-deep water is a medium-severity penalty (300 s x weight x age) for every open status; the route stays viable.
- Value: medium
- Flood depth not given
- A flood report with no depth is treated as knee depth (conservative).
- Value: knee
- Data gap
- While a rain alert is active, each flood-prone edge with no report in the last 60 simulated minutes adds 120 s to ranking only. A report exactly 60 min old still counts as recent. It never creates an incident and is shown as "No recent reports on <road>".
- Value: penaltyS: 120; windowS: 3600
- Switching rule
- Keep the current recommendation unless it is not viable, or another viable route is cheaper by more than the larger of 120 s and 10% of the current cost. A gain exactly equal to the threshold does not switch.
- Value: minGainFraction: 0.1; minGainS: 120
- Tie break
- Ties are broken by lower cost, then shorter distance, then the lexicographically smaller route id. Costs and ETAs are rounded to whole seconds before comparing.
- Value: cost, distance, routeId
- Confidence label
- Low: a conflicting incident on the route, viability relying on a stale report, the next viable route within 60 s of ranking cost, or a forced reversal. Medium: an unverified incident on the route, a data gap on the route, no alert information while the route uses flood-prone edges, or the next viable route within 60 to 180 s. High otherwise, including when no other viable route exists.
- Value: lowGapS: 60; mediumGapS: 180
- Candidate routes
- Candidates come from Yen k-shortest paths (k = 5) plus edge-penalty alternatives and the best path around current hazards. A candidate sharing more than 80% of its length with a better one is dropped. Up to 4 routes are shown.
- Value: k: 5; maxDisplayed: 4; overlapLimit: 0.8; penaltyFactor: 1.6; penaltyRounds: 4
- Turning back
- Re-planning never turns back onto the current edge while any forward plan is viable. Only when none is viable may it return a reversal, with this label and confidence Low.
- Value: Turn back only where it is safe to do so
- Speeds (km/h)
- Illustrative monsoon-traffic speeds per road class, in km/h. Not measurements.
- Value: car: living_street: 10; motorway: 50; motorway_link: 35; primary: 30; primary_link: 25; residential: 15; road: 15; secondary: 25; secondary_link: 20; service: 10; tertiary: 20; tertiary_link: 18; trunk: 40; trunk_link: 30; unclassified: 15; foot: default: 4.5; steps: 3; two_wheeler: living_street: 12; motorway: 50; motorway_link: 35; primary: 32; primary_link: 27; residential: 18; road: 18; secondary: 27; secondary_link: 22; service: 12; tertiary: 22; tertiary_link: 20; trunk: 40; trunk_link: 32; unclassified: 18
- Default speed (km/h)
- Speed for road classes not listed above.
- Value: car: 15; foot: 4.5; two_wheeler: 18
- Road access by profile
- Car and two-wheeler exclude footways, paths, pedestrian streets, steps and motor_vehicle=no. On foot excludes foot=no and motorways, includes footways, footbridges and steps, and may walk one-way streets in both directions. access=no or private excludes every profile unless the profile tag says yes.
- Value: footExcludedHighways: motorway, motorway_link; motorExcludedHighways: footway, path, pedestrian, steps, cycleway, bridleway, corridor, platform, elevator
Known limitations
- Every flood, closure and congestion in the demo is simulated. Road geometry may be real, conditions are not.
- Speeds are illustrative monsoon-traffic defaults, not measurements.
- Corroboration counts distinct device ids. It is a prototype heuristic, not proof of independent witnesses.
- Only an operator action sets Verified. The scripted demo uses a simulated operator, labelled as such.
- Confidence is a label (High, Medium, Low) from a decision table, never a probability.
- The engine does not forecast water levels; it only weighs reports and their evidence.
- The committed graph may be a schematic fixture with approximate positions when OpenStreetMap could not be reached.
- Hindi and Marathi translations need review by a native speaker.
Attribution
Road data © OpenStreetMap contributors
Map data © Google