Math Ia Final
Math Ia Final
Math Ia Final
AI HL
1|P ag e
Finding the cheapest, fastest and shortest route for a South India Tour
Introduction
Travelling is one activity that is enjoyed by most because there are hundreds of reasons to do
it. It helps us explore places not only regionally but globally. I fell in love with travelling at a
young age because of the things I get to experience. The experiences teach me so much about
various cultures and activities, something which I have always been fond of knowing and
something which is thrilling for me. Because of the same reason, I decided to do my Internal
Assessment on this. Living in the north, I have always wanted to take a tour around southern
India since it is filled with such an ancient and distinct history, culture, locations and
communities which is why so many people want to visit the Deccan part of India. However,
when planning a trip there are many factors that need to be considered which can be barriers
to an efficient tour such as the cost and time if not considered thoroughly.
Tourists often tend to take readymade tour packages from various travelling agencies.
Southern India is a popular travel destination due to its beautiful landscapes, rich culture, and
heritage. While looking into the packages of Southern India trips offered by them, I found out
they are too expensive and way more than necessary and often limit people from taking the
trip. Tourism companies have a profit-making objective and tend to hike prices for the same
reasons. They also use expensive modes of transport to get some commission out of it. I
realised it would be more effective and cheap if I plan the trip and would cost me less to as I
will be looking into cost, time and distance to plan the trip. By doing this I would be able to
control the budget and schedule the trip according to my needs by comparing various modes
of transportation like bikes, cars and buses using the concept of graph theory.
The main goal of this inquiry is to determine the most affordable and efficient route
between the selected locations in Southern India, taking into account various
transportation options, trip costs, and commute times. I wanted to tour the whole of
southern India but then realised that Southern India is full of cultural knowledge which needs
time and just visiting them for the sake of it won’t be justice for them. Therefore, I chose the
states of Karnataka and Kerala first because they are closer to my city of Chikmangaluru,
from where I will start my journey and are good starting places because of their rich cultures
and traditions.
People travelling tend to be restricted by a financial budget which limits them from taking a
tour. Another factor is the time limit as people travelling are always on a time crunch due to
2|P ag e
limited holidays. Because of these reasons, it becomes even more important to limit the
factors and find the optimal route. This excites me from a mathematical standpoint since
graph theory employs algorithms and mathematical patterns to analyse a network with several
vertices and the relationships between them. Graph theory gives us the artillery to analyze
various points and their respective edges. In the Internal Assessment, the vertices will form
my destinations and the edges will be the various edges. The tour will include the most
famous and visited destinations in the eastern part of Southern India, specifically from the
states of Karnataka and Kerala.
Exploration
Methodology
I will be using graph theory in this exploration to find the most optimal route. The Traveling
Salesman problem and other pertinent algorithms will be used in the report to determine the
most practical and direct route between each vertex, which are my destinations. Given below
are the steps that consist of the steps of the mathematical investigation.
1. Use primary data through surveys to find out the factors which are most important to
people while travelling.
2. Research the approximate time and cost needed to travel from one destination to
another using google maps and secondary resources.
3. Apply graph theory algorithms to determine the best path between the vertices and
back to the starting point.
4. Determine the price and duration of various modes of transportation to recommend
the most appropriate one depending on the traveler's preferences.
3|P ag e
Primary Research: -
When working on deciding the tourist locations, I realized that that route is not only for me
but also for the people who want to take a tour. Hence, I decided to create a survey to ask
people about their travel preferences and their opinions on different modes of transport, and
the major factors to consider when going for a tour. I was also going to ask about the places
to visit in the whole of Southern India, but then realized that it would be too broad, and hence
decided to narrow it down to the eastern part of Southern India as they are rich in their culture
traditions. I sampled and surveyed people of all ages around me and travellers travelling
regularly and occasionally by giving out Google forms surveys on social media platforms. In
this survey, not only did I take into consideration the objective questions with options but had
a subjective question as to why they choose what they choose. This gave me a better
understanding of the needs of the people and I could focus on the points I identified.
I chose to create routes based on all kinds of transportation after considering the findings
which are - car, bus and bike because different age groups had different preferences. The
younger group preferred travelling by bike and car as they are mostly with their friends when
travelling and love the journey of travelling. The people in their 40s also preferred the car as
their primary mode of transport because of travelling with their family and the independence
of enjoying the journey. Though the most favoured was the bus as they are the cheapest and
are comfortable nowadays due to the improved roadways and the types of buses. See the table
below:
Figure 1: Table for preferred transport and priorities
Age Group Type of Transport Priorities
18-30 Car and bike Cost
30-50 Car and bus Cost and Time
50 and above Bus Cost
4|P ag e
Figure 2: 1st Question
Since all the modes had similar results, I decided to compare each and everyone and not
choose on basis of the preference. I also observed that most people value the cost of the travel
irrespective of their ages. There were people in the prime working age who prioritized time
too as they will be taking the tour by taking leave from their work and don’t have a lot of
time to spare. For them, time mattered more than the journey. Distance was the least of
concerns for the sampling group as we can see in figure 3 below:
5|P ag e
Investigation
Figure 4: Map of the trip
I can now use this graph to construct a Hamiltonian circuit. In a graph, a Hamiltonian circuit
is a path that exactly travels each node once while beginning and ending at the same vertex.
To put this into perspective, it would entail starting and terminating at the same place and
visiting each stop on the tour exactly once.
According to Dirac’s theorem, a Hamiltonian circuit can only be created if it satisfies these
conditions: -
𝑛
1. Each vertex has a degree of at least 2
Figure 4's map meets the second requirement since n=10 there. It is a complete graph with n-
𝑛
1 degrees for each vertex and a degree of 9 for the entire graph, which is higher than =5.
2
This indicates that both requirements are satisfied and a Hamiltonian circuit may be built.
Despite the fact that this graph can contain a number of Hamiltonian circuits, determining the
best and the shortest Hamiltonian cycle requires using the Travelling Salesman Problem
(TSP). The shortest path through a group of provided destinations must be found, traversing
1
"Math Insight." Math Insight, mathinsight.org/definition/graph_vertex.
6|P ag e
each destination exactly once before returning to the starting point. This is known as the TSP.
The TSP aids in locating the smallest Hamiltonian cycle within a weighted graph. A weighted
graph is a graph in which each branch is given a numerical weight2. Therefore, in this case,
we must first choose the weights for each graph. Each edge of a graph is assigned a weight
depending on factors like time, distance, or cost. In order to solve the TSP, I'll choose the
weights for six distinct graphs. The 6 graphs' weights will change according to: Cost of
travelling by car
In order to express the weights, a cost adjacency matrix will be used. A square matrix
known as an adjacency matrix shows the weights of each edge between the corresponding
vertices in the matrix. This is demonstrated in the image that is displayed. This pattern
may or may not be shown in these cost adjacency matrices because the journey may have
different prices in this situation when travelling back and forth. This trend can be seen in
the majority of the costs, making the problem a symmetric travelling salesman problem.
Because it takes the same amount of time to go from one point to another, the time
matrices are also symmetric. A diagonal also exists in the square matrix which has no
values since there are no loops. (edges AA and CC don’t exist).
In graph theory, an adjacency matrix is nothing but a square matrix utilised to describe a
finite graph3. The following cost adjacency graphs were made for each method of
transportation, along with the time and cost, after doing research from Google Maps, Red
Bus, IRCTC, and similar websites providing booking information. This was a
2
"Weighted Graph." Wolfram MathWorld: The Web's Most Extensive Mathematics Resource, 10 Jan. 2000,
mathworld.wolfram.com/WeightedGraph.html.
3
"Adjacency Matrix." BYJUS, 3 Apr. 2019, byjus.com/maths/adjacency-matrix.
7|P ag e
fundamental part of my investigation since the aim was to optimize the cost and time to
get minimum values for the tour.
A- Bangalore
B- Madikeri
C- Chikmagalur
D- Sakhleshpur
E- Dandeli
F- Munnar
G- Gokarna
H- Mysore
I- Hampi
J- Mangalore
Figure 5: All destinations on map
A B C D E F G H I J
8|P ag e
Figure 7: Time between places by Car( in hours.minutes)
A B C D E F G H I J
The aforementioned cost-adjacency matrices were built based on the typical distance between
each vertex and cost because those costs can change based on the present petrol cost. The
values were calculated based on the distances between each vertex and at an average mileage
of 15km/L of petrol at a current price of RS.102 rounded up or down to the nearest tenth.
Since the prices are also based on the time of year the reservation is made, and the number of
days before the actual bus departure, and are subject to change, these numbers might not be
entirely correct. The statistics in the adjacency tables don't display exact values because they
are all estimates based on the wide variety of buses and travel providers available. The
appendix contains the remaining cost adjacency matrices for buses and railways.
We can utilise the TSP algorithms to identify the cheapest and the least time taking path for
each graph now that we have these weights. A few of the algorithms developed to solve the
9|P ag e
TSP are the closest neighbour algorithm, the deleted vertex algorithm, dynamic
programming, brute force, and the branch and bound algorithm. But in the brute force
approach, branch and bound method, and dynamic programming, every Hamiltonian circuit
possible has to be jotted down;
(𝑛−1)!
The formula to know the number of Hamiltonian circuits possible is = 2
9! 362880
→2 = = 181440
2
As we can see from the calculation, there are 181440 potential Hamiltonian graphs in this
graph. It would be irrational for me to carry out so many combinations using these algorithms
with all six graphs. To identify the cheapest path, I will thus employ the deleted vertex
technique and the closest neighbour approach. As the technical means by which the best path
will be found, selecting the algorithms was a crucial component of this inquiry.
The cost and time adjacency matrix is used by this approach to create a route that places the
least weight on the edges. We generally start from the point with the least edge with the least
weightage, therefore I chose Chikmagalur (vertex C) as the starting point. There is also
another reason behind it as my grandparent’s house is in Chikmagalur and I will be taking the
journey from this point only. Since the closest neighbour approach aids in determining the
upper bound for the TSP, other algorithms often offer a smaller weight that might not be
adequate. This would give us the most accurate cost and time estimates. There are certain
steps are involved in order to find the nearest neighbour for the adjacency matrix: -
Given below is a demonstration of the algorithm of the first adjacency matrix of the costs by
car(in Indian Rupees) costs by car(in Indian Rupees):
10 | P a g e
Figure 8: Costs by car TSP(in Indian Rupees)-Order in the subscript and highlighted
A B C D E F G H I J
A weighted and directed Hamiltonian circuit that may be utilised as one of the tour routes has
now been created by the algorithm. In order to optimise and identify the best path, the same
11 | P a g e
process was carried out again for the remaining six adjacency matrices. The following is
another illustration of the same procedure for the cost adjacency matrix of the time spent by
cars:
Figure 10: Time by car TSP(in hours.minutes)-Order in the subscript and highlighted
A B C D E F G H I J
12 | P a g e
The routes that were determined based on time and distance varied from one another. This
suggests that those who value time should choose a particular route, while those who value
money should choose a different one. Before choosing a route, alternative algorithms are
necessary since they can be less expensive or take less time. As a result, this method offered
me a full understanding and helped me determine the upper bound of the ideal path for
time/cost of the trip on each graph, which helped me go closer to realising the goal of the
inquiry. The upper bound gave us the maximum time and cost a traveller can expect while
taking this tour which prepares them with a mindset whether or not to go on this journey.
Instead of using the cost adjacency matrix, this technique makes use of the graph. Given that
this is intended to be the lower bound for the Hamiltonian circuit, it can be anticipated that
the total time/cost of trip achieved using this approach will be lower than that of the prior
algorithm and hence more efficient in terms of cost and time. This method involves
eliminating a vertex and all associated edges in order to get the shortest path.
There are several steps in order to conduct the Deleted vertex algorithm:
1. Delete any vertex and all the edges attached to that node.
2. Find the minimum spanning tree of the remaining edges using either Prims or
Kruskal’s algorithm. Then total up the weights of the minimum spanning tree.
3. Add the weights of the two least edges of the deleted vertex to the total calculated in
step 2.
Here is an example of the method on the graph using the cost of a vehicle trip. Due to its
lesser values compared to the other vertices
and general centrality, vertex C was the
first to be removed. I was able to depict the
algorithm effectively by using Google
Drawing to make the following diagrams..
Figure 12: Deleting vertex C(lower bound)- Red lines are the deleted vertex’s edges
13 | P a g e
Figure 13: Steps of deleting the vertex
Figure 14(a): Final minimum spanning tree Figure 14(b): Least minimum spanning tree
with red being the least weighted edges
The shortest-spanning tree using the algorithm is shown in the figure above. We now add the
smallest edges of the deleted vertex C to keep the magnitude of the spanning tree the least.
Adding the edges CD and CB we get a total of 10460+400+990= 11850. Therefore, our
minimum cost needed in travelling for the tour by car will be Rs. 11850.
The total cost = Rs. 11850; which is lower than the weightage found out by using the nearest
neighbour algorithm. But I soon realised that other vertices may also be deleted, and because
the method doesn't say which vertex to delete, the values obtained would differ from one
another. I again ran the algorithm on another vertex D to check the vertex with the fewest
14 | P a g e
outcomes. The identical procedure is seen here, except this time it removes vertex D from the
cost of driving.
Figure 15(a): MSP using D vertex Figure 15(b): Final MSP using D vertex
With red being the deleted vertex with red being the least 2 edges
The overall cost, which is higher than the one obtained by eliminating vertex C, is Rs. 11900.
I used the same procedure on every vertex and discovered that Vertex C provides the lowest
value out of all of them. As a result, I came to the conclusion that this removed vertex should
be utilised in all graphs to determine the minimal value of the minimum spanning tree.
Using the same deleted vertex of C, I applied the algorithm for the time taken by the car.
We obtain the minimum spanning tree for it. After this add the two least edges from the
deleted vertex; edge CD and CJ. We take these 2 values since they are the smallest edges in
magnitude and add it to our total of 35.6 hours and minutes.
Therefore, the lower bound for the time taken to travel by plane is 40 hours and 35 minutes.
Also while carrying out the calculations and deleting every vertex, I realised there is no cycle
formation. I was getting different lower bounds by deleting different vertices but every time
there was no cycle formation. Therefore the deleting vertex algorithm was not successfully
able to give us a final route of the cheapest and the best route for travelling.
15 | P a g e
Even though I have shown the lower bound with the least value, the best fit is the MSP with
the highest value. Therefore when carrying out my calculations, by deleting the vertex F I
was able to get the highest of the lower bounds which is the best fit as it gives us more
information about the route.
The lower bound provided us with the lowest time and cost it will take to travel to each place
but without forming a cycle which means without returning to your original place. It along
with the upper bound gives the travellers a range of how much time and money they can
expect to spend on this trip varying on basis of their choices. It is helpful when you are not
starting from your hometown but ending at it . As in this case I am from Mangalore, so my
final destination is also Mangalore at F which makes it suitable for me. This might not hold
true for a lot of people which is a limitation of this algorithm.
16 | P a g e
Results
Similar techniques were used to compare the routes and minimum weights determined based
on cost and time for all forms of transportation as well as for each of the 6 adjacency
matrices.Below are the results in a tabulated form.
17 | P a g e
Cost of Nearest C→ D → B → H → A → I → E → G → J 4280
travelling Neighbour(Upper →F→C
by bike Bound)
Deleted BD, DJ, BH, HA, JG, GE, EI, HF + CD + 2920
Vertex(Lower CB
Bound)
Time Nearest Neighbour C→ D → B → H → A → I → E → G → J 53 hours
taken by →F→C and 30
bike minutes
Deleted BD, DJ, BH, HA, JG, GE, EI, HF + CD + 37 hours
Vertex(Lower CB and 58
Bound) minutes
It can be seen from this table that all deleted vertex algorithms routes are the same:
I also realised that there will be buffer time in between when we will not travel which will
add up to the duration of the tour. Therefore, the total number of days can be found out by
finding this buffer time included in our daily routine and the amount of time spent at each
vertex. Following are the things that might take extra time other than travelling:
3 hours every day for travelling to and from for meals and eating time
1 hour up and down from the hotel
8 hours of sleep every night
3 hours of resting time in between places and exploring the area(downtime)
24 - 3 - 1 - 8 - 3 = 9 hours
This demonstrates that there are 9 hours left each day to engage in tourist activities.
Additionally, we can consider the fact that each location is visited for five hours. These 9
hours a day, are set aside for travelling and spending time at the destination
including everything other than the buffer time and daily routine activities mentioned above.
18 | P a g e
The travel time of each mode of transport was calculated by various algorithms using
graph theory.
Each destination requires 5 hours of stoppage and there are 10 destinations, therefore
50 hours in total.
There are only 9 hours for travelling and time spent at the destination on a daily basis.
Therefore, the 9 hours every day must add up to the time travelled and time spent at
every destination.
Keeping these facts in mind, if the number of days of the trip was x,
As there are only 9 hours contributed to spending time at a destination and travelling each
day, which means there are 9x hours only for it. This has to include the time spent at every
location which is 5 hours per place and travel time. Now, since there are 10 locations it
comes up to 5×10=50.
Given that the journey duration is known to be 40.58 hours when using car as the
method of transportation, x = 10.06 and the tour may be estimated to last at least 11
days.
When the bus is used as the means of transportation, the known trip time is 42.57,
which results in x = 10.28 and may be understood as a minimum of 11 days once
more.
With a bike as the means of transportation, the estimated journey time is 37 hours
and 58 minutes; consequently, x = 9.77, or around 10 days for the tour.
These values are not 100% accurate because there may be some additional buffer time which
may not be accounted for such as travelling to bus stops and the waiting time involved and
etc. Tourists may also spend different amounts of time at the attractions which may be more
or less than 5 hours as estimated. In a similar way, the cost of the tour can also be
approximated apart from just the travel cost. Following are the approximate additional and
miscellaneous costs involved in the tour apart from the travelling cost: -
• Rs. 2000 a night in hotels (this varies depending on the quality of the location
visitors choose.)
19 | P a g e
1500 rupees for further unspecified items, as requested in the survey distributed to the
populace.
Also, we can also include Rs. 4000 approximately spent in each location for leisure spending,
souvenirs and entry tickets.
Therefore the total cost would add up to 4000 X the number of vertices or destinations +
5500 × the number of days on tour + the travelling cost. Taking the number of days as x, the
cost will differ based on the number of days travelled:
Because the journey lasts around 11 days while travelling by car, the estimated travel
expense is Rs. 11660. As a result, when these numbers are substituted, the total cost
equals Rs. 112160.
Since , the tour lasts around 11 days when taken by bus, and the associated travel
expense is Rs. 5330. Consequently, by replacing these figures, the final cost equals
Rs. 105830.
The tour lasts around 10 days while travelling by bike, and the cost of the trip is Rs.
2920. Thus, by swapping these figures, the final cost is equal to Rs. 97920.
Mode of transport Total duration of tour Total cost of tour (in rupees)
Car 11 112160
Bus 11 105830
Bike 10 97920
20 | P a g e
These calculations reflect the least time and cost a traveller can expect to pay and will help
them make up their mind whether or not to take the tour. The various priorities vary with
their costs and time.
21 | P a g e
Analysis and evaluation
It is clear that there are considerable differences between the total weights obtained using the
deleted vertex technique and the nearest neighbour procedure, with the former always being
lower than the latter. How ineffective the closest neighbour method was may be seen by the
fact that the routes regularly zigzagged without accounting for the fact that the graph was a
cyclic pattern.
The analysis's findings indicate that the nearest neighbour algorithm may not always be
accurate, especially in cyclic graphs where the points are more away from the next point
(below or above) than the one directly across from it (to the left or right). However, the
deleted vertex approach, which makes use of Prim's algorithm, somewhat relies on your own
judgement, which is why it was more useful for our inquiry. With a larger number of vertices,
it could be trickier to use. Both of these techniques were still helpful since they allowed me to
check that the final route I had obtained was the shortest one feasible by comparing it to other
potential routes.
Additionally, there could have been biases or inaccuracies in the data that changed the
outcomes. Because the cost of transportation tickets often changes throughout the year owing
to seasons, the economy, and various environmental factors, the average prices that were used
may not always be correct. The cost varies according to the bus brand as well. The final
estimate of the tour's total cost and length included estimates as well and was susceptible to
change based on a variety of criteria that the tourist's priorities and preferences.
Overall, I was able to get more insights about the travelling route. Although, I was not able to
find the final route due to mathematics being uncertain and not always being able to answer
all questions. Since there was no cycle formation in the MSP we tried to find out, I was
unable to find the cheapest and fastest route but was definitely able to get a range as to how
much a traveller can expect to spend their time and cost on the trip.
22 | P a g e
Conclusion
Therefore, the investigation was not able to provide us with the final cheapest and fastest
route. This is a limitation of mathematics in general that it is not always certain that we get
what we want. Although, it did help us by giving us a range to understand the cost and time
involved on basis of the priorities of the travellers.
There were certain other assumptions too which might hamper the results of the exploration.
For example, assuming that the cost and the time would remain would also be a blunder since
it’s ever-changing. There may be significant technological developments which alter the
timings and prices by a lot of the prices of petrol might increase. There may be a shift from
petrol to electric cars and buses in the future which might make the exploration irrelevant in
the future. The fact that I am assuming the number of hours required for touring a destination
might differ too as it is subjective as some people might want to spend more or less time at a
given place which will vary the cost and time.
Since we are not able to find a final route with these algorithms, we can do trial and error for
every route and find the shortest and cheapest route which might benefit all the travellers.
In light of the findings, travellers should select a mode of transportation depending on their
priorities and preferences. Given that the length of the tour also affects the overall cost, the
price rises the longer a visitor spends on the tour. As a result, the costs of all forms of
transportation are roughly equal, with cars having the highest per-person costs due to their
lengthy routes and bikes having the lowest. This may not be accurate, though, as meals may
occasionally be served on buses or in lodgings, etc. Based on the calculations, cars are not a
recommended mode of transport unless and until travelling with a family of 4 as the net
travelling cost then comes down significantly and the time taken is also more than any other
mode. Travelling by bike requires the least amount of time with the lowest cost although can
only accommodate 2 people at the max and family trips will not be possible with it. To sum
up, different tourists may prefer different modes of transportation depending on their
preferences; for shorter distances while travelling solo, bikes are advised, and for family, bus
is advised for both cost and time.
23 | P a g e
Referrences:-
24 | P a g e
Appendix:
COST BY BUS
A B C D E F G H I J
A 0 660 600 550 740 1750 1000 400 550 800
B 660 0 560 370 900 1100 850 500 850 700
C 600 560 0 180 950 2500 630 580 600 550
D 550 370 180 0 770 2300 700 540 800 850
E 740 900 950 770 0 4000 530 1600 610 940
F 1750 1100 2500 2300 4000 0 3300 1550 3000 2000
G 1000 850 630 700 530 3300 0 1500 780 600
H 400 500 580 540 1600 1550 1500 0 690 630
I 550 850 600 800 610 3000 780 690 0 1500
J 640 700 550 550 940 2000 600 630 1500 0
Time by bus
A B C D E F G H I J
A 0 6.50 5.50 4.33 9.33 11.50 8.91 3.66 7.00 7.25
B 6.5 0 4.50 3.33 10.75 11.75 7.91 2.66 9.75 4.00
C 5.50 4.50 0 2.00 8.00 14.50 7.25 4.50 6.00 4.41
D 4.33 3.33 2.00 0 9.41 13.91 8.33 4.33 7.66 4.41
E 9.33 10.75 8.00 9.41 0 18.91 4.25 10.91 5.50 8.00
F 11.50 11.75 14.50 13.91 18.91 0 16.75 10.58 15.00 12.66
G 8.91 7.91 7.25 8.33 4.25 16.75 0 10.16 7.16 4.83
H 3.66 2.66 4.50 4.33 10.91 10.58 10.16 0 8.00 6.25
I 7.00 9.75 6.00 7.66 5.50 15.00 7.16 8.00 0 10.25
J 7.25 4.00 4.41 4.41 8.00 12.66 4.83 6.25 10.25 0
25 | P a g e
Time by bike
A B C D E F G H I J
Cost By Bike
A B C D E F G H I J
26 | P a g e