0% found this document useful (0 votes)
72 views18 pages

Using Voronoi Diagrams and Graph Theory To Optimize University Options.

Uploaded by

aeduarteps4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views18 pages

Using Voronoi Diagrams and Graph Theory To Optimize University Options.

Uploaded by

aeduarteps4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Downloaded from www.clastify.

com by James Hronek Rojas

Mathematics: applications and interpretation HL Internal Assessment

Using Voronoi Diagrams and Graph Theory to optimize university options

Table of Contents

Introduction: ............................................................................................................................. 1

Rationale: .......................................................................................................................................... 1

Aim: ................................................................................................................................................... 1

r
.c
ed
Exploration: .............................................................................................................................. 2

y.
lle
Construction of the Voronoi Diagram: ........................................................................................... 2

va
en
Analysis of the Voronoi Diagram: ................................................................................................... 7
ld
go

Solving the Traveling Salesman Problem: ..................................................................................... 8


k@

Conclusion and Evaluation: ................................................................................................... 15


ne
ro

Bibliography ............................................................................................................................ 17
.h
es
m
ja
y
tif
as
Cl
Downloaded from www.clastify.com by James Hronek Rojas

Introduction:

Rationale:

As an IBDP student in my final year of high school, I have a major life-changing decision to

make, which is deciding on the universities I want to apply to that would be best suited to

further my education and aid me in embarking on my aspirational future career path.

Personally, there are numerous factors I consider when trying to make this critical decision,

such as my academic level, university rankings, student population, diversity rates, and so on.

r
.c
However, out of all these important factors, location is the most significant to me. In 2017, I

ed
y.
moved to Houston, Texas, with my family, and I've felt at home there ever since, so it is in my

lle
best interest to apply to a university close to my family in Houston. Additionally, I've been a
va
en
lifelong Houston Rockets fan, even twice visiting their home stadium, the Toyota Center, to
ld
go

watch them play live. As I'm moving into university, it would be my preferred decision to apply
k@

to the school nearest the Toyota Center, so I can watch the Houston Rockets play in live time
ne
ro

more often. Furthermore, it is important for me to understand and have a feel for each university
.h
es

I want to apply to, so I would also like to visit every university campus in the vicinity of the
m
ja

Toyota Center. And, since fuel prices continue to rise in the US, I would like to save fuel by
y
tif

traveling the minimum possible distance.


as
Cl

Aim:

This investigation aims to use a Voronoi Diagram to determine the optimal university based

on which of the five shortlisted universities is nearest the Toyota Center. Solely based on

intuition and inspection, I would predict the University of Houston-Downtown would be the

closest university to the Toyota Center. Nevertheless, a Voronoi Diagram would still be

necessary to validate this prediction. Moreover, this investigation presents this scenario as a

traveling salesman problem to calculate an approximate solution for the Hamiltonian cycle of

1
Downloaded from www.clastify.com by James Hronek Rojas

least weight by utilizing a weighted graph that displays the distance of the shortest routes that

link the five universities. This helps reduce fuel consumption while visiting each university

once for a campus tour. Although a range of values can be found by calculating the lower and

upper bounds for the Hamiltonian cycle of least weight, it is important to note that no effective

algorithm has been developed to perfectly solve the traveling salesman problem, so any

solution is only an approximation.

Exploration:

r
.c
ed
Construction of the Voronoi Diagram:

y.
lle
A Voronoi Diagram is “the partitioning of a plane with n points into convex polygons such that
va
en
each polygon contains exactly one generating point and every point in a given polygon is closer
ld
go

to its generating point than to any other.”1 In order to construct a Voronoi Diagram, I first
k@

overlayed a map from Google Earth of the five closest universities to the Toyota Center over a
ne
ro

cyan squared grid using GeoGebra. This results in the creation of the coordinate system, which
.h
es

is “an arrangement of reference lines or curves used to identify the location of points in space.”2
m
ja

The coordinate system is illustrated in figure 1 below, which has a scale of 2000 meters per 2
y
tif

units and displays the five shortlisted universities as different sites (𝑅, 𝑆, 𝐷, 𝑇, 𝐻) as well as the
as

Toyota Center, which is marked as point 𝑇𝐶. The coordinates of all five university sites present
Cl

are recorded in Table 1 below.

1
Weisstein, E.W. (2021). Voronoi Diagram. [online] mathworld.wolfram.com. Available at:
https://mathworld.wolfram.com/VoronoiDiagram.html.
2
Encyclopedia Britannica. (n.d.). Coordinate system | mathematics. [online] Available at:
https://www.britannica.com/science/coordinate-system.

2
Downloaded from www.clastify.com by James Hronek Rojas

r
.c
ed
y.
lle
va
en
ld
go
k@
ne
ro

𝑥
.h
es

Figure 1: Map of universities around the Toyota Center


m
ja
y
tif

University Name Site Name Site Coordinate


as
Cl

Rice University 𝑅 (0.92, 1.39)

University of St. Thomas 𝑆 (1.71, 3.52)

University of Houston-Downtown 𝐷 (5.05, 6.87)

Texas Southern University 𝑇 (5.03, 1.84)

University of Houston 𝐻 (6.67, 1.68)

Table 1: Coordinates of Universities

3
Downloaded from www.clastify.com by James Hronek Rojas

A perpendicular bisector is “a line that divides a given line segment exactly into two halves

forming 90 degrees angle at the intersection point.”3 All points on a perpendicular bisector are

equidistant to the sites they are bisecting, and the perpendicular bisector helps divide the plane

into two regions. Therefore, finding the perpendicular bisectors between every site is essential

in the construction of a Voronoi Diagram, as they will serve as the edges of the Voronoi

Diagram.

Firstly, the edge between sites 𝑅 (0.92, 1.39) and 𝑆 (1.71, 3.52) was constructed.

r
.c
ed
In order to find the equation of the perpendicular bisector between these two sites the midpoint

y.
lle
was calculated first, as shown below:

va
𝑥1 + 𝑥2 𝑦1 + 𝑦2
en
𝑀𝑖𝑑𝑝𝑜𝑖𝑛𝑡 𝑜𝑓 [𝑅𝑆] = ( , )
2 2
ld
go

0.92 + 1.71 1.39 + 3.52


=( , )
k@

2 2
ne

= (1.315, 2.455)
ro
.h
es
m

The gradient of the perpendicular bisector between sites 𝑅 and 𝑆 is equal to the negative
ja
y

reciprocal of the gradient (𝑚) of the line segment between these points.
tif
as

𝑦2 − 𝑦1
𝑚 𝑜𝑓 [𝑅𝑆] =
Cl

𝑥2 − 𝑥1

3.52 − 1.39
=
1.71 − 0.92

2.13 213
𝑚 𝑜𝑓 [𝑅𝑆] = =
0.79 79
𝟕𝟗
∴ 𝑮𝒓𝒂𝒅𝒊𝒆𝒏𝒕 𝒐𝒇 𝑷𝒆𝒓𝒑𝒆𝒏𝒅𝒊𝒄𝒖𝒍𝒂𝒓 𝑩𝒊𝒔𝒆𝒄𝒕𝒐𝒓 𝒐𝒇 [𝑹𝑺] = −
𝟐𝟏𝟑

3
Cuemath. (n.d.). Perpendicular Bisector - Definition, Construction, Properties, Examples. [online] Available
at: https://www.cuemath.com/geometry/perpendicular-bisectors/.

4
Downloaded from www.clastify.com by James Hronek Rojas

Next, we substitute the values of 𝑥 and 𝑦 from the midpoint and the gradient (𝑚) of the

perpendicular bisector into the equation of a line, 𝑦 = 𝑚𝑥 + 𝑐, to find the y-intercept (𝑐), and

thus the equation of the perpendicular bisector.

𝑦 = 𝑚𝑥 + 𝑐

79
2.455 = − (1.315) + 𝑐
213

103.885
𝑐 = 2.455 +

r
213

.c
ed
3134
𝑐=

y.
1065

lle
79 3134
va
∴𝑦=− 𝑥+
en
213 1065
ld

𝑦 ≈ −0.371𝑥 + 2.94
go
k@

This equation represents the edge between sites 𝑅 and 𝑆.


ne
ro
.h

This procedure is repeated for all additional edges between sites. To make this procedure more
es
m

efficient, I used Microsoft Excel’s equation function to create a spreadsheet that found the
ja
y

midpoints, gradients, and y-intercepts of the other perpendicular bisectors. This is shown in
tif
as

Table 2 below:
Cl

1 𝑥1 + 𝑥2 𝑦1 + 𝑦2
Sites 𝑥1 𝑦1 𝑥2 𝑦2 𝑚 − 𝑐
𝑚 2 2

𝑅𝐷 0.92 1.39 1.71 3.52 2.70 -0.371 1.32 2.46 2.94

𝑅𝑇 0.92 1.39 5.03 1.84 0.109 -9.13 2.98 1.62 28.8

𝑅𝐻 0.92 1.39 6.67 1.68 0.0504 -19.8 3.80 1.54 76.8

𝑆𝐷 1.71 3.52 5.05 6.87 1.00 -0.997 3.38 5.20 8.56

5
Downloaded from www.clastify.com by James Hronek Rojas

1 𝑥1 + 𝑥2 𝑦1 + 𝑦2
Sites 𝑥1 𝑦1 𝑥2 𝑦2 𝑚 − 𝑐
𝑚 2 2

𝑆𝑇 1.71 3.52 5.03 1.84 -0.506 1.98 3.37 2.68 -3.98

𝑆𝐻 1.71 3.52 6.67 1.68 -0.371 2.70 4.19 2.60 -8.70

𝐷𝑇 5.05 6.87 5.03 1.84 251 -0.00398 5.04 4.36 4.38

𝐷𝐻 5.05 6.87 6.67 1.68 -3.20 0.312 5.86 4.28 2.45

𝑇𝐻 5.03 1.84 6.67 1.68 -0.0976 10.3 5.85 1.76 -58.2

Table 2: The midpoints, gradients, and y-intercepts of the perpendicular bisectors

r
.c
All calculated values in Table 2 above were rounded to 3 significant figures. However, it is

ed
y.
important to note that Excel used the actual values, not the estimates, when calculating the

lle
va
gradients and y-intercepts of the perpendicular bisectors.
en
ld
go

Using the values of the midpoints, gradients, and y-intercepts of the perpendicular bisectors
k@
ne

between the university sites, the Voronoi Diagram was created as seen in figure 2 below.
ro
.h
es

It must be noted that only a section of each perpendicular bisector is included as edges in the
m
ja

Voronoi Diagram. The edges indicate the points that are equidistant between the two sites it
y
tif

bisects, but they stop when the points on the edge become closer to a site different from the
as
Cl

bisected sites.

6
Downloaded from www.clastify.com by James Hronek Rojas

r
.c
ed
y.
lle
va
en
ld
go
k@
ne
ro
.h
es
m

𝑥
ja
y

Figure 2: Voronoi Diagram containing the Toyota Center


tif
as
Cl

Analysis of the Voronoi Diagram:

As explained in the introduction, this investigation aimed to find the university closest to the

Toyota Center. The general rule for Voronoi Diagram is that all the points located inside a cell

are closest to the corresponding site. Hence, to determine which university is closest to the

Toyota Center, we simply have to locate which cell contains the Toyota Center marked at point

𝑇𝐶.

7
Downloaded from www.clastify.com by James Hronek Rojas

According to Figure 2 above, it can be observed that cell D contains the Toyota Center.

Therefore, the University of Houston-Downtown is the closest university to the Toyota

Center, thus being the optimal location.

However, even though the University of Houston-Downtown is the closest university to the

Toyota Center according to the Voronoi Diagram above, other factors that are not present in

the Voronoi Diagram can dissuade this as the optimal location. These include typical traffic in

the area, hazards (including accidents), blocked roads, speed limits and police traps, and the

r
.c
ed
distance of the routes leading to the Toyota Center. All these factors would reduce the time

y.
lle
taken to arrive at the Toyota Center, so it could potentially make a different university more

va
optimal. Nonetheless, the Voronoi Diagram is a useful starting point for subsequent research
en
ld

with more advanced satellite navigation technology.


go
k@
ne

Solving the Traveling Salesman Problem:


ro
.h

In order to further determine which university would be most appealing, I would like to take a
es
m

trip to each university while saving fuel by traveling the minimum possible distance (a real-life
ja
y

application of the traveling salesman problem). The Hamiltonian cycle of least weight would
tif
as

be used to approximate a solution to the practical traveling salesman problem (TSP). A


Cl

Hamiltonian cycle is “a graph cycle (i.e., closed loop) through a graph that visits each node

exactly once” (Skiena 1991, p. 196).4 The nodes of the graph are represented by the shortlisted

universities, and Rice University would be the starting point for my tour because it is the closest

to my home.

4
Skiena, S., 1991. Implementing discrete mathematics: combinatorics and graph theory with Mathematica.
Addison-Wesley Longman Publishing Co., Inc..

8
Downloaded from www.clastify.com by James Hronek Rojas

Using Waze, I obtained the shortest routes (in km) between each university in order to create a

weighted graph to discover the shortest total distance for this journey. This is illustrated in

Figure 3 below, in which the weight of the edges indicates the distance between the routes and

the vertices represent the various universities.

r
.c
ed
y.
lle
va
en
ld
go
k@
ne

Figure 3: Weighted Graph of Direct Routes


ro
.h
es

To simplify this, I used the weight of the edges between each vertex to construct a weighted
m
ja

adjacency table.
y
tif

Vertex R S D T H
as
Cl

R 0 2.8 7.1 4.5 10

S 2.8 0 4.9 3.5 6.9

D 7.1 4.9 0 6.1 7.7

T 4.5 3.5 6.1 0 3.3

H 10 6.9 7.7 3.3 0

Table 3: Weighted Adjacency Table

9
Downloaded from www.clastify.com by James Hronek Rojas

In order to solve a classical TSP, the problem must be converted to a practical TSP. This is

achieved by completing the graph and replacing the direct distance of each pair of vertices with

any attainable shorter distance via an interim point. “A complete graph is a graph in which each

pair of graph vertices is connected by an edge.”5 As indicated in Table 3, all routes are

connected by a single edge to every other vertex therefore Figure 3 is a complete graph.

However, some of the directed routes are longer than a route that goes through an interim point

(for example, the direct distance of vertex R to H is longer than the distance of R to H if we

pass through T first). Hence, Figure 3 shows a graph in the classical TSP form and must be

r
.c
ed
converted to a practical TSP.

y.
lle
va
To convert the graph in Figure 3 to a practical TSP, I have to replace any direct edge with a
en
ld

feasible shorter route via another point to show the least weight path. The graph is not too
go
k@

complicated, so this is done through inspection.


ne

R → H (10) is replaced with R → T → H (4.5 + 3.3 = 7.8)


ro
.h

S → H (6.9) is replaced with S → T → H (3.5 + 3.3 = 6.8)


es
m
ja
y

The updated weighted graph and its corresponding weighted adjacency table are shown below
tif
as

in Figure 4 and Table 4, respectively.


Cl

5
Weisstein, E.W. (n.d.). Complete Graph. [online] mathworld.wolfram.com. Available at:
https://mathworld.wolfram.com/CompleteGraph.html#:~:text=A%20complete%20graph%20is%20a

10
Downloaded from www.clastify.com by James Hronek Rojas

r
.c
Figure 4: Updated Weighted Graph

ed
y.
lle
va
Vertex R S D
en T H
ld

R 0 2.8 7.1 4.5 7.8


go

S 2.8 0 4.9 3.5 6.8


k@
ne

D 7.1 4.9 0 6.1 7.7


ro

T 4.5 3.5 6.1 0 3.3


.h
es

H 7.8 6.8 7.7 3.3 0


m
ja

Table 4: Updated Weighted Adjacency Table


y
tif
as
Cl

Now that the graph is in the form required for the TSP, an approximation for the minimum

weight journey that visits all the vertices can be found. No algorithm has been devised to find

the Hamiltonian cycle of least weight. Instead, an estimation of the minimum weight

Hamiltonian cycle is calculated using an upper and lower bound.

To find an upper bound of the minimum Hamiltonian cycle, the nearest neighbor algorithm is

used. This algorithm has four steps:

11
Downloaded from www.clastify.com by James Hronek Rojas

• Step 1: Choose a starting vertex.

• Step 2: Follow the edge of least weight to an unvisited vertex.

• Step 3: Repeat step 2 until all vertices have been visited.

• Step 4: Return to the starting vertex by adding the corresponding edge.

The nearest neighbor algorithm is applied to the weighted adjacency table from table 4 in table

5 below. The starting vertex chosen is R.

r
.c
ed
1 2 5 3 4

y.
lle
Vertex R S D T H

va
en
R 0 2.8 7.1 4.5 7.8
ld

S 2.8 0 4.9 3.5 6.8


go
k@

D 7.1 4.9 0 6.1 7.7


ne

T 4.5 3.5 6.1 0 3.3


ro
.h

H 7.8 6.8 7.7 3.3 0


es
m

Table 5: Nearest Neighbor Algorithm


ja
y
tif
as

The Hamiltonian cycle formed from the Nearest Neighbor Algorithm can be written as:
Cl

R→S→T→H→D→R

Because all the edges chosen are direct, no additional route has to be added to this cycle.

Let 𝑚 represent the minimum weight of a Hamiltonian cycle in Figure 3.

The upper bound of 𝑚 is expressed as:

𝑚 ≤ 2.8 + 3.5 + 3.3 + 7.7 + 7.1

𝒎 ≤ 𝟐𝟒. 𝟒 𝒌𝒎

12
Downloaded from www.clastify.com by James Hronek Rojas

Now that the upper bound of 𝑚 has been calculated, the deleted vertex algorithm can be used

to find the lower bound of 𝑚. The steps of this algorithm are:

• Step 1: Delete a vertex, together with all edges connected to it, from the original graph.

• Step 2: Find the minimum spanning tree for the remaining graph.

• Step 3: Add to the length of the minimum spanning tree, the lengths of the two shortest

deleted edges.

Firstly, I chose vertex R to be deleted. Table 6 below shows the weighted adjacency table

r
of table 4 without the vertex R and the edges connected to it.

.c
ed
Vertex S D T H

y.
lle
S 0 4.9 3.5 6.8

va
en
D 4.9 0 6.1 7.7
ld

T 3.5 6.1 0 3.3


go
k@

H 6.8 7.7 3.3 0


ne

Table 6: Weighted Adjacency Table with Vertex R deleted


ro
.h
es
m

With Vertex R deleted, the minimum spanning tree of the weighted adjacency table in Table 6
ja
y

above can now be found using Prim’s algorithm. This algorithm can be applied to a weighted
tif
as

adjacency table using the following steps:


Cl

• Step 1: Select any vertex at random.

• Step 2: Delete the row of the chosen vertex.

• Step 3: Number the column of the chosen vertex.

• Step 4: Circle the lowest undeleted entry in any of the numbered columns.

• Step 5: Repeat Steps 2 to 4 until all rows are deleted.

The circled entries give the edges of the minimum spanning tree.

13
Downloaded from www.clastify.com by James Hronek Rojas

Prim’s algorithm is applied to the weighted adjacency table from table 6 in table 7 below. The

starting vertex chosen is S.

1 4 2 3

Vertex S D T H

S 0 4.9 3.5 6.8

D 4.9 0 6.1 7.7

T 3.5 6.1 0 3.3

r
H 6.8 7.7 3.3 0

.c
ed
Table 7: Prim’s Algorithm

y.
lle
va
en
Using the weight of the edges circled in red, the weight of the minimum spanning tree =
ld

3.5 + 3.3 + 4.9 = 11.7 𝑘𝑚


go
k@
ne

The shortest edges from the deleted vertex R were RS and RT, with weights of 2.8 𝑘𝑚 and
ro
.h

4.5 𝑘𝑚, respectively. These weights must be added to the weight of the minimum spanning
es
m

tree, 11.7 𝑘𝑚, to complete the deleted vertex algorithm and thus, find the lower bound of 𝑚.
ja
y

11.7 𝑘𝑚 + 2.8 𝑘𝑚 + 4.5 𝑘𝑚 = 19 𝑘𝑚


tif
as

𝒎 ≥ 𝟏𝟗 𝒌𝒎
Cl

Deleting a different vertex in the deleted vertex algorithm may produce a different lower bound,

so in order to improve on this lower bound, I repeated the deleted vertex algorithm on other

vertices and replaced the 19 𝑘𝑚 lower bound with the highest found lower bound.

14
Downloaded from www.clastify.com by James Hronek Rojas

Table 8 below shows the weight of the minimum spanning tree of the graph in Figure 4 when

the corresponding vertex is deleted and the total weight of the two shortest edges of the

corresponding deleted vertex, which were added together to find the different lower bounds.

Weight of Minimum Weight of two shortest


Deleted Vertex Lower bound
Spanning Tree edges of the deleted vertex

S 13.9 6.2 20.1

D 9.6 11 20.6

r
T 11 6.8 17.8

.c
ed
H 11.2 10.1 21.3

y.
lle
Table 8: Remaining Lower bounds

va
en
ld

The greater a lower bound is, the more optimal it is. Therefore, according to Table 8 above, the
go
k@

optimal lower bound is 21.3.


ne

∴ 𝟐𝟏. 𝟑 𝒌𝒎 ≤ 𝒎 ≤ 𝟐𝟒. 𝟒 𝒌𝒎
ro
.h

This range of values gives me an approximation for the minimum length required to visit all
es
m

five universities in the vicinity of the Toyota Center, starting and ending at Rice University at
ja
y

vertex R.
tif
as
Cl

Conclusion and Evaluation:

In conclusion, from this investigation, I was able to determine that in terms of location, the

University of Houston-Downtown is the nearest university to the Toyota Center and, thus, the

most optimal choice for a university that would allow frequent visits to the Toyota Center.

However, as previously mentioned, there are other factors that are not present in a Voronoi

Diagram that could potentially dissuade this option from being optimal (e.g., traffic, hazards,

blocked roads, speed limits, and distance of routes). Regardless of all these potential factors,
15
Downloaded from www.clastify.com by James Hronek Rojas

the Voronoi Diagram provides a solid foundation for further investigation using more

sophisticated satellite navigation technology.

Furthermore, this investigation provided me with the range of values of the minimum distance

it would take to visit the five shortlisted universities near the Toyota Center. I realized that

longer routes could save time depending on how busy the area is, and thus I could have created

a graph with the shortest time it takes for the journey rather than the distance. However, for

me, my goal was to save fuel by minimizing distance, so the time it takes for me to visit all five

universities is not an important factor.

r
.c
ed
y.
lle
va
en
ld
go
k@
ne
ro
.h
es
m
ja
y
tif
as
Cl

16
Downloaded from www.clastify.com by James Hronek Rojas

Bibliography

Cuemath. (n.d.). Perpendicular Bisector - Definition, Construction, Properties, Examples.

[online] Available at: https://www.cuemath.com/geometry/perpendicular-bisectors/.

Encyclopedia Britannica. (n.d.). Coordinate system | mathematics. [online] Available at:

https://www.britannica.com/science/coordinate-system.

Skiena, S., 1991. Implementing discrete mathematics: combinatorics and graph theory with

Mathematica. Addison-Wesley Longman Publishing Co., Inc..

r
Weisstein, E.W. (2021). Voronoi Diagram. [online] mathworld.wolfram.com. Available at:

.c
ed
https://mathworld.wolfram.com/VoronoiDiagram.html.

y.
lle
va
en
ld
go
k@
ne
ro
.h
es
m
ja
y
tif
as
Cl

17

You might also like