Demo: https://www.youtube.com/watch?v=muAkncYRhTE
This Python application utilizes Flask and various libraries to provide travel recommendations based on user preferences and generate the optimal path for a trip using the Traveling Salesman Problem (TSP) solver.
Make sure you have the following installed:
- Python (3.x recommended)
- Required Python libraries (
pip install
):- Flask
- NetworkX
- Matplotlib
- Pandas
- Geopy
- Folium
- Requests
- Wikipedia-API
-
Clone the repository or download the code files.
-
Install the required dependencies:
pip install flask networkx matplotlib pandas geopy folium requests wikipedia-api
-
Run the application:
Navigate to the directory where the code is located and execute:
python main.py
main.py is the name of the Python file where your Flask application is defined.
-
Access the application:
Open a web browser and go to
http://localhost:5000
to access the application.
- Visit the home page to initiate the travel recommendation process.
- Enter your preferences (budget, weather, distance) and location.
- Receive recommendations based on your preferences.
- Choose cities and view the optimal path or explore them on the map.
main.py
: The main Flask application file.destinations1.xlsx
: Excel file containing destination information.templates
: Directory containing HTML templates for web pages.static
: Directory for static files (CSS, images, etc.).
getrec
: Retrieves recommended cities based on user preferences.find_tsp
: Finds the optimal path using the TSP algorithm.generate_tsp_graph
: Generates a visual representation of the optimal path using Matplotlib.create_map
: Creates an interactive map with recommended cities using Folium.
- The code utilizes destination data from an Excel file (
destinations1.xlsx
). Ensure the file is in the correct format and contains the necessary information. - Modify or replace the
get_coordinates1
function to fetch actual coordinates or integrate with a live location service if needed.
This application uses various Python libraries and APIs to provide travel recommendations and solve the TSP. Credits to their respective developers and communities for their contributions.