Aps Project
Aps Project
Navigating through a metro system can often be a daunting task for commuters, particularly in unfamiliar areas
or during peak hours when congestion is prevalent. Existing navigation solutions may lack the efficiency or
adaptability required to address dynamic conditions such as delays or disruptions within the metro network. Thus,
there exists a compelling need for a sophisticated navigation application capable of delivering accurate route
suggestions and real-time updates to ensure a seamless commuting experience for metro travelers.
INTRODUCTION:
Objective :
The objective of a genetic algorithm is to solve optimization problems by simulating the process of natural
selection and evolution.
Motivation:
The motivation behind the "DIJI-YATRA" project stems from the need to assist travelers in planning their
journeys more effectively. Traveling between cities often involves multiple transportation options, and
determining the optimal route considering both distance and cost can be complex. This project aims to simplify
this process by providing users with a tool to easily find the shortest path and lowest cost among the available
transportation modes.
Contribution:
Code Implementation : Ayush Tiwari, Aryan Kumar, Sankritya Shukla, Yakshit Chawla
Research and Modelling : AyushTiwari , Aryan Kumar
Improvisation : Sankritya Shukla, Yakshit Chawla
Project Description:
DIJI-YATRA is a comprehensive travel planning system designed to assist travelers in finding the most optimal
routes and cost-effective transportation options between cities. The project utilizes Dijkstra's algorithm, a well-
known graph search algorithm, to calculate the shortest path and minimum cost between cities entered by the
user. By integrating dynamic fare systems for bus, train, and metro travel, DIJI-YATRA offers flexibility and
adaptability to changing transportation costs.
*Key Features:*
1. *Interactive User Interface:* DIJI-YATRA provides an intuitive and user-friendly interface where travelers
can input their desired source and destination cities, select their preferred mode of transportation, and receive
detailed information about their journey.
2. *Dynamic Fare System:* The project incorporates a dynamic fare system for bus, train, and metro travel,
allowing users to set the fare rates based on current transportation costs. This feature ensures accurate cost
estimation for travel planning.
3. *Dijkstra's Algorithm Implementation:* DIJI-YATRA employs Dijkstra's algorithm to find the shortest path
between cities in a graph representing the connectivity between them. This algorithm efficiently calculates the
optimal route considering both distance and cost factors.
4. *Password-Protected Admin Access:* The project includes a password-protected admin interface that allows
authorized users to update transportation fares. This feature ensures security and control over fare adjustments,
maintaining the integrity of the system.
5. *Random Ticket Generation:* DIJI-YATRA generates unique ticket numbers for each mode of transportation
using random number generation. This feature enhances ticket authenticity and traceability, providing users with
reliable ticketing information.
6. *Comprehensive Output:* Users receive comprehensive output detailing the optimum mode of transportation,
total distance, total cost, shortest path, and unique ticket numbers for their journey. This information empowers
travelers to make informed decisions and plan their trips efficiently.
*Benefits:*
- *Efficiency:* DIJI-YATRA streamlines the travel planning process by providing users with accurate and reliable
information about the shortest path and lowest cost between cities.
- *Cost-Effectiveness:* By considering both distance and transportation fares, the project helps travelers
minimize their transportation expenses, making travel more affordable.
- *Convenience:* The user-friendly interface and comprehensive output of DIJI-YATRA offer convenience and
ease of use, allowing travelers to plan their journeys quickly and efficiently.
- *Flexibility:* The dynamic fare system and ability to choose from multiple modes of transportation give users
flexibility in tailoring their travel plans to meet their specific needs and preferences.
Implementation:
Workflow Diagram:
Project Code:
#include <iostream>
#include <vector>
#include<algorithm>
#include <limits>
#include <string>
#include <random>
class Dijkstras
private:
vector<vector<int>> graph;
int number_of_vertices;
public:
void accept(int n)
number_of_vertices = n;
if (i != j)
cout << "\t\t\tEnter distance between city " << i + 1 << " and city "
<< j + 1 << ": ";
void display()
cout<<endl;
distance[source - 1] = 0;
min_distance = distance[j];
min_index = j;
}
}
visited[min_index] = true;
vector<int> shortestPath;
shortestPath.push_back(current);
current = path[current];
reverse(shortestPath.begin(), shortestPath.end());
};
int main()
cout<<CYAN<<"\t\t\t\t\t\tWELCOME"<<endl;
cout<<GREEN<<"\t\t\t\tJAYPEE INSTITUTE OF INFORMATION TECHNOLOGY-128"<<endl;
cout<<"\n";
cout<<YELLOW<<"\t\t\t\t\t\tProject"<<endl;
cout<<"\t\t\t\t\t"<<" DIJI-YATRA\n";
string password;
string role;
int number_of_vertices = 0;
cout<<endl;
while (true)
cout<<endl;
if (role == "exit")
break;
cout<<endl;
if (role == "admin")
{
if (password == "admin123")
cout<<endl;
busObj.accept(number_of_vertices);
busObj.display();
trainObj.accept(number_of_vertices);
trainObj.display();
metroObj.accept(number_of_vertices);
metroObj.display();
else
continue;
if (password == "cust123")
{
cout << "\t\t\t\t\tAccess granted to customer." << endl;
cout<<endl;
int source = 0;
int destination = 0;
cout<<endl;
vector<int> shortestPath;
random_device rd;
mt19937 gen(rd());
if (useBus == "yes")
shortestPath = result.second;
cout << "\t\t\tYour bus ticket number is: " << dis(gen) << endl;
cout<<endl;
minPrice = busPrice;
minTransport = "bus";
if (useTrain == "yes")
minPrice = trainDistance;
minTransport = "train";
shortestPath = result.second;
cout << "\t\t\tThe shortest train distance between city " << source
<< " and city " << destination << " is: " << trainDistance << endl;
cout << "\t\t\tYour train ticket number is: " << dis(gen) << endl;
cout<<endl;
minPrice = trainPrice;
minTransport = "train";
}
if (useMetro == "yes")
minPrice = metroDistance;
minTransport = "metro";
shortestPath = result.second;
cout << "\t\t\tThe shortest metro distance between city " << source
<< " and city " << destination << " is: " << metroDistance << endl;
cout << "\t\t\tYour metro ticket number is: " << dis(gen) << endl;
cout<<endl;
minPrice = metroPrice;
minTransport = "metro";
cout << "\t\t\tThe optimum price for travelling from city " << source <<
" to city " << destination << " is by " << minTransport << " and it is: " << minPrice <<
endl;
if (i < shortestPath.size() - 1)
else
continue;
return 0;
}
Result With Output Snippets:
Conclusion:
In conclusion, the "DIJI-YATRA" project successfully addresses the need for efficient and cost-effective travel
planning between cities. By implementing Dijkstra's algorithm and integrating dynamic fare systems for bus,
train, and metro travel, the project provides users with a reliable tool to find the shortest path and lowest cost
among available transportation options.
The project's interactive user interface offers convenience and ease of use, allowing travelers to input their desired
cities, select their preferred mode of transportation, and receive detailed information about their journey, including
the optimal route, total distance, total cost, and unique ticket numbers.
Furthermore, the password-protected admin access ensures security and control over fare adjustments, while the
random ticket generation feature enhances ticket authenticity and traceability.
Overall, the "DIJI-YATRA" project contributes to streamlining travel planning processes, empowering travelers
with the information needed to make informed decisions and facilitating smoother journeys between cities. With
its comprehensive features and user-friendly interface, the project serves as a valuable tool for travelers seeking
optimal routes and cost-efficient transportation options.
References:
A. Dijkstra, "A note on two problems in connexion with graphs," Numerische Mathematik, vol. 1, no. 1,
pp. 269–271, Dec. 1959. DOI: 10.1007/BF01386390
M. X. Goemans and D. P. Williamson, "Improved approximation algorithms for maximum cut and
satisfiability problems using semidefinite programming," Journal of the ACM (JACM), vol. 42, no. 6, pp.
1115–1145, Nov. 1995. DOI: 10.1145/227683.227684
J. M. VanBriesen, "Solving shortest path problems with fast marching methods," IEEE Transactions on
Robotics, vol. 21, no. 2, pp. 228–238, Apr. 2005. DOI: 10.1109/TRO.2004.839254
M. Bell and T. Gorini, "Traveler information systems: Traveler response to real-time information,"
Transportation Research Record, vol. 1748, no. 1, pp. 25–33, Jan. 2001. DOI: 10.3141/1748-04
S. C. Wirasinghe and S. A. Morlok, "Development and testing of a multimodal traveler information and
guidance system," Transportation Research Record, vol. 1266, no. 1, pp. 157–164, Dec. 1990. DOI:
10.3141/1266-19