Route Algorithms

How we calculate safe, efficient cycling routes across Victoria

Production Routing System

This page documents our current production routing implementation running on GraphHopper 10.2. The algorithm has been deployed and refined based on real-world testing and feedback from the Victorian cycling community.

Recent Visual Enhancements (October 2025)

  • ✓ Dual-layer rendering: Routes now display with a wide transparent background layer plus a thin precise foreground line
  • ✓ Solid vs dashed lines: Visual hierarchy shows infrastructure quality at a glance (solid = better protection, dashed = minimal)
  • ✓ Per-segment coloring: Routes dynamically change colors based on infrastructure transitions along the path
  • ✓ Updated color scheme: Cyan for bike lanes, green for protected paths, orange for residential, red for high-traffic

Visual Infrastructure Hierarchy

VicBUG uses a sophisticated dual-layer color-coding system that shows infrastructure quality at a glance. Routes dynamically change colors per-segment based on the actual bike infrastructure present.

Visual cues: Solid lines indicate higher protection, while dashed lines show minimal or intermittent infrastructure.

Protected Lanes & Paths

Green-400SOLID

Highest safety level. Includes protected lanes with physical barriers, separated cycleways, and car-free paths.

GraphHopper tags: cycleway, separated, track, shared_path, sidepath

Buffered Bike Lanes

Cyan-300SOLID

Good protection. Painted buffer zone provides separation between cyclists and motor vehicles.

GraphHopper tags: buffered_lane, lane_buffered

Basic Painted Lanes

Cyan-300DASHED

Moderate protection. Standard painted lanes without buffer. Dashed line indicates minimal physical separation.

GraphHopper tags: lane, designated, basic_lane

Shared Lanes / Parking

Orange-300DASHED

Minimal protection. Lanes shared with parking or buses. Dashed line indicates intermittent availability.

GraphHopper tags: shared_lane, share_busway, shared, shared_parking

Residential Streets

Orange-300SOLID

No bike infrastructure. Quiet, low-traffic residential streets and service roads.

Road types: residential, service, tertiary, living

High-Traffic Roads

Red-500SOLID

Use with caution. Arterial roads, state highways, and primary routes with heavy traffic.

Road types: primary, secondary, trunk, state road

Per-Segment Color Coding

Routes intelligently change colors based on infrastructure transitions. A single route might show green for a protected path, then switch to cyan for a buffered lane, then orange for a residential street - all automatically color-coded to show you exactly what type of infrastructure you'll encounter on each segment.

Road Classification (Fallback Coloring)

When bike infrastructure data is unavailable, routes fall back to road class-based coloring. This ensures all routes are color-coded for safety, even without infrastructure details.

Note: Infrastructure-based colors (above) take priority when available. These colors only apply to segments without bike infrastructure data.

Paths & Trails

Green-400SOLID

Car-free paths, trails, shared trails, bridleways, singletracks

Residential Streets

Orange-300SOLID

Residential, service, tertiary, living streets, unclassified roads

Footways

Teal-300DASHED

Pedestrian-only paths, generally not legal for cycling

High-Traffic Roads

Red-500SOLID

Primary, secondary, trunk, motorway, state roads, steps - use with caution

Intelligent Bike Routing

Our routing engine uses a single, carefully-tuned profile powered by GraphHopper 10.2 that intelligently prioritizes cycling infrastructure while respecting legal and safety requirements.

Infrastructure-Aware Routing

UNIFIED PROFILE

"Smart routing that prefers protected infrastructure while keeping routes practical and legal"

Our algorithm intelligently weighs different types of bike infrastructure to find routes that maximize safety without creating impractically long journeys. The system uses precise multipliers to balance infrastructure quality with travel efficiency.

Infrastructure Preference Multipliers:

Protected bike lanes (physical barriers)3.0×
Separated paths (completely car-free)2.5×
Buffered lanes (painted buffer zone)2.0×
Shared paths (off-road, shared with pedestrians)1.5×
Basic lanes (painted lanes, no buffer)1.3×

Dual-Layer Visual Rendering:

All route segments are rendered with a sophisticated two-layer system for maximum clarity:

Layer 1
Background highlight: Wide semi-transparent line (14pt @ 50% opacity) creates a colored "glow" that makes routes easy to spot on the map
Layer 2
Foreground detail: Thin precise line (2.5pt solid or 1pt dashed @ 90-100% opacity) shows exact route path and infrastructure quality

This dual-layer approach ensures routes are visible at all zoom levels while maintaining visual hierarchy through the solid/dashed pattern system.

GraphHopper Profile: bike |Custom Model: bike_custom.json

Safety-Critical Oneway Enforcement

Bikes respect oneway=yes tags just like cars, preventing dangerous wrong-way routing on divided roads and busy streets.

This critical safety feature ensures the routing engine never suggests illegal or dangerous wrong-way navigation on one-way streets.

Legal Compliance

Footpaths are heavily penalized (0.01× multiplier) to avoid illegal routing while allowing minimal necessary connections.

Routes respect Victorian cycling laws by avoiding footpaths except where they legally function as shared paths or when no other connection exists.

Surface Neutrality

All surfaces (paved, gravel, dirt, unpaved) are treated equally with no penalties, ensuring access to Victoria's extensive gravel and rail trail network.

The routing engine doesn't discriminate against unpaved paths, making it ideal for touring and adventure cycling on rail trails and mixed-surface routes.

Elevation Support

MMAP-based elevation data provides accurate route profiles showing climbs and descents, helping you plan for hills on your ride.

Elevation profiles are displayed in the route planner, showing total ascent/descent and the gradient profile throughout your journey.

Per-Segment Profile Routing

Roads aren't uniform - a single street might have protected lanes on one section and no infrastructure on another. Our per-segment profiling analyzes infrastructure changes within individual roads:

  • Infrastructure Changes: Where protected lanes start/end mid-road
  • Surface Quality: Transitions between paved and unpaved sections
  • Road Class Changes: When a route transitions between road types

This granular approach ensures routes don't just look at road names, but understand the actual riding experience on every segment - critical for accurate navigation in Victoria's mixed infrastructure network.

What We're Working On

🚧 Elevation Optimization

User preferences for elevation: avoid hills, prefer flat routes, or don't care. Balancing elevation gain with route distance.

🚧 Dynamic Weighting Refinement

Fine-tuning the weight multipliers for each infrastructure type based on real-world user feedback and GPS trace data.

🚧 Real-Time Hazard Routing

Incorporating community-reported hazards, construction, and seasonal conditions into routing decisions to avoid problem areas.