mathematical characterization of the dijkstra …

14
MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA ALGORITHM TO HANDLE THE TURNTABLE JAVIER FELIPE MONCADA SÁNCHEZ 1 , CARLOS ENRIQUE MONTENEGRO MARÍN 2 & YENNY ESPINOSA GÓMEZ 3 1 Universidad Distrital Francisco José de Caldas, Colombia 2 Universidad Distrital Francisco José de Caldas, Colombia 3 Universidad Distrital Francisco José de Caldas, Colombia ABSTRACT This article analyzes and shows the mathematical characterization necessary to implement the turn table and achieve the search for the optimal route by means of the Dijkstra algorithm, this analysis supports the development of the research "Design and Development of a Framework for the Network Analysis in GIS Tools, implementing the Dijkstra Algorithm that supports the Impedance of Turns ”. In this work we can see how it is possible to transform a network to a system of graphs or weighted digraphs and the transformation process that these graphs must undergo in order to implement the impedances or restrictions of turns. All the mathematical development presented here constitutes the first step for the development of multiple and future network analysis projects in GIS applications, KEYWORDS: Network Analysis, Dijkstra, Turns Table, GIS, Spatial Analysis Received: Sep 24, 2020; Accepted: Oct 16, 2020; Published: Oct 29, 2020; Paper Id.: IJMPERDAUG202033 1. INTRODUCTION Currently, Geographic Information Systems (GIS) are a tool used by a large and diverse group of users, in professional areas such as land use planning, cadastral management, market analysis, the environment, tourism and many others.[1] - [3]. This is due to the support that GIS provides in decision-making, due to their natural ability to handle both alphanumeric and spatial data, and the possibility of performing spatial analysis on them.(Chorley, 1987). Although GIS tools were initially limited to desktop applications, today applications can be found in distributed form(Martillo Bustamante, 2014). Among the analysis functions available to GIS, one of the most outstanding is the so-called connectivity, and network analysis constitutes one of the most notorious connectivity procedures(Amado Barón, 2011; Bosque Sendra, Escobar, García, & Salado, 2000; Comas & Ruiz, n.d.). The majority of existing GIS tools, both commercial and free, whether they are extensions or complete applications, that have the capacity to perform network analysis, generally work on the vector storage structure (this structure defines geometric objects such as; points, lines and polygons, by explicitly encoding their coordinates(Burrough, 1986)), and have algorithms that transform these structures at a directed and undirected graph abstraction level. Additionally, they have the possibility of executing search algorithms such as Dijkstra, Bellman-Ford and A *(Barnes & Harary, n.d.; Berghammer, n.d.; Brassard G. y Bratley, 1997; Hadley, 1962), enabling the user to perform spatial analysis, such as the search for optimal routes, minimum paths or areas of influence, and thus obtain new support information for decision making. International Journal of Mechanical and Production Engineering Research and Development (IJMPERD) ISSN(P): 2249-6890; ISSN(E): 2249-8001 Vol. 10, Issue 3, Jun 2020, 381-394 © TJPRC Pvt. Ltd. www.tjprc.org [email protected]

Upload: others

Post on 24-Jul-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA ALGORITHM TO

HANDLE THE TURNTABLE

JAVIER FELIPE MONCADA SÁNCHEZ1, CARLOS ENRIQUE MONTENEGRO MARÍN 2

& YENNY ESPINOSA GÓMEZ3

1Universidad Distrital Francisco José de Caldas, Colombia

2Universidad Distrital Francisco José de Caldas, Colombia

3Universidad Distrital Francisco José de Caldas, Colombia

ABSTRACT

This article analyzes and shows the mathematical characterization necessary to implement the turn table and achieve the search

for the optimal route by means of the Dijkstra algorithm, this analysis supports the development of the research "Design and

Development of a Framework for the Network Analysis in GIS Tools, implementing the Dijkstra Algorithm that supports the

Impedance of Turns ”. In this work we can see how it is possible to transform a network to a system of graphs or weighted

digraphs and the transformation process that these graphs must undergo in order to implement the impedances or restrictions of

turns. All the mathematical development presented here constitutes the first step for the development of multiple and future

network analysis projects in GIS applications,

KEYWORDS: Network Analysis, Dijkstra, Turns Table, GIS, Spatial Analysis

Received: Sep 24, 2020; Accepted: Oct 16, 2020; Published: Oct 29, 2020; Paper Id.: IJMPERDAUG202033

1. INTRODUCTION

Currently, Geographic Information Systems (GIS) are a tool used by a large and diverse group of users, in professional

areas such as land use planning, cadastral management, market analysis, the environment, tourism and many others.[1] -

[3]. This is due to the support that GIS provides in decision-making, due to their natural ability to handle both

alphanumeric and spatial data, and the possibility of performing spatial analysis on them.(Chorley, 1987). Although GIS

tools were initially limited to desktop applications, today applications can be found in distributed form(Martillo

Bustamante, 2014).

Among the analysis functions available to GIS, one of the most outstanding is the so-called connectivity, and

network analysis constitutes one of the most notorious connectivity procedures(Amado Barón, 2011; Bosque Sendra,

Escobar, García, & Salado, 2000; Comas & Ruiz, n.d.).

The majority of existing GIS tools, both commercial and free, whether they are extensions or complete

applications, that have the capacity to perform network analysis, generally work on the vector storage structure (this

structure defines geometric objects such as; points, lines and polygons, by explicitly encoding their coordinates(Burrough,

1986)), and have algorithms that transform these structures at a directed and undirected graph abstraction level.

Additionally, they have the possibility of executing search algorithms such as Dijkstra, Bellman-Ford and A *(Barnes &

Harary, n.d.; Berghammer, n.d.; Brassard G. y Bratley, 1997; Hadley, 1962), enabling the user to perform spatial analysis,

such as the search for optimal routes, minimum paths or areas of influence, and thus obtain new support information for

decision making.

International Journal of Mechanical and Production

Engineering Research and Development (IJMPERD)

ISSN(P): 2249-6890; ISSN(E): 2249-8001

Vol. 10, Issue 3, Jun 2020, 381-394

© TJPRC Pvt. Ltd.

www.tjprc.org [email protected]

Page 2: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

382 Javier Felipe Moncada Sánchez, Carlos Enrique Montenegro Marín & Yenny Espinosa Gómez

Conventionally, most of the abstractions used in network analysis in these GIS tools and applications use a two-

dimensional or 2-dimensional plane as this is enough to determine high quality results.(Fischer, 2003; Rolf et al., 2000).

Many network abstractions are naturally flat, like river or water systems. But a traffic or power network, they are at the

other end, they are not flat. In the case of a road network, motorways have crossings at various levels and are built with

overpasses and underpasses. Flat networks are easier to deal with computationally, since they have simpler topological

rules.

For the most part, GIS tools do not support the analysis of non-planar or 3-dimensional networks, in many cases

they can only do so using "deception" (Rolf et al., 2000). Such deception may involve cutting the overlapping lines and

creating a new vertex at the intersection, obviously this generates four lines versus two original lines, in this way a new

problem appears given by the abstraction in 2 dimensions, since the network is will allow to make a turn or step to other

lines from this new intersection node, which in reality would be impossible(Rolf et al., 2000). Some GIS tools or

algorithms allow a very high cost to be associated with this line of business and thereby ensure that it is prohibited. But in

the end these are tricks to adapt to a situation that is not flat in a data layer that presumes flatness(Rolf et al., 2000).

To help solve or minimize this problem, the standard data model for an intersecting planar network has been

extended by adding a new structure, called the turn-table. This table shows each pair of arches that occur in a node and the

cost or possibility of allowing the turn or passage between the arches. In this way, a data model with a requirement for

planar embedding can represent overpasses and underpasses and prevent turns not existing in reality.(Fischer, 2003;

Goodchild, 1998).

However, to date, most applications and algorithms, free or open source, that are available to GIS users do not

support or do not have the ability to add and work on the turn table, thus achieving that many of the analyzes carried out on

a computational network, such as the search for optimal routes or minimum paths, in the end they return a result that does

not conform to reality.

So, how can the impedance of turns be taken into account, in network analysis on free GIS tools or similar, in the

search for the optimal path, for example, supported with the Dijkstra algorithm? The purpose of this work is to show the

necessary mathematical characterization to support network analysis by implementing the Dijkstra algorithm, capable of

supporting the impedance of turns through the turntable.

2. WHAT IS A NETWORK?

A network is a set or interconnected or connected system of linear elements forming a spatial structure, which represents a

geographical phenomenon, through which flows of any type circulate(Davis, 2001; Lantada Zarzosa & Amparo, 2004).

These flows can be of people, goods, services, water, energy, information, traffic, wood, etc., depending on what the

network is representing in the real world(Bosque Sendra, 2000; Rolf et al., 2000).

For the majority of Geographic Information Systems we can say that a network is a higher level geometry, which

is made up of arcs (transport lines), nodes (junctions between arches) and points (flow-demanding elements), and that all

these elements restrict or require a degree of flow of some kind.

In everyday life we work and observe many types of networks, such as vehicular transport networks (roads of a

city or a department, train lines or river circuits of a country), electrical networks or fluid conduction networks (water,

Impact Factor (JCC): 9.6246 NAAS Rating: 3.11

Page 3: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

Mathematical Characterization of the Dijkstra Algorithm to Handle the Turntable 383

electricity, gas and oil, among others). These phenomena at times must be schematized to achieve an analysis on the

network that allows us to solve problems such as maximization of results, increased profits, decreased time or costs, etc.

2.1 How to Represent a Network by Means of a Mathematical Model?

One of the most common ways of representing a network, and whose results generate a model with high quality, are the

well-known graphs. Graphs group physical or conceptual entities and the relationships between them(Joyanes Aguilar &

Zahonero Martínez, 2008), provide a static representation of a network, the analysis of which leads to the description of it

at a given time(Maldonado Granados & Serrano Iglesias, n.d.), additionally the graphs have a finite structure(Grimaldi,

1997).

A graph is a pair denoted by, where and are finite non-empty 𝐺 = (𝑉, 𝐸)𝑉𝐸(Grimaldi, 1997; Restrepo C.,

Sánchez C., & Hoyos Mesa, n.d.), being a set of nodes or vertices, and a set of arcs, lines or edges 𝑉 =

{𝑣1, 𝑣2, 𝑣3, … . . , 𝑣𝑛}𝐸 = {𝑒1, 𝑒2, 𝑒3, … . . , 𝑒𝑛}(Pedraza, López, & Salcedo, n.d.; Salas S., n.d.). In this way a graph is a

combination between lines (edges) and nodes (vertices)(Aho, Hopcroft, & Ullman, 1988), as can be seen in Figures 1 (a)

and 1 (b).

(a) Basic labeling

(b) Labeling V, E

Figure 1: Simple Graphs

The nodes can be labeled by means of letters, such as A, B, C, etc., and these in turn give the names to the lines

that join them. For example, the line that joins nodes A and B is called AB. as seen in figure 1 (a). It is also possible to

name the nodes and arcs with a subscript, as shown in figure 1 (b).

The vertices contain information regarding the objects, while the arcs establish dependencies between the objects

that they directly relate.

(a) Undirected Graph

(b) Directed Graph

Figure 2: Arcs in the Graphs

If the arcs have no direction, since flow through an arc occurs in any direction, regardless of the direction, the arc

is said to be "bidirectional" or "undirected"(Van Gelder, 2002), and is represented by a line that joins the nodes, as seen in

figure 2 (a), and we say that it represents an undirected graph or graph (Van Gelder, 2002). If arcs are directed, flow

through an arc is only allowed in one direction, the arc is said to be "unidirectional" or "directed".(Van Gelder, 2002), and

www.tjprc.org [email protected]

Page 4: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

384 Javier Felipe Moncada Sánchez, Carlos Enrique Montenegro Marín & Yenny Espinosa Gómez

is represented by an arrow that joins the nodes in the direction of flow, as seen in figure 2 (b). Graphs that have directions

of flow are called digraphs or directed graphs.(Van Gelder, 2002).

When we find that two vertices are connected by more than one edge, their representation is said to be a

multigraph (Lipschutz & Lipson, 2007).

2.2 How to Represent a Graph in a Mathematical System?

It is clear that a graph or digraph can be visualized through a drawing where each vertex is represented by a point or node

and each edge or arc is represented by a line. (Lipschutz & Lipson, 2007), but if the processing is to be carried out on a

computer system, the graph is not efficient at all, for this there are two ways to keep a graph "G" in the memory of a

computer (Lipschutz & Lipson, 2007), one is called the Sequential Representation of G, which is based on the adjacency

matrix A. the other is called the Linked Representation of G and is based on linked lists of neighbors(Aho et al., 1988).

Regardless of how a graph G is kept in computer memory, the graph G is normally entered into the computer by its formal

definition: A set of nodes and a set of edges or arcs.

For a dense graph it is best to use the adjacency matrix, while for a sparse graph (few arcs) adjacency lists are

usually used that adjust to the number of arcs in the graph. (Joyanes Aguilar & Zahonero Martínez, 2008). In this work and

according to the existing algorithms we will only deal with the sequential representation.

3. SEQUENTIAL REPRESENTATION

The most important characteristic of a graph or digraph, which makes them distinguishable from each other, is the set of

pairs made by vertices that are related or adjacent. in this way the simplest form of representation is through a matrix,

which will have as many rows and columns as nodes, which allows these qualities to be easily modeled(Joyanes Aguilar &

Zahonero Martínez, 2008), in other words for a node graph, its matrix will be 𝑛𝑛 𝑥 𝑛(Lipschutz & Lipson, 2007).

Adjacency matrices will frequently be displayed with 1 for true, 0 for false and -1 to show the impossibility, restriction or

the opposite direction to carry out said process or tour(Aho et al., 1988);

3.1 Representation for Graphs

If we have a graph G, such as the one shown in Figure 3, we can find the adjacency matrix.

(a) Simple Graph

(b) Adjacency Matrix

Figure 3: Simple Graph and Adjacency Matrix

In this matrix, the columns and rows represent each of the nodes and the values of the matrix the number of existing paths

to another node in a single step. For example, ij = 1, when i = A and j = B, the value is 1 since in a single step you can go

Impact Factor (JCC): 9.6246 NAAS Rating: 3.11

Page 5: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

Mathematical Characterization of the Dijkstra Algorithm to Handle the Turntable 385

from A to B. When i = A and j = A, the value is 0 since in a single step you cannot go from A to another node and return to

A, in this way the diagonal of the matrix will always be in zeros and it will be symmetric(Aho et al., 1988; Joyanes Aguilar

& Zahonero Martínez, 2008; Van Gelder, 2002).

3.2 Representation for Digits

If we have a graph G, such as the one shown in figure 4, the adjacency matrix could be any of the following matrices:

(a) Digraph

(b) Adjacency Matrices

Figure 4: Digraph and Adjacency Matrices

In the first matrix, the columns represent the arcs and the rows represent each of the nodes (Joyanes Aguilar &

Zahonero Martínez, 2008), the values of the matrix represent the possibility of moving through the arc in this way the

values will be; 0 if you cannot travel from a node through this arc, 1 if you can travel in the direction of the arc and -1 if

you can travel against the direction of the arc. For example, ij = 1, when i = A and j = b, the value is 1 since it is possible to

go from node A to B in the direction of arc a in one step. when i = A and j = a, the value is -1 since in a single step it is

possible to go from A to D but against the direction of arc b. The second matrix will work in the same way as the

adjacency matrix of a simple graph, it is only observed that the direction of the arcs modifies the possibility of going or not

from one node to another, assuming a value of 0 and 1(Aho et al., 1988; Joyanes Aguilar & Zahonero Martínez, 2008; Van

Gelder, 2002).

3.3 Valued or Weighted Graph - Consumption values in Nodes and Arcs

In the case of having a graph or digraph that models problems in which a relationship has an associated magnitude or

consumption, a weight factor(Joyanes Aguilar & Zahonero Martínez, 2008), the arcs and / or nodes will have impedance or

cost values, as shown in the graph in figure 5, to model this it is necessary to create two additional weight matrices, one for

the cost of the arches and the other for the cost of nodes (Joyanes Aguilar & Zahonero Martínez, 2008). From the graph G

we can generate two additional matrices: the weight per arcs Pa and the weight per node Pn.

www.tjprc.org [email protected]

Page 6: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

386 Javier Felipe Moncada Sánchez, Carlos Enrique Montenegro Marín & Yenny Espinosa Gómez

(a) Weighted Graph

(b) Weight Matrices

Figure 5: Weighted Graph and Weight Matrices

In the case of there being different weights in an arch according to the sense, it will be replaced by two new arches

with only one sense and different weight, as seen in figure 6, and the adjacency matrix will have the values according to

the two bow senses.

(a) Weighted Digraph

(b) Adjacency or Weight Matrix

Figure 6: Weighted Digraph and Adjacency or Weight Matrix

In a weighted or valued graph or digraph, each element of the adjacency matrix represents the weight of the arc,

and therefore it usually changes its name to a weight matrix(Joyanes Aguilar & Zahonero Martínez, 2008).

4. DIJKSTRA ALGORITHM (SHORTEST PATH - MINIMUM TREE - MINIMUM PATH)

Dijkstra's algorithm calculates the shortest or optimal path between one node and the others (Peñaranda Ortega, Osca

Lluch, López ferre, Civera Mollá, & Tortasa Gil, 2009). It requires the use of a weighted graph that does not have negative

lengths or negative costs(Salas S., 2008). Dijkstra's algorithm is a greedy algorithm (sweet algorithm) that generates one by

one the paths from one node to the rest in increasing order of length(Salas S., 2008), uses a set S of nodes, where initially it

is assumed that this cost is infinite, and as a lower cost is known in each iteration or step of the algorithm from each node

to the source node, the nodes are saved for which already knows the minimum path and returns a vector indexed by nodes,

so that for each of these nodes we can determine the cost of a more economical path (of minimum weight) from the source

node to those nodes (Salas S., 2008). Each time a node is incorporated into the solution, it is checked whether the paths not

yet definitive can be shortened by passing through the(Salas S., 2008).

4.1 Algorithm Description

Impact Factor (JCC): 9.6246 NAAS Rating: 3.11

Page 7: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

Mathematical Characterization of the Dijkstra Algorithm to Handle the Turntable 387

To find the shortest path between two nodes P and Q, we use the fact that if R is a node on the shortest path between P and

Q, therefore, the path P to R is known. The minimum path of P by other nodes is built incrementally until Q is

reached(Soares, Leal, Pereira, Silva Junior, & Silva, 2015).

Nodes are divided into two groups(Dijkstra, n.d.):

The connected nodes, for which the most optimal cost between them and node P is known.

The remaining nodes (not connected or considered yet)

In the course of construction, the arches are subdivided into three groups(Dijkstra, n.d.):

I. the arcs that are part of the optimal path from node P to the nodes of set A.

II. the arch that is studied to add it to set I.

III. the remaining arcs (rejected or not considered).

4.2 Example 1

Given the undirected and weighted graph (without negative weights) of figure 7, we want to calculate the minimum cost of

the roads from node A to node C, applying Dijkstra's algorithm.

Figure 7: Undirected and Weighted Graph

The matrix of weights per arc, considering the weight as ∞ when there is no connection can be observed in the

adjacency matrix (figure 8).

Figure 8: Adjacency Matrix

He

Passed Marked Node TO B C D AND F G Minimum

Step 1 A, B 0 one TO 100 TO ∞ ∞ ∞ ∞ one

Step 2 A, B, D 0 One TO 100 TO two B 9 B ∞ ∞ two

Step 3 A, B, D, G 0 one TO 100 TO two B 9 B 5 D 4 D 4

Step 4 A, B, D, G, F 0 one TO 100 TO two B 9 B 5 D 4 D 5

www.tjprc.org [email protected]

Page 8: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

388 Javier Felipe Moncada Sánchez, Carlos Enrique Montenegro Marín & Yenny Espinosa Gómez

Step 5 A, B, D, G, F, E 0 one TO 100 TO two B 6 F 5 D 4 D 6

Step 6 A, B, D, G, F, E, C 0 one TO 7 AND two B 6 F 5 D 4 D 7

The minimum cost from A to C is 7, the sequence of nodes that makes the minimum path is A, B, D, F, E and C

4.3 Example 2

Given the undirected and weighted graph in arcs and nodes (without negative weights) of figure 9, we want to calculate the

minimum cost of the paths from node A to node C, applying Dijkstra's algorithm.

Figure 9: Undirected and Weighted Graph in Arcs and Nodes

The matrix of weights per arc, considering the weight as ∞ when there is no connection can be observed in the

adjacency matrix and the matrix of weight by nodes (figure 10):

Figure 10: Adjacency Matrix and Weight Matrix

He

Passed Marked Node TO B C D AND F G Minimum

Step 1 A, B 3 5 TO 106 TO ∞ ∞ ∞ ∞ 5

Step 2 A, B, D 3 5 TO 106 TO 9 B 14 B ∞ ∞ 9

Step 3 A, B, D, G, E 3 5 TO 106 TO 9 B 14 B fifteen D 14 D 14

Step 4 A, B, D, G, E, F 3 5 TO 18 AND 9 B 14 B fifteen D 14 D fifteen

Step 5 A, B, D, G, E, F, C 3 5 TO 18 AND 9 B 14 B fifteen D 14 D 18

The minimum cost from A to C is 18, the sequence of nodes that makes the minimum path is A, B, E and C \\

4.4 Example 3

Given the directed and weighted graph (without negative weights) of figure 11, we want to calculate the minimum cost of

the paths from node A to node C, applying Dijkstra's algorithm.

Impact Factor (JCC): 9.6246 NAAS Rating: 3.11

Page 9: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

Mathematical Characterization of the Dijkstra Algorithm to Handle the Turntable 389

Figure 11: Directed and Weighted Graph

The matrix of weights per arc, considering the weight as ∞ when there is no connection can be observed in the

matrix (figure 12):

Figure 12: Adjacency Matrix

He

Passed Marked Node TO B C D AND F G Minimum

Step 1 A, B 0 one TO 100 TO ∞ ∞ ∞ ∞ one

Step 2 A, B, D 0 one TO 100 TO two B 9 B ∞ ∞ two

Step 3 A, B, D, G 0 one TO 100 TO two B 9 B ∞ 4 D 4

Step 4 A, B, D, G, E 0 one TO 100 TO two B 9 B ∞ 4 D 9

Step 5 A, B, D, G, E, C, F 0 one TO 10 AND two B 9 B 10 AND 4 D 10

The minimum cost from A to C is 10, the sequence of nodes that makes the minimum path is A, B, E and C.

5. Adding turns to the net

The graphs represent an interconnected network system, such as a transportation network. But in some cases it is necessary

to add some restrictions on the turns that end up adding a cost to the route (traffic lights, turns allowed and not allowed,

level crossings, bridges, etc.).

www.tjprc.org [email protected]

Page 10: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

390 Javier Felipe Moncada Sánchez, Carlos Enrique Montenegro Marín & Yenny Espinosa Gómez

Figure 13: Directed Graph, Weighted and with Rotation Constraints

The problem presented in figure 13 shows the addition of turn restrictions or step restrictions between arches with

a specific weight. It can be seen in figure 13, that for example passing from arc AB to BE is impossible or not allowed,

while the passage from arc BD to DF is possible but the cost or impedance of this turn is 30.

Adding these costs to a routing algorithm in node-based charts is feasible, but leads to generating a tagged value

correction, since it requests that nodes can be reopened after being resolved.(Luxen, 2014). The mathematical handling

shown, by voracious algorithms like Dijkstra's, so far makes it almost impossible to develop the algorithm taking into

account these restrictions or turns. For this reason it is necessary to change or migrate the structure of the graph to

represent this new behavior.

One way to accomplish this problem is to expand the graph in such a way that it explicitly codes all possible turns

in your topology. This new node-based pseudo model is known as edgebased or Edge-expanded graph(Winter, 2002).

The construction is simple and essentially an enumeration of the input graph. First, each input directed arc is

transformed into an expanded node. Second, all turns of the input graph are numbered and correspond to a new arc with its

corresponding cost or impedance, in the expanded or expanded graph. These spins will only be taken into account if they

are not prohibited(Luxen, 2014). The expanded or enlarged graph of figure 13 can be seen in figure 14.

Figure 14: Expanded or Expanded Graph

Impact Factor (JCC): 9.6246 NAAS Rating: 3.11

Page 11: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

Mathematical Characterization of the Dijkstra Algorithm to Handle the Turntable 391

In practice, the size of the new data structure increases by about a factor of 2-3. But with the new graph and a

simple variation, the Dijkstra algorithm is sufficient to calculate the routes respecting the costs or turning impedances and

the restrictions of the model(Luxen, 2014).

The matrix of weights per arc, considering the weight as ∞ when there is no connection can be observed in the

adjacency matrix and the weight matrix by nodes (figure 15):

Figure 15: Adjacency Matrix and Weight Matrix by Nodes

In our case we want to go from node A to C in figure 13, so we should perform all the calculations starting at the

nodes that start at A (AB and AC) until we reach any node that ends at C (AC and EC) for figure 14.

He

Passed Marked AB BD DG GD BA DB DF EB EC EC FAITH EF AC AC Min.

one AB, BD 10

twenty-

one

AB

∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ twenty-

one

two

AB,

BD,

DG

10

twenty-

one

AB

32

BD ∞ ∞ ∞

61

BD ∞ ∞ ∞ ∞ ∞ ∞ ∞ 32

3

AB,

BD,

DG, GD

10

twenty-

one

AB

32

BD

46

DG ∞ ∞

61

BD ∞ ∞ ∞ ∞ ∞ ∞ ∞ 46

4

AB,

BD,

DG,

GD,

DB, DF

10

twenty-

one

AB

32

BD

46

DG ∞

57

GD

57

GD ∞ ∞ ∞ ∞ ∞ ∞ ∞ 57

5

AB,

BD,

DG,

GD,

DB, DF,

BA

10

twenty-

one

AB

32

BD

46

DG

68

DB

57

GD

57

GD ∞ ∞ ∞

70

DF ∞ ∞ ∞ 68

www.tjprc.org [email protected]

Page 12: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

392 Javier Felipe Moncada Sánchez, Carlos Enrique Montenegro Marín & Yenny Espinosa Gómez

6

AB,

BD,

DG,

GD,

DB, DF,

BA, FE

10

twenty-

one

AB

32

BD

46

DG

68

DB

57

GD

57

GD ∞ ∞ ∞

70

DF ∞

271

BA ∞ 70

7

AB,

BD,

DG,

GD,

DB, DF,

BA, FE,

EB, EC

10

twenty-

one

AB

32

BD

46

DG

68

DB

57

GD

57

GD

83

FAITH ∞

83

FAITH

70

DF ∞

271

BA ∞ 83

The minimum cost starting from AC and getting to AC is 200, in other words, the cost of the node in the expanded

graph. The minimum cost when starting from arc AB and arriving at arc EC is 83, the sequence of nodes that makes the

minimum path is AB, BD, DG, GD, DF, FE and EC for the expanded graph and its translation for the Initial graph would

be A, B, D, G, D, F, E and C.

We would select the last way since its cost of 83 is less than 200 of the first route (AC).

6. CONCLUSIONS

The mathematical study carried out on the Dijkstra algorithm demonstrated the need to construct graphs supported by

adjacency matrices and node weight matrices. These adjacency matrices supply and represent the behavior of the graphs

and the direction of the flow over the arcs between the nodes. Dijkstra's algorithm is capable of searching for the critical

path in any type of graph that contains positive impedance values, but it prevents it from returning on a marked node, this

is a problem when taking turns into account, for this reason it was necessary to know and understand the edgebased, Edge-

expanded or extended model, which although it supports the impedance of turns, behaves like a normal directed graph to

which it is possible to apply the Dijkstra algorithm.

The mathematical characterization of the Dijkstra algorithm to handle the turn table opens the door to many

developments on geographic tools, additionally it will bring many benefits for the development of Open Source GIS tools

projects in network analysis, and therefore may benefit the millions of users of them.

The understanding of the mathematical process of the voracious Dijkstra algorithm shown in this article allows

adding turning impedances that are not taken into account in many of the current processes carried out with some of the

Open Source GIS tools, therefore, it is constituted as a step for future work regarding its implementation process

in any of these tools.

REFERENCES

1. Aho, A. V, Hopcroft, J. E., & Ullman, J. D. (1988). Estructura de datos y Algoritmos. Addison Wesley.

2. Amado Barón, E. A. (2011). Aplicación de Dos Programas SIG Libres en la Obtenci’on de Redes Viales Urbanas a Partir de

Capas Vectoriales.

3. Barnes, J. A., & Harary, F. (n.d.). Graph theory in network analysis. Socia Networks, 5(2), 235–244.

4. Berghammer, R. (n.d.). Combining relational calculus and the Dijkstra Gries method for deriving relational programs.

Information Sciences, 119(3), 155–171.

5. Best, B. D., Halpin, P. N., Fujioka, E., Read, A. J., Qian, S. S., Hazen, L. J., & Schick, R. S. (2007). Geospatial web services

Impact Factor (JCC): 9.6246 NAAS Rating: 3.11

Page 13: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

Mathematical Characterization of the Dijkstra Algorithm to Handle the Turntable 393

within a scientific workflow: Predicting marine mammal habitats in a dynamic environment. Ecological Informatics, 2(3),

210–223. https://doi.org/https://doi.org/10.1016/j.ecoinf.2007.07.007

6. Bosque Sendra, J. (2000). Sistemas de Información Geográfica. Rialp, Madrid.

7. Bosque Sendra, J., Escobar, F. J., García, E., & Salado, M. J. (2000). Sistemas de Información Geográfica: Prácticas con PC

ArcInfo e Idrisi. Ra-Ma and Addison-Wesley Iberoamerica.

8. Bourgeois, K., Robert, S., Limet, S., & Essayan, V. (2017). Efficient Implicit Parallel Patterns for Geographic Information

System. Procedia Computer Science, 108, 545–554. https://doi.org/https://doi.org/10.1016/j.procs.2017.05.235

9. Brassard G. y Bratley, P. (1997). Fundamentos de Algoritmia. Editorial Prentice Hall.

10. Burrough, P. A. (1986). Principles of Geographical Information Systems for Land Resources Assessment. Clarendon, Oxford.

11. Chorley, R. (1987). Handling Geographic Information. Report of the Committee of Enquiry chaired by Lord Chorley. Londres,

Her Majesty’s Stationery Office.

12. Comas, D., & Ruiz, E. (n.d.). Fundamentos de Sistemas de Información Geográfica. Barcelona, Ariel S.A.

13. Davis, B. E. (2001). GIS: A Visual Approach. OnWord Pres, Canada.

14. Dijkstra, E. W. (n.d.). A note on two problems in connexion with graphs. Numerische Mathematik, 1(1), 269–271.

15. Fischer, M. M. (2003). GIS and Network Analysis.

16. Goodchild, M. F. (1998). Geographic Information Systems and disaggregate transportation modeling Geographical Systems.

17. Grimaldi, R. P. (1997). Matemáticas Discreta y Combinatoria, Una Introducción con Aplicaciones. Addison Wesley.

18. Hadley, G. (1962). Linear Programming. Universidad de Chicago.

19. Joyanes Aguilar, L., & Zahonero Martínez, I. (2008). Estructuras de Datos en Java. Mc Graw Hill.

20. Lantada Zarzosa, N., & Amparo, N. A. M. (2004). Sistemas de Información Geográfica, Prácticas con ArcView. Alfaomega.

21. Lipschutz, S., & Lipson, M. L. (2007). Matematicas Discretas. Mc Graw Hill.

22. Luxen, D. (2014). Flexible Route Guidance Through Turn Instruction Graphs. Proceedings of the 2nd ACM SIGSPATIAL

International Workshop on Interacting with Maps.

23. Maldonado Granados, L. F., & Serrano Iglesias, E. (n.d.). Construcción de una red de aprendizaje. Nómadas, (28), 211–222.

24. Martillo Bustamante, J. J. (2014). Análisis geoespacial de las características sociodemográficas de la población beneficiaria

del proyecto HAMURU ubicada en la parroquia Simón Bolívar.

25. Navarro, A. P. (2011). Introducción a los Sistemas de Información Geográfica y Geotelemática. Carrera: Barcelona.

26. Pedraza, L. F., López, D., & Salcedo, O. (n.d.). Enrutamiento basado en el algoritmo de Dijkstra para una red de radio

cognitiva. Tecnura, 15(30), 94–100.

27. Peñaranda Ortega, M., Osca Lluch, J., López ferre, M., Civera Mollá, C., & Tortasa Gil, F. (2009). Funcionamiento,

representación y Comportamiento de diferentes algoritmos frente al cálculo de un small world en ciencia. Nuevas

Perspectivas Para La Difusión y Organización Del Conocimiento: Actas Del Congreso, 99–110.

28. Restrepo C., J. H., Sánchez C., J. J., & Hoyos Mesa, M. (n.d.). Solución al problema de entrega de pedidos utilizando

reconocido simulador. Scientia et Technica, 1(24), 225–230.

29. Rolf, A. de B., Knippers, R. A., Sun, Y., Ellis, M. C., Kraak, M.-J., Weir, M. J. C., … Sides, E. J. (2000). Principles of

www.tjprc.org [email protected]

Page 14: MATHEMATICAL CHARACTERIZATION OF THE DIJKSTRA …

394 Javier Felipe Moncada Sánchez, Carlos Enrique Montenegro Marín & Yenny Espinosa Gómez

Geographic Information Systems. The International Institute for Aerospace Survey and Earth Sciences \(ITC\).

30. Salas S., A. H. (n.d.). Acerca del algoritmo de Dijkstra. ArXiv.Org.

31. Salas S., A. H. (2008). Acerca del Algoritmo de Dijkstra.

32. Soares, S. A. F., Leal, B. G., Pereira, R. G. B., Silva Junior, I. F., & Silva, D. M. B. (2015). Algoritmo de Dijkstra aplicado ao

problema do metro de Paris. ResearchGate.

33. Van Gelder, B. (2002). Algoritmos Computacionales, Introducción al Análisis y diseño. Addison Wesley.

34. Winter, S. (2002). Modeling costs of turns in route planning. GeoInformatica.

Impact Factor (JCC): 9.6246 NAAS Rating: 3.11