An Academic AI/ML Mini-Project for Intelligent Tourism Recommendation & Constraint-Based Itinerary Optimization
Maharashtra Smart AI Travel Itinerary Planner is a full-stack, genuine Python AIML-powered travel technology application designed for academic demonstration and real-world utility.
Unlike conventional static tourism websites that present hardcoded lists, this application executes a Multi-Dimensional Content-Based Filtering Algorithm using Cosine Similarity, weighted multi-criteria heuristic scoring, and constraint-based timeline scheduling across 10 authoritative Maharashtra tourism destinations, 80 attractions, 30 activities, 33 verified routes, 30 restaurants, and 30 hotels.
- Genuine Python AIML Recommendation Engine:
- Computes Cosine Similarity in an 11-Dimensional Feature Space (
nature,adventure,history,religious,beach,wildlife,food,shopping,photography,relaxation,family). - Dynamically vectorizes user preferences and applies travel-group heuristic biases (
Solo,Couple,Family,Friends).
- Computes Cosine Similarity in an 11-Dimensional Feature Space (
- Explainable AI (XAI) Rationales:
- Generates transparent natural language explanations and match percentages for why each attraction is recommended.
- Constraint-Based Chronological Itinerary Optimizer:
- Auto-generates structured day-by-day vertical timelines adhering to user pace, opening/closing hours, transit buffers, and meal breaks.
- 5-Category Budget Optimization Engine:
- Calculates expenses across Stay, Dining, Entry Fees, Activities, and Local Transport, auto-suggesting budget optimizations when user budget constraints are exceeded.
- Interactive Mapping & Geospatial Visualization:
- Dynamic Leaflet.js route maps showing numbered attraction pins, interactive popups, and route connecting polyline segments.
- Executive PDF & JSON Export:
- Generates downloadable high-resolution formatted PDF reports using
reportlab.
- Generates downloadable high-resolution formatted PDF reports using
- Administrative Dashboard & Full Entity CRUD:
- Manage destinations, attractions, hotels, restaurants, routes, and update ML feature vector matrices with live slider controls.
- Feedback & Recommender Tuning Loop:
- Logs 1-to-5 star user ratings to refine feature weights.
Each attraction ( j ) is characterized by an 11-dimensional feature vector (\vec{A}_j \in [0, 1]^{11}). The user profile is transformed into a normalized preference vector (\vec{U} \in [0, 1]^{11}) adjusted by travel companion biases:
The total attraction fitness score ( S_j ) blends content similarity with empirical signals:
| Factor | Weight ( |
Description |
|---|---|---|
| Interest Similarity | 35% (0.35) | Cosine similarity on 11-D preference vector |
| Attraction Rating | 20% (0.20) | Normalized visitor review rating ( |
| Budget Fitness | 15% (0.15) | Entry fee compatibility with daily per-person budget |
| Popularity Fit | 10% (0.10) | High (1.0), Medium (0.70), Low (0.40) weight |
| Duration Fit | 10% (0.10) | Compatibility with travel pace (Relaxed, Moderate, Fast-paced) |
| Route Proximity | 10% (0.10) | Regional cluster corridor proximity score |
+-----------------------------+
| Web Client (Browser) |
| (Tailwind UI, Leaflet, JS) |
+--------------+--------------+
| HTTP / REST
v
+-----------------------------+
| Flask Application |
| (App Factory & Blueprints)|
+---+-------+-------+-----+---+
| | | |
+--------------------------+ | | +--------------------------+
| | | |
v v v v
+------------------+ +----------------------+ +--------------------+
| Public & Auth | | AIML Recommender | | Itinerary Engine |
| - Login / Reg | | - 11-D Vectorizer | | - Chrono Scheduler |
| - Explore / Det | | - Cosine Similarity | | - Route Calculator |
| - Admin CRUD | | - XAI Rationale Gen | | - Budget Optimizer |
+--------+---------+ +----------+-----------+ +---------+----------+
| | |
+----------------------------------+---------------------------------------+
|
v
+-----------------------+
| SQLAlchemy Engine |
| (SQLite / MySQL DB) |
+-----------+-----------+
|
v
+-----------------------+
| Authoritative Dataset |
| (JSON Tourism Matrix) |
+-----------------------+
maharashtra_travel_planner/
βββ config.py # Configuration & ML Weights
βββ app.py # Application factory & Blueprint loader
βββ seed_database.py # Standalone DB seeder CLI
βββ test_app_endpoints.py # 7-module automated test suite
βββ test_recommender.py # ML Recommender unit test
βββ test_demo_scenario.py # Mahabaleshwar demo scenario test
βββ requirements.txt # Production dependencies
βββ .env.example # Environment configuration template
βββ data/
β βββ maharashtra_travel_data.json # Authoritative 10-destination dataset
βββ database/
β βββ db.py # SQLAlchemy db instance
β βββ seed_data.py # Comprehensive seeder script
βββ models/
β βββ __init__.py # Model exports
β βββ tourism.py # Destination, Attraction, Route, Hotel, Restaurant
β βββ ml_features.py # 11-D ML Feature Vectors
β βββ user.py # User, UserPreference, Favorite
β βββ trip.py # Trip, Itinerary, ItineraryItem, UserFeedback
βββ ml/
β βββ __init__.py
β βββ feature_engineering.py # Vector normalization & companion bias
β βββ model_utils.py # Cosine similarity & subscore math
β βββ explanations.py # Explainable AI (XAI) generator
β βββ recommender.py # Multi-criteria recommendation engine
βββ itinerary/
β βββ __init__.py
β βββ router.py # Transit distances, travel times, transport costs
β βββ scheduler.py # Chronological timeline & meal insertion
β βββ budget.py # 5-category budget breakdown & optimizer
β βββ optimizer.py # Master end-to-end optimizer orchestrator
βββ routes/
β βββ __init__.py
β βββ auth_routes.py # Authentication & preference updates
β βββ public_routes.py # Landing, Explore, Details, About
β βββ planner_routes.py # 3-step Planner flow & feedback
β βββ api_routes.py # REST JSON endpoints & AJAX
β βββ admin_routes.py # Admin control panel & entity CRUD
β βββ export_routes.py # ReportLab PDF & JSON exporter
βββ static/
β βββ css/ # style.css, timeline.css, animations.css, admin.css
β βββ js/ # main.js, planner.js, map.js, recommendations.js, admin.js
βββ templates/
βββ base.html # Master layout with navbar & footer
βββ index.html # Landing page with hero & counters
βββ explore.html # Destination catalog
βββ destination_detail.html # Destination deep-dive guide
βββ about.html # AIML documentation & formula
βββ 404.html & 500.html # Error pages
βββ auth/ # login.html, register.html
βββ planner/ # create_trip.html, recommendations.html, itinerary.html, edit_itinerary.html
βββ trips/ # my_trips.html
βββ admin/ # dashboard.html, crud_list.html, edit_*.html
- Python 3.10+ installed
- Git (optional)
cd "C:\Users\Atharva Mane\.gemini\antigravity\scratch\maharashtra_travel_planner"pip install -r requirements.txtPopulates all 10 destinations, 80 attractions, 80 ML feature vectors, 30 activities, 33 routes, 30 hotels, 30 restaurants, and default accounts:
python seed_database.pypython app.pyOpen http://127.0.0.1:5000 in your browser.
| Account Role | Email Address | Password | Privileges |
|---|---|---|---|
| System Admin | admin@maharashtra.ai |
Admin@12345 |
Full CRUD, ML feature editor, Analytics |
| Demo Traveler | traveler@example.com |
Traveler@123 |
Create trips, Save itineraries, Feedback |
(Or click the 1-click Quick Login buttons on the Sign In page!)
To demonstrate the system live for academic reviewers:
- Click "Run Mahabaleshwar Demo" or navigate to Plan Itinerary.
- Click "β¨ Load Demo Preset (Mahabaleshwar Friends Trip)":
- Destination: Mahabaleshwar (Western Maharashtra)
- Duration: 3 Days
- Budget: βΉ12,000
- Group: Friends (4 Travelers)
- Interests: Nature + Adventure + Photography
- Daily Window: 08:00 β 20:00
- Hotel Preference: Mid-range
- Click "Run AIML Recommender & Generate Itinerary".
- Observe the Animated Multi-Step AI Processing Screen simulating vector analysis.
- Review top recommendations (Pratapgad Fort, Arthur's Seat, Elephant's Head Point, Venna Lake) with 94%+ match scores and Explainable AI (XAI) rationale badges.
- Click "Build Complete Timeline Itinerary" to view:
- Chronological vertical timeline with breakfast, lunch, and dinner stops.
- Interactive Leaflet map with route pins.
- 5-category budget breakdown chart.
- 1-click "Download PDF Itinerary".
Run all automated unit and integration tests:
# Run Recommender Engine Unit Test
python test_recommender.py
# Run Demonstration Scenario Test
python test_demo_scenario.py
# Run Full 7-Module Flask Test Suite
python test_app_endpoints.pyThe dataset covers 10 diverse tourism regions across Maharashtra:
- Lonavala (Western Maharashtra / Pune) β Hill station, Forts, Caves, Waterfalls
- Mahabaleshwar (Western Maharashtra / Satara) β Sahyadri viewpoints, Strawberries, Heritage forts
- Matheran (Konkan / Raigad) β Eco-sensitive hill station, Forest trails, Heritage Toy Train
- Alibaug (Konkan / Raigad) β Coastal beaches, Sea forts, Water sports
- Tarkarli (Konkan / Sindhudurg) β Scuba diving, Coral reefs, Pristine backwaters
- RatnagiriβGanpatipule (Konkan) β Coastal temples, Mango orchards, Forts
- Nashik (North Maharashtra) β Vineyards, Godavari Ghats, Jyotirlinga pilgrimage
- Kolhapur (Southern Maharashtra) β Mahalakshmi Temple, Palace architecture, Cuisine
- Chhatrapati Sambhajinagar (Marathwada) β UNESCO World Heritage Ajanta & Ellora Caves
- TadobaβAndhari Tiger Reserve (Vidarbha / Chandrapur) β Tiger safaris, Wildlife sanctuary
Β© 2026 Maharashtra Smart AI Travel Planner. Built with Python, Flask, Scikit-Learn & ReportLab.