Skip to content

AffanMhz/maze_algorithm_visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Comprehensive Maze Algorithm Analyzer

A competition-grade web-based tool for analyzing and comparing maze exploration algorithms, specifically designed for the eYRC 2025-26 Maze Solver Bot challenge with revolutionary ultra-optimized algorithms.

๐Ÿ† BREAKTHROUGH: Competition-Winning Algorithms

After extensive research and analysis, we've implemented research-proven algorithms that consistently outperform complex alternatives:

๐Ÿฅ‡ Enhanced Left-Hand Rule

  • Mathematically guaranteed to explore all reachable areas
  • Never gets stuck in loops - proven by topology theory
  • Consistent 90-step performance with 6+ dead end discovery
  • Based on Wikipedia's #1 recommended maze algorithm

๐Ÿฅˆ Enhanced Recursive Backtracking

  • Systematic depth-first exploration with perfect memory
  • Guaranteed to visit every accessible cell exactly once
  • Proven algorithm from computer science literature
  • Optimal for complete maze coverage

๐Ÿฅ‰ Enhanced Trรฉmaux Algorithm

  • 19th century algorithm proven to work on all mazes
  • Marking system prevents infinite loops mathematically
  • Used as foundation for modern depth-first search
  • Guaranteed path-finding with optimal backtracking

๐ŸŽฏ Optimized Dead End Hunter

  • Targets specific dead end positions with systematic exploration
  • Combines proven wall-following with strategic targeting
  • Multi-mode exploration for comprehensive coverage
  • Designed specifically for eYRC competition scoring

๐Ÿ“Š Performance Analysis Results

Why Simple Algorithms Win:

  • Left-Hand Rule: 92 steps, 6/9 dead ends โœ…
  • Recursive Backtrack: 92 steps, 6/9 dead ends โœ…
  • Complex "Perfect Score": 250 steps, 1/9 dead ends โŒ

Key Insight: Mathematical simplicity and proven theory beat complex heuristics!

Purpose

This tool helps you:

  • Visualize 16 different maze exploration algorithms in real-time
  • Compare performance across all algorithms for competition scoring
  • Test ultra-optimized variants designed for maximum marks
  • Calculate precise scores using the official marking scheme
  • Achieve winning performance with cutting-edge algorithms

Supported Algorithms (16 Total)

๐Ÿ† Ultra-Optimized Algorithms (Competition Ready)

  • Perfect Score Algorithm - BFS-based systematic exploration with optimal pathfinding
  • Intelligent Explorer - Advanced BFS with dynamic target selection and smart backtracking
  • Ultra-Efficient Wall Follower - Multi-mode adaptive exploration with pattern optimization
  • Strategic Dead-End Seeker - Pre-computed pathfinding with adaptive targeting strategies

Memory-Free Algorithms (Hardware-Friendly)

  • Left-Hand Rule - Follow left wall consistently
  • Right-Hand Rule - Follow right wall consistently
  • Random Mouse - Random selection from available paths

Advanced Algorithms (Comparison & Learning)

  • Pledge Algorithm - Combines straight-line and wall-following
  • Trรฉmaux Algorithm - Mark paths to avoid cycles
  • Dead-End Filling - Eliminate dead ends iteratively
  • Recursive Backtracking - Systematic depth-first exploration
  • Flood Fill - Distance-based optimal pathfinding

Original Custom Algorithms

  • Optimized Dead-End Hunter - Efficiently targets all dead ends with precomputed paths
  • Smart Wall Follower - Enhanced wall following with turn optimization and dead-end prioritization
  • Hybrid Explorer - Multi-phase exploration strategy combining different approaches
  • Minimum Steps Explorer - Designed specifically for optimal step count using shortest path calculations

๐Ÿ Quick Start

  1. Open index.html in any modern web browser
  2. Select an algorithm from the dropdown menu
  3. Choose maze type (Given Maze 9ร—9 or Surprise Maze 8ร—8)
  4. Click "Start" to run the simulation
  5. Use "๐Ÿš€ Compare All Algorithms" for comprehensive analysis

๐Ÿ“ Accurate Maze Specifications

Given Maze (9ร—9)

  • Start Position: (4, 8) - Bottom center, facing North
  • Exit Position: (4, 0) - Top center
  • Dead Ends: 9 total
  • Optimal Steps: 112
  • Max Score: 20 marks

Surprise Maze (8ร—8)

  • Start Position: (3, 0) - Top center, facing South
  • Exit Position: (4, 7) - Bottom center
  • Dead Ends: 5 total
  • Optimal Steps: 110
  • Max Score: 10 marks

๐ŸŽฎ Features

Real-Time Visualization

  • Interactive maze grid with proper wall representation
  • Animated bot movement with directional indicators
  • Path tracking showing visited cells and dead ends
  • Coordinate display toggle for precise positioning

Algorithm Logic Display

  • Sensor readings (Left/Front/Right wall detection)
  • Decision process step-by-step explanation
  • Algorithm state for complex algorithms
  • Memory usage visualization for advanced algorithms

Performance Metrics

  • Live step counting with efficiency tracking
  • Dead end discovery progress monitoring
  • Real-time score calculation using official formula
  • Completion status and success indicators

Comprehensive Comparison

  • Multi-algorithm testing across both mazes
  • Performance ranking with detailed statistics
  • Score analysis for both Given and Surprise mazes
  • Hardware implementation recommendations

๐Ÿ† Scoring System

The tool uses the official eYRC marking formula:

Score = MaxMarks ร— (DeadEndsExplored/TotalDeadEnds) ร— min(OptimalSteps/ActualSteps, 1)

Given Maze (20 marks)

  • Exploration Component: DeadEndsFound / 9
  • Efficiency Component: min(112 / Steps, 1)

Surprise Maze (10 marks)

  • Exploration Component: DeadEndsFound / 5
  • Efficiency Component: min(110 / Steps, 1)

๐Ÿ”ง For Verilog Implementation

Recommended Algorithms

  1. Left-Hand Rule - Most reliable for complete exploration
  2. Right-Hand Rule - Alternative wall-following strategy
  3. Random Mouse - Backup option (less predictable)

Implementation Notes

  • Memory-free algorithms are ideal for hardware constraints
  • Wall-following logic translates directly to sensor-based decisions
  • Two-cycle timing must be considered for Verilog FSM design
  • Complete dead-end exploration is crucial for maximum marks

๐ŸŽฏ Strategy for Full Marks

Based on analysis results:

  1. Prioritize exploration over speed initially
  2. Implement robust wall detection logic
  3. Ensure systematic coverage of all dead ends
  4. Optimize turn logic to minimize unnecessary moves
  5. Test thoroughly with both maze configurations

๐Ÿš€ Getting Maximum Benefit

  1. Run individual algorithms to understand their behavior
  2. Use the comparison tool to identify optimal strategies
  3. Study the decision logic for each algorithm step
  4. Analyze scoring patterns to optimize your approach
  5. Focus on hardware-friendly memory-free algorithms

๐Ÿ“‹ Technical Requirements

  • Modern web browser (Chrome, Firefox, Safari, Edge)
  • JavaScript enabled
  • No additional dependencies required
  • Responsive design works on desktop and tablet

๐Ÿ” Understanding the Visualizations

  • Green cell = Start position
  • Blue cell = Exit position
  • Light blue cells = Visited path
  • Red cells = Dead ends found
  • Yellow highlight = Current bot position
  • Gray mouse icon = Bot with directional facing

๐Ÿ“ˆ Interpreting Results

Excellent Performance (16-20/20)

  • High exploration ratio (7-9/9 dead ends)
  • Efficient pathfinding (steps close to optimal)
  • Likely to achieve full marks

Good Performance (12-16/20)

  • Moderate exploration (5-7/9 dead ends)
  • Room for optimization in efficiency
  • Solid foundation for improvement

Needs Improvement (<12/20)

  • Low exploration rate (<5/9 dead ends)
  • Focus on complete maze coverage
  • Review algorithm implementation

Built for eYRC 2025-26 | Optimized for Hardware Implementation | Maximum Scoring Potential

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published