Effiziente Algorithmen für ein Fahrplanauskunftsystem

Size: px
Start display at page:

Download "Effiziente Algorithmen für ein Fahrplanauskunftsystem"

Transcription

1 Universität Konstanz Effiziente Algorithmen für ein Fahrplanauskunftsystem Frank Schulz Konstanzer Schriften in Mathematik und Informatik Nr. 11, Januar 2 ISSN c Fakultät für Mathematik und Informatik Universität Konstanz Fach D 188, Konstanz, Germany preprints@fmi.uni konstanz.de WWW: konstanz.de/schriften/

2 Effiziente Algorithmen für ein Fahrplanauskunftsystem Efficient Algorithms for a Timetable Information System Diplomarbeit von Frank Schulz Universität Konstanz Fakultät für Mathematik und Informatik Dezember 1999

3 Abstract Algorithms for timetable information systems are usually based on Dijkstra s algorithm. The concrete scenario that we have in mind is a central information server in the realm of public railroad traffic on wide-area networks. Due to the large size of the underlying timetables the efficiency of a naive implementation is not acceptable in practice, so usually heuristics are used to improve the efficiency. Typically, using such heuristics means that the optimality of the solutions can no longer be guaranteed. In contrast, we investigate optimality-preserving speed-up techniques for Dijkstra s algorithm. The basic question is whether algorithms that compute optimal solutions are competitive on contemporary computer technology. Therefore, we present the results of a computational study based on real-world data: the timetable that contains all German trains, and a snapshot of customer queries to an existing information server. Acknowledgements The author would like to thank Dorothea Wagner and particularly Karsten Weihe for their great support.

4 Contents 1 Introduction 1 2 Foundations Points in Time Problem Definition Model Input Data Related Work Algorithms Dijkstra s Algorithm Priority Queue Goal-Directed Search Bidirected Search Angle Restriction Selection of Stations Combination of Techniques Analysis of Algorithms and Performance Computational Study Review of the Speed-up Techniques Further Results of the Computational Study Final Remarks Conclusion Outlook A Collection of Histograms 59 A.1 Comparison of Efficiency-Parameters A.2 Comparison of Techniques

5 Chapter 1 Introduction Imagine you want to travel by train from some station A to another station B. What is the best connection between these stations? This question is the basic motivation for the study. The connection should be the best. This is a very subjective term and has to be defined. Your preference could for example be: What is, among the fastest connections leaving A between 1 and 11 o clock, the one with the fewest train changes? This study will focus on the most fundamental kind of queries: What is the fastest connection leaving A not earlier than a specified time. It will soon be clear that, theoretically, the problem is not hard: Dijkstra s algorithm solves it with a worst-case complexity of O(n log n), if n denotes the number of all departures in the timetable. However, in practice it is not enough to have the guarantee of a good asymptotic worstcase behaviour. The absolute amount of time that is needed to solve queries is crucial. We have a concrete scenario in mind: an information system for the timetable containing all German trains, which is operated on a central server. The ticket offices may be connected to that server, or it may be accessible through a web-interface. So, the system has to be able to answer a large number of on-line queries. The real-time restrictions are soft, which basically means that the average response time is more important than the maximum response time. Since the system is operated on a central server, space consumption is not an issue. The average response time of exact solvers (e.g., the naive implementation of Dijkstra s algorithm) seems to be inacceptable, so usually the problem is approached heuristically. In contrast, we want to investigate whether optimality-preserving algorithms can cope with the requirements of a timetable information system, which basically means that the algorithms have to be efficient enough to guarantee the required low average response time. As mentioned above we focus on one simple optimization criterion: the minimization of the traveltime. The characteristics of the real-world data will be crucial for the success or failure of the algorithms that we will present. Hence, experiments with artificial data do not make

6 Introduction 2 much sense, and so our computational study will be based on real-world data (see [21] for a discussion of this problem). Overview In Chapter 2 the problem is formally defined, and a graph model is introduced where fastest connections correspond with shortest paths. The design of that model is crucial, it is the basis for all algorithms. Then, some details of the real-world timetable and queries, which are later used for the experiments, are presented to give an impression of the characteristics of the input. The chapter ends with an overview of related work. The next chapter describes the algorithms. It begins with a detailed description of Dijkstra s algorithm and of two implementations of a priority queue. Fundamental extensions improving the efficiency are shown. Then, four optimality-preserving speed-up techniques are presented. The chapter concludes with considerations concerning the combination of the speed-up techniques. In Chapter 4 the computational study is presented. The set-up of the experiments is described, and the results are shown. With that background, the four speed-up techniques are reviewed. Then, the results of the computational study are analysed in detail. In the final remarks the results are summarized and an outlook concerning aspects of generalization is given.

7 Chapter 2 Foundations 2.1 Points in Time The aspect of time is fundamental for this study. The smallest time unit is a minute. To describe points in time, one first day is determined such that all points in time that we want to describe do not occur before that first day. Then, the minutes past o clock of the first day are used to describe a point in time, mostly denoted by the letter t. Note that not all points in time that we will use refer to the same first day. Only points in time that refer to the same first day can be compared according to minutes past midnight, for example to calculate the time difference. Sometimes, only the time of day is of interest. For example, 1 o clock in the morning will be described by t = 6 or t = = 24. We will need a unique representation of a time of day: δ(t) denotes the smallest non-negative integer r such that r t (mod 144). Additionally, we define the daily-difference δ(t 1, t 2 ) of two points in time t 1 and t 2 to be the smallest non-negative integer r such that r t 2 t 1 (mod 144). Imagine that your clock shows the current time of day t 1. The daily-difference δ(t 1, t 2 ) of t 1 and any other date t 2 constitutes the minimum amount of time necessary to reach the time of day of t 2. For example, if t 1 = 2875 = (i.e., 5 minutes to midnight, second day) and t 2 = 5 (i.e., 5 minutes past midnight, first day) then δ(t 1, t 2 ) t 2 t (mod 144) The time needed to reach the time of day of t 2 is therefore 1 minutes. 2.2 Problem Definition As mentioned above, we want to focus on the most fundamental kind of queries concerning train connections. Additionally, we make another simplification for the problem definition: Each train is assumed to operate daily. The consequences of these restrictions on the

8 2.2 Problem Definition 4 model and the algorithms will be discussed later. The restrictions make it possible to formulate the problem in a relatively easy way. Of course, a train timetable is based on a set of stations and a set of trains. Each station has a geometric location, which can be specified by two coordinates. A train can be viewed as a sequence of departures and arrivals at all the stations the train passes. First, the train leaves the start station, then it arrives at the next station, stays there several minutes, departs again, and so on. Finally, it arrives at the destination. Definition A station is a triple (S, x, y) where S is a unique station ID, and (x, y) represents the geometric location of the station. A train tr consists of a list of pairs ((S 1, t 1 ), (S 2, t 2 ),..., (S n, t n )). A pair (S i, t i ) represents a certain time t i (in minutes past midnight of the first day) at a station with ID S i. The pair with index i is denoted tr[i], the elements of that pair station(tr[i]), and time(tr[i]). The value l(tr) := n is called the trainlength of train tr. For a valid train the following statements must hold: n is even for odd i, S i S i+1 for even i, either i = n or S i = S i+1 A pair (S i, t i ) of a trainlist represents an arrival or a departure of the train at some station S i (a departure if i is odd, an arrival otherwise). The time t i is defined to be in minutes past midnight of the first day. For example, if a train leaves its first station at 8 pm, then t 1 = 2 6 = 12. If the next arrival at station S 2 = station(tr[2]) is five hours later, then t 2 = t = 15 or, in other words, the second day of the train at 1 am. With that definition, a timetable could be described as a set of stations and a set of trains. Then, we want to find connections between two stations. A connection describes a train trip from a station A to a station B. Such a connection may use parts of several trains tr 1,..., tr n. For each of these trains the part that is used is specified by an interval [i k, j k ], where 1 i k < j k l(tr). Each of these parts begins with a departure and ends with an arrival (i.e., i k is odd and j k is even). Each connection has a traveltime: The traveltime is the sum over all time differences time(tr k [j k ]) time(tr k [i k ]) plus the time needed for the stays at stations to change trains. With the described modelling of the trains, where each train has its own calendar, it is not possible to define the traveltime to be the difference between the time of the arrival at the destination station and the time of the departure at the start station. Imagine

9 2.2 Problem Definition 5 a connection consisting of two trains. The first train is an overnight train that stops at our start station at 6 o clock in the morning on its second day and leaves 5 minutes later (t start = = 185). The first train stops later somewhere at 8 o clock where we change trains and continue with a second train, which starts at that station (that means for the second train it is the first day) 5 minutes past 8 o clock. The second train reaches our destination station at 1 o clock on its first day (t dest = 1 6 = 6). The difference t dest t start becomes negative because for the two points in time different days are used as first days (see Section 2.1 on page 3). Therefore, we have to calculate the time differences separately for each train, where for all points in time the determined first day is the same. Definition A connection between two stations A and B is a list of triples ((tr 1, i 1, j 1 ),..., (tr n, i n, j n )), where 1. tr k are trains 2. 1 i k < j k l(tr k ), and i k is odd, j k is even, for all k with 1 k n 3. station(tr 1 [i 1 ]) = A 4. station(tr n [j n ]) = B 5. station(tr k [j k ]) = station(tr k+1 [i k+1 ]) for each k with 1 k < n The traveltime of a connection is n n 1 (time(tr k [j k ]) time(tr k [i k ])) + δ(time(tr k [i k ]), time(tr k+1 [j k+1 ])) k=1 k=1 The starttime of a connection is δ(time(tr 1 [i 1 ])). Finally, there are the (simple) queries: Find the fastest connection from a station A to another station B, departing at a specified time t. Naturally, the feasible connections start at A and end at B. The total amount of time for a feasible connection is then the traveltime of the connection plus the daily-difference of the departure time t and the starttime of the connection.

10 2.2 Problem Definition 6 Definition A query is a triple (S, D, t), where S denotes the source station, D the destination station, and t is the departure time. Given a query (S, D, t), a connection ((tr 1, i 1, j 1 ),..., (tr n, i n, j n )) is feasible if station(tr 1 [i 1 ]) = S and station(tr n [j n ]) = D. 1 The totaltime of a feasible connection is traveltime + δ(t, starttime) Now, all necessary terms for the formal problem definition are introduced. The input for the problem consists of two different parts: On one hand, there is the railroad network and the timetable (i.e., the stations and trains). This data (called the static input in the following) is known off-line and could be subject to optimizations in a preprocessing step. On the other hand, the queries (called the on-line input in the following) are not known before they are asked, and have to be processed on-line, that is at the moment they are asked. Problem Definition Input: Static Input: The railroad network together with the timetable. Formally, this input consists of a set of stations and a set of valid trains. On-Line Input: A - possibly infinite - sequence of queries. These are not known in advance and have to be processed on-line. Output: For each query (S, D, t) the totaltime of a fastest connection. A fastest connection is a feasible connection with minimum totaltime. Note that the problem definition implies that an optimal solution for each query is requested, where optimal means minimum totaltime. Other technical requirements concerning algorithms for the problem have been discussed in the introduction. The main requirement has been that the algorithm has to be fast to get a low average response time. In contrast, we assume the space consumption not to be very important. 1 The departure time t does not have any influence whether a connection is feasible or not. But the totaltime of a feasible connection depends on the departure time. The goal is now to find a feasible connection with minimum totaltime, where the departure time is crucial.

11 2.3 Model Model For the given problem we have now to find a fast algorithm. First of all, we need a model that allows us to formulate the algorithm. At first glance, we have a network consisting of stations which are connected by trains. In other words, we have a graph with one node for each station and an edge between two stations A and B, if there is a train connecting station A and station B. For graphs, there are the well-known algorithms to find shortest paths. It seems to be the most natural approach to construct a similar graph, where fastest connections correspond to shortest paths. Therefore, we define a so-called traingraph, on the basis of the static input data. The traingraph should be a directed graph, because the trains are directed Definition of the Traingraph Let the static input data be the stations st 1,..., st n and the valid trains tr 1,..., tr m. For the definition of the graph, we need additional terminology. An event represents an arrival or a departure of a train at a station. In the formal description, the elements of the trains tr i (pairs tr i [j] = (S j, t j )) are the events. These pairs could not be taken directly as a formal definition of events, because if two trains tr 1 and tr 2 start at the same station with number S at the same time t, then tr 1 [1] = tr 2 [1] = (S, t), but they should be different events. Therefore, we take the train index and the index of the trainlist-element to identify the events uniquely. Definition Each element of the set {(i, j) 1 i t, 1 j l(tr i )} is called an event. An event (i, j) represents an arrival or a departure of a train tr i. The terms station and time are defined naturally for an event e = (i, j): station(e) = station(tr i [j]) and time(e) = time(tr i [j]). An event e = (i, j) is called arriving if j is even, leaving otherwise. The traingraph contains one node for every event. For every station with ID S there is a set of nodes, namely all events (i, j) of that station (i.e., station(tr i [j]) = S). An edge in the traingraph should represent one elementary part of a connection. On one hand, there are direct connections. Between each event representing the departure of a train and the event representing the very next arrival of that train there is an edge in the graph, called a direct-edge. On the other hand, a stay at a station is also a part of a connection. Imagine, all events of a station are sorted by their time, and if the times of two events are equal, the event representing an arrival precedes the event representing a

12 2.3 Model 8 departure. Then between two successive events there is an edge, as well as between the last event and the first event of that station. The latter represents a stay at a station over midnight. All edges representing stays are called stay-edges. A stay at a station between two nodes u and v is the (uniquely determined) part of the cycle that begins at u and ends at v: the staypath from u to v. For our particular problem, we have to find the fastest connection between two stations. Therefore, the length of a direct-edge is the difference between the times of the events represented by the endnodes of the edge (the real difference). If the edge is a stay-edge, the length has to be the minimum amount of time necessary to reach the time of day of the head event: the daily-difference between the times of the two endnodes (see Section 2.1 on page 3). It follows that the length of the staypath from u to v is equal to the dailydifference δ(time(u), time(v)) Let us summarize the definition of the traingraph: Definition of the Traingraph Nodes: One node for every event. We identify a node v with the corresponding event e v = (i, j). Edges: Direct-Edges: There is an edge (v, w) if v = (i, j) is a leaving event, and w = (i, j + 1). Stay-Edges: Let e 1,..., e l be all events belonging to one station. These events are sorted such that δ(time(e i )) < δ(time(e j ) i < j, and δ(time(e i )) = δ(time(e j )) and e i arriving and e j leaving i < j For each k with 1 k < l there is an edge (e k, e k+1 ), as well as there is an edge (e l, e 1 ). Edgelength: The length of an edge (e 1, e 2 ) is { δ(time(e1 ), time(e l(e 1, e 2 ) = 2 )) if the edge is a stay-edge time(e 2 ) time(e 1 ) if the edge is a direct-edge Figure 2.1 shows an example of a very simple traingraph. The input data consists of three stations A, B and C, and three trains. For each column of the train lists - the events - the traingraph has one node. Each station is represented in the traingraph by a cycle that contains all events belonging to that station. These are the so-called stayedges. Then, for each successive pair of leaving and arriving events of a train there is a direct-edge in the traingraph, connecting different stations.

13 2.3 Model 9 A Train I leaving A1 6 arriving B1 7 leaving B1 7:5 arriving C1 8 A Train II B C leaving B1 1 arriving A Train III leaving A1 7 arriving C1 9 1 B 9 C Figure 2.1: Example of a simple traingraph. The input data consists of three stations and three trains Shortest Paths We want to solve the queries and have to find fastest connections. How could such a query be solved using the traingraph? Obviously, paths in the traingraph correspond to connections: Given a connection, the corresponding path is uniquely determined: The connection naturally defines a sequence of direct-edges, each pair of successive leaving and arriving events inside the index range of every used train defines one direct-edge. Then, stay-edges have to be inserted: For two successive direct-edges, the endnode u of the first edge and the startnode v of the second edge belong to the same station. If the staypath from u to v is inserted in the sequence of direct-edges between each successive pair of direct-edges we get a path from the start station to the destination station. The traveltime of the connection and the length of the corresponding path are equal. On the other hand, a path in the traingraph defines a connection from the station of the startnode (startevent) to the station of the endnode. The connection is the sequence of all direct-edges belonging to the path, in the order they appear: Let the startnodes of the direct-edges belonging to the path be (v 1 = (i 1, j 1 ),..., v n = (i n, j n )). Then, the connection is c := ((tr i1, j 1, j 1 + 1),..., (tr in, j n, j n + 1)) The starttime is equal to the time of day of the startnode of the first direct-edge. If we want to compare the length of the path and the traveltime of the connection, there is a problem: At the beginning and at the end of the path there may be a sequence of stay-edges. These are not used in the above definition of the connection.

14 2.3 Model 1 So, the traveltime of the connection and the length of the path differ only in the length of the leading staypath. Let the query be (S, D, t): Find the fastest connection from station S to station D leaving S at time t (i.e., t minutes after midnight). Then, we compute a shortest path in the traingraph. Again, assume that all events e 1,..., e l belonging to the station S are sorted in the way described in the definition of the traingraph on page 8. Let k be the index of the maximum of all events with a time value smaller than t (if there is no such event, k = ). If k < l, then e k+1 is the start node v, otherwise e 1. In other words, v is the first event occurring after the time t. The destination node w is the event belonging to the destination station D with the smallest distance (i.e., length of a shortest path) to v. In particular we can assume that the last edge of a shortest path from v to w is a direct-edge. Definition A shortest path p from a startnode s to a station D is a path from s to an arbitrary node belonging to D with length(p) = min{length(p ) p is a path from s to any node of D} From a shortest path p from v to w a connection c could be defined as described above, with traveltime t t and starttime t s. Since this connection ignores the leading staypath the length of the path is equal to the traveltime of the connection plus the length of the leading staypath: l(p) = t t + δ(time(v), t s ) Obviously, the connection is feasible. The claim is now that this connection is of minimum totaltime. Proof: Assume that there is a connection c with less totaltime, with traveltime t t, and starttime t s. That means t t + δ(t, t s ) < t t + δ(t, t s ) Since there is no node at the source station S with a time between t and time(v) for any node u belonging to S it holds δ(t, time(u)) = δ(t, time(v)) + δ(time(v), time(u)). With that, we have t t + δ(time(v), t s ) < t t + δ(time(v), t s ) We switch now back into the traingraph: The connection c determines a path p. The length of that path is equal to t t and the startnode has the time t s. This path can be

15 2.4 Input Data 11 extended to a path from v to w by prepending the staypath from v to the startnode of p. The extended path p has the length l(p ) = t t + δ(time(v), t s ) < l(p) This constitutes a contradiction to the pre-condition that p is a shortest path. We have proved that the connection that we get from a shortest path in the traingraph is a fastest connection. The problem is reduced to finding a shortest path starting at a given node v. The destination node is not determined in advance, but there is a set of destination nodes: the nodes belonging to the destination station. To summarize that result, we give an equivalent problem definition: Problem Definition, Formulation II Input: Static Input: a traingraph On-Line Input: a - possibly infinite - sequence of queries. These are not known in advance and have to be processed on-line. Output: For each query (S, D, t) the length of a shortest path from the node belonging to S occurring immediately after t to D. 2.4 Input Data The characteristics of the data plays an important role for this study. The goal is to use the special structure and additional information (e.g., coordinates of stations) of real-world data to get fast algorithms. Static data The basis for the experimental study and for the statistics is the timetable data (winter period 1996/97) of all german trains. 2 The data contains 45, 848 trains operating on 6, 961 stations. The traingraph for that timetable has 933, 66 nodes. Consequently, there are 933, 66 3/2 = 1, 339, 599 edges in the traingraph. Since every node represents an event (i.e., an arrival or a departure), there had been on average 134 events per station and day during the winter period 1996/97. Figure 2.2 shows a detailed distribution. 2 With special courtesy of the TLC Transport-, Informatik- und Logistik-Consulting GmbH/EVA- Fahrplanzentrum, a subsidiary of the Deutsche Bahn AG.

16 2.5 Related Work number of stations number of events Figure 2.2: The distribution histogram of the stations according to the total number of events at that station (granularity: 5 events). On-line data Without realistic on-line queries the algorithms could not be optimized for a real-world scenario and no realistic statistics could be done. The processed queries are a snapshot of the central Hafas 3 server of the Deutsche Bahn AG, the national railroad and train company of Germany. All queries of customers of all ticket offices in Germany have been recorded over several hours. The snapshot consists of more than half a million queries, which might be representative for that special service. The Euclidean distance between the two stations is on average 22 km, whereas a fastest connection takes 276 minutes on average. Figure 2.3 shows the distribution of the queries according to the Euclidean distance between the source and destination station. It is not surprising that for most of the queries, the source and destination station are relatively close. 2.5 Related Work The shortest path problem is one of the most elementary graph problems. There are several different variants, and there are simple and efficient solvers available. Many textbooks devote whole chapters to shortest path problems. We will discuss which variant of the problem we have here and which algorithms can be used as a basis to solve our problem efficiently. After that, we want to have a look on work concerning the general problem itself, that means work on information systems for public transportation or similar systems. 3 Hafas is a trademark of the Hacon Ingenieurgesellschaft mbh, Hannover, Germany.

17 2.5 Related Work Figure 2.3: The distribution histogram of the snapshot of customer queries according to the Euclidean distance between the start station and the destination (granularity: 15km) Figure 2.4: Like Figure 2.3 except that the abscissa now denotes the totaltime of a fastest connection in minutes (granularity: 2 minutes)

18 2.5 Related Work Theoretical Work Problem Classification problems are investigated: In the literature [1, 5, 15] the following different shortest-path 1. Single-pair: Find the shortest path from one node to another node 2. Single-source: Find shortest paths from one node to all other nodes 3. All-pairs: Find shortest paths from every node to every other node Obviously, from 1 to 3 the problem gets more general. The single-pair problem gets solved along with the single-source problem, and every single-source problem gets solved along with the all-pairs problem. Algorithm Classification The algorithmic approaches for solving shortest path problems could be classified according to [1] into two groups: label-setting and label-correcting. Both approaches are iterative. They assign tentative distance labels to nodes at each step - the distance labels are upper bounds on the shortest path distances. Label-setting algorithms designate one label as permanent (optimal) at each iteration. In contrast, label-correcting algorithms consider all labels as temporary until the final step, when they all become permanent. Label-setting algorithms often require special graphs, for example acyclic graphs with arbitrary edge lengths or graphs with nonnegative edge lengths. The label-correcting algorithms are more general and apply to all cases of problems, but the label-setting algorithms are much more efficient. Suitable Algorithms Since for our problem the source node is given, we have a singlesource problem, and because of the set of destination nodes, it is not a single-pair problem. But, with a small modification of the traingraph, we get a single-pair problem: An additional node t is introduced, and for each node belonging to the destination station, an edge with zero edge length is added from that node to t. This node t is then the single destination node for the single-pair problem. Therefore, concerning the problem class, all known shortest-path algorithms are suitable. Because the traingraph has nonnegative edge lengths a label-setting algorithm could be used. One reason to do that is the better asymptotic behaviour of label-setting approaches (see the paragraph concerning the algorithm classification). Another reason is that labelsetting algorithms could be terminated when the destination node is designated to be permanent; for label-correcting algorithms this could not be done. It turns out that this technique reduces the number of iterations drastically when real-world queries are applied to the algorithm. The fastest label-setting algorithm solves the problem with an asymptotic worst-case running time linear in the number of edges (see [1], Section 4.4). It relies on a topological ordering of the nodes; this requires an acyclic graph. Unfortunately, the traingraph contains cycles, so this algorithm is not suitable for our problem. It remains Dijkstra s

19 2.5 Related Work 15 algorithm: A label-setting algorithm for graphs with nonnegative edge lengths, which was suggested first by Dijkstra [9] and, independently, by Dantzig [7] and Hillier [22]. Dijkstra s algorithm solves the single-source shortest path problem. There are several variants of the algorithm, including modifications to solve the single-pair problem more efficiently in practice (in his original paper [9], Dijkstra suggested for single-pair problems to terminate the algorithm when the destination node is designated to be permanent). Dijkstra s Algorithm The set of all nodes is divided in three parts: the set of permanent, touched and untouched nodes. Every node is assigned a distance label, initialized with an infinite value. In the beginning, the source node gets the distance label and is designated to be touched, all other nodes are untouched. Then, the iteration begins. In each iteration, a touched node with smallest distance label is taken. It is designated to be permanent. Let the distance label of that node be d. Further, all outgoing edges of the node are considered. If the distance label of the other endnode of an considered edge is greater than the edge length plus d, that distance label is updated by the latter value, and the node is designated to be touched. If there are no more touched nodes, the algorithm terminates. The distance labels of all permanent nodes contain the length of a shortest path from the source node. To reconstruct the shortest paths that have been found for the permanent nodes, each node has to be assigned an edge: the last edge of the shortest path. To get these edges, the updating step of the algorithm has to be extended: If the distance label of an endnode of a considered edge has to be updated properly, that edge becomes the last edge for that endnode. As usual, n denotes the number of nodes and m the number of edges. The worstcase complexity of the algorithm as it is formulated above is O(n 2 ). This is the optimal running time for fully dense graphs, because then m Θ(n 2 ) and, of course, every edge has to be examined. Selection of the smallest touched node The algorithm does not determine how a smallest node is selected from all touched nodes. Usually, the touched nodes are stored in a priority queue. For sparse graphs, the worst-case bound of the algorithm can be improved using an efficient priority queue. If a d-heap is used with d = max{2, m/n} the algorithm runs in O(m log d n) time [1]. The best known strongly-polynomial time bound is O(m + n log n) and is achieved using a Fibonacci heap [11]. Another approach is the Dial variant (see [1], [1] Section 4.6). The running time depends on the largest edge length C of the graph and therefore is pseudo-polynomial (O(m + nc) worst-case complexity, see Section for details). There are several extensions of Dial s variant with better worst-case running time [2, 8]. Computational results [13] suggest that it might be the fastest label-setting algorithm for suitable applications.

20 2.5 Related Work 16 Speed-up techniques for single-pair problems The following techniques allow us to solve single-pair problems faster in practice, but not in the worst-case. The bidirectional Dijkstra s algorithm (see [1] Section 4.5, [15] Section ) simultaneously applies the normal or forward variant of the algorithm starting at the source node and a so-called reverse variant of Dijkstra s algorithm starting at the destination node. The algorithm can be terminated when one node on a shortest path from the source to the destination has been designated to be permanent by both the forward and the reverse algorithm. The goal-directed unidirectional search (see [15] Section , [12]) uses lower bounds on distances to the destination node. The idea is to modify the edge lengths in order to direct the search (by applying Dijkstra s algorithm) towards the destination. Then, the algorithm could be terminated earlier. Let λ(v) be a lower bound on the distance to the destination for a node v. The edge lengths are modified as follows: length(v, w) := length(v, w) λ(v) + λ(w) To avoid negative edge lengths, the bound has to fulfill a consistency condition: length(v, w) + λ(w) λ(v) for every edge (v, w) For every path (s, v 1, v 2,..., d) from the source s to the destination d, the length of that path is modified only by the constant value of λ(s): length(p) = length(p) λ(s) + λ(v 1 ) λ(v 1 ) + λ(v 2 ) λ(v 2 ) λ(d) }{{} = length(p) λ(s) Thus, a shortest path in the modified graph is a shortest path in the original graph, and vice versa. For example, assume that the graph is embedded in a metric space, and the edge length is the distance between the two endnodes. Because of the triangular inequality, the distance between a node and the destination is a valid lower bound on the length of a shortest path. An edge that points directly towards the destination has a modified edge length of zero, while the modified length of an edge that points in the other direction is twice the distance. For many Euclidean graph models it is shown that the average running time is linear in the number of nodes [18] Application-Oriented Work Public railroad transport Most application-oriented work in this field is commercial, not scientific. Concerning wide area networks, there are for example publications about traffic planning [4], but algorithms for optimal connections are published very rarely. Algorithms based on a hierarchical goal-directed variant of Dijkstra s algorithm are presented in [16] (see also Section 3.6.1, page 32).

21 2.5 Related Work 17 Local public transport is quite different from wide-area public transport, because the timetables are very regular, and the most powerful speed-up techniques are based on the strict periodicity of the busses, trains, etc. In contrast, the experience is that the timetables of the national European train companies are not regular enough to gain a significant profit from these techniques. Private transport In view of wide-area networks, private transport has been extensively investigated. This means mainly routing planners for cars on city and country maps. The problem is different to ours in that it is two-dimensional. For a travel by car, the departure time is not important, in case temporal aspects like rush hours are ignored. In contrast, the departure time is significant in our scenario due to the fixed departure and arrival times for trains and the lack of periodicity. So it is not surprising that the research has focused on purely geometric techniques. One example showing an approach for car navigation is [14]: A graph representing a topographical map is hierarchically partitioned by regional boundaries into components. From one hierarchical level to the higher one, only the boundary nodes of the components are considered. In Chapter 3 we investigate similar ideas.

22 Chapter 3 Algorithms Overview This chapter describes algorithms solving the problem defined in Chapter 2. The algorithms find a shortest path among all paths in the traingraph from a certain startnode to a set of destination nodes. In the last chapter we have seen that Dijkstra s algorithm is a good basis. First, this algorithm is introduced in detail. The data structure needed by the algorithm is a priority queue. Two different implementations of priority queues are discussed. Then, in addition to the fundamental extensions of the algorithm, four speed-up techniques are presented: They all reduce the size of the search space, that is the number of nodes which have to be touched searching the shortest path. All of these variants of Dijkstra s algorithm have been implemented in C++. A byproduct of that implementation is the visualization of the individual algorithms. Visualization The traingraph is naturally embedded in the plane, as every node belongs to a station and every station is embedded in the plane by it s two coordinates. All edges are straight lines. Note that normally more than one edge of the traingraph will map to one visible edge in the embedding. The structure of a traingraph suggests that there are crossing edges in that embedding of the traingraph. For example, a long direct-edge (i.e., a direct connection between two stations with a large traveltime) will normally connect two stations that are far away with respect to the Euclidean distance. With high probability, such an edge will cross smaller edges. For the visualization of the algorithms, the whole railroad network is indicated by drawing all relatively small edges of the traingraph in the background. The timetable described in Section 2.4 (page 11) is used as static data. Then, one algorithm, that is a certain combination of strategies, is applied to a sample query: Find the fastest connection from Berlin Main East Station to Frankfurt/Main Main Station, with the departure time 1 o clock. All edges that are touched by the algorithm are drawn highlighted in the foreground of the picture. See Figure 3.1 on page 2 for a first example of the visualization of algorithms.

23 3.1 Dijkstra s Algorithm Dijkstra s Algorithm The Algorithm The original algorithm for shortest paths proposed by Dijkstra [9] has been described in Section We have seen that a priority queue Q could be used to store the touched nodes. A priority queue is an abstract data type for maintaining a set of elements, if each element has an associated key. Here, the keys are integer values. The priority queue supports the following operations: insert(q, x) inserts the element x, or relocates it if already x Q minimum(q) returns the element with the minimum key extract-minimum(q) removes and returns the element with the minimum key empty(q) returns true iff there is no element in the queue The following section shows two different implementations of a priority queue. With that data type we are able to reformulate Dijkstra s algorithm (the single-pair variant) in a short form. The input is a directed graph (V, E) with nonnegative edge lengths l(e). The source node is s and the destination node is t. Each node v V is assigned a distance label d(v), which serves as a key for the priority queue. Dijkstra s algorithm 1. for all v V : d(v) 2. d(s) and insert(q, s) 3. while not empty(q) do 4. v extract-minimum(q) 5. if v = t then terminate the algorithm 6. for all outgoing edges e = (v, w) of v do 7. if d(w) > d(v) + l(e) do 8. d(w) d(v) + l(e) 9. insert(q, w) We want to use this algorithm to solve queries. For each query we are given the source node s at the source station S, and the destination station D. In Section 2.5.1, the paragraph about suitable algorithms (page 14), it was shown how to modify the traingraph in order to apply a single-pair algorithm: A single destination node is needed instead of a destination station. We have to add a new node, which becomes the destination node. It belongs to the destination station (which means basically that it inherits the coordinates). All nodes of the destination station are connected by additional edges of length with the

24 3.1 Dijkstra s Algorithm 2 Figure 3.1: The single-pair variant of Dijkstra s algorithm with restriction of search horizon. new destination node. What we want to have is a shortest path from s to the node at the destination station which allows the smallest shortest path from s to the destination station. From a shortest path from s to the additional node we can obtaion the desired shortest path by omitting the last edge: Since the length of the path is not changed by omitting or adding one of the additional edges, a path from s to the destination station with smaller length would lead immediately (by adding the edge with zero length) to a path from s to the additional node with smaller length than the path with which we started, and that was a shortest path. Hence, the above algorithm could be used as it is to solve the query Fundamental Extensions Restriction of search horizon Note that in Step 5 the algorithm is terminated when the destination node is designated to be permanent. This is one of the advantages of the label-setting algorithms (see Section 2.5.1, page 14). In other words, the search horizon of the algorithm is restricted. The algorithm traverses the nodes of the graph starting at s in the order of increasing shortest-path length. Informally speaking, a wavefront (the nodes in the priority queue) starts at the source node and spreads throughout the graph. When it has passed the destination node, the algorithm terminates. Figure 3.1 shows the visualization of Dijkstra s algorithm with restricted search horizon applied to the sample query.

25 3.2 Priority Queue 21 Avoiding Initialization of Nodes The analysis of the snapshot consisting of realistic on-line queries has shown a small totaltime for a fastest connection between the source station and the destination station on average (see Figure 2.4 on page 13). This fact strongly suggests that with the restriction of the search horizon for most of the queries only a small part of the graph has to be touched by the algorithm in the Steps 2-6. The only obstacle to sublinearity is Step 1: the initialization of the distance labels. If the algorithm is applied only once, Step 1 is inevitable. But we want to apply the algorithm again and again with the same traingraph. In that case, an amortization technique as it is discussed in [2] can be used to avoid the initialization step: Every node is given an additional time stamp, which stores the number of the query when it was designated to be touched or permanent the last time. Before the first query, these time stamps have to be initialized with a zero value, but this initialization is done once and for all. 1 If a node is reached by the algorithm, the following two cases have to be distinguished: If the time stamp of the node is smaller than the current query number, the distance label is considered to be infinite. The time stamp is updated. If the time stamp and the current query number are equal, the distance label is taken as is. With this technique, the expensive initialization step needs not to be done again and again for each query. Nodes that are outside the search horizon are not touched by the algorithm at all. 3.2 Priority Queue We want to discuss now the possibilities how to implement a priority queue managing the set of touched nodes. Regarding the worst-case running-time of Dijkstra s algorithm, the priority queue is the heart of the matter. Despite that, the statistics will reveal that the choice of the priority queue is not that important for the actual performance of the algorithm. There are several approaches to implement a priority queue (see Section 2.5.1, page 15). Most of them are based on some kind of heap, for example a binary heap, a d-heap or a Fibonacci heap. In the traingraph, each node has three adjacent edges. That means that the number of edges m is linear in the number of nodes n. Consequently, the worstcase running time for Dijkstra s algorithm with each of the heap implementations (we mentioned the complexities in Section 2.5.1) becomes O(n log n). That is the best known worst-case complexity for Dijkstra s algorithm on a graph like the traingraph. We choose a binary heap as representative for heap implementations. 1 In practice, the time stamp is an integer variable which has a maximum value. If more queries than that maximum value have to be solved, the initialization has to be done more than once.

26 3.2 Priority Queue 22 In practice, Dial s implementation of Dijkstra s algorithm often is the fastest one. Therefore, Dial s variant is investigated, too. We get Dial s implementation by using a special priority queue with the above definition of Dijkstra s algorithm. That queue will be called Dial s queue. There are extensions of Dial s implementation, for example the radix heap implementation [2], but our experience has shown that Dial s implementation works very well with the traingraph since the maximum edge length of the traingraph is relatively small compared with the number of nodes. The following two sections will present the two priority queues Binary Heap In a binary heap the elements are stored as nodes in a rooted tree whose directed edges represent a predecessor-successor relationship: The key of the tail element has a smaller or equal key than the head element. The head is called successor of the tail, and the tail is called predecessor of the head. Every node except the root has exactly one predecessor. The heap is called binary because every node has at most two successors. root Clearly, the empty operation and the minimum operation require constant time, since the root of the tree is an element with minimum key value. The other operations insert (including relocate) and extract-minimum can be implemented such that they require O(log n) time, if n denotes the number of elements in the heap. See Appendix A of [1] for details Dial s queue Restricted priority queue The priority queue used in Dial s implementation is not as general as the binary heap. There are two constraints concerning the keys of the elements: 1. The keys have to be integers

27 3.2 Priority Queue Let the width of the queue be the difference between the maximum and the minimum of the keys that are in the queue at a certain time. That width must not exceed a fixed threshold C at any time. Dijkstra s algorithm complies with these constraints: (1) The keys are integers because they are distance labels and therefore minutes. (2) If the threshold C is set to the maximum edge length in the graph, the second constraint is also kept: Obviously it s sufficient to show that after every insertion of a node in the priority queue the constraint is not violated by that newly inserted node. That means that the difference between that new key and the minimum of all existing keys must not exceed the threshold C. Insertions in the queue are made only by Step 9 of the algorithm. Assume that a node u is going to be inserted. Before the insertion step, in Step 4 a node v has been removed from the queue. After that removal the minimum key in the queue is greater or equal than the distance label of v. Note that u and v are adjacent and that the distance label of u is the distance label of v plus the length of the edge from v to u. If then the node u is inserted, it does not violate the second constraint because key(u) minimum(q) key(u) key(v) = length(u, v) C Implementation In Dial s queue the elements are stored in C+1 buckets b,..., b C. An element with key k is stored in the bucket with index (k modulo C + 1). From constraint (2) it follows that this bucket only contains elements with key k. Additionally, we have a pointer m holding the index of the bucket that contains the element with the currently minimum key, and a counter that holds the current size of the queue. b1 17 b2 1 1 m b3 11 b b4 b7 b6 Each bucket can be realized as a doubly linked list. The operations of the priority queue are very simple: The queue is empty if the size-counter is zero An element with key k is inserted by appending it to the bucket with index (k modulo C + 1). If the key is smaller than the key of an element in b m, m is assigned the value (k modulo C + 1). The size-counter has to be increased. b5

28 3.3 Goal-Directed Search 24 An element is relocated by first removing it from its bucket and then re-inserting it in the queue. The element with minimum key is one of the elements of the bucket b m. The element with minimum key is extracted by removing an element from the bucket b m. If b m is empty, m has to be increased modulo C + 1 until a bucket is reached that contains elements. The size-counter has to be decreased. The first four operations take constant time, only the operation extract may take time O(C). Thus, the run time for Dijkstra s algorithm using Dial s queue becomes O(m+nC), if n denotes the number of nodes and m the number of edges. In the special case of m O(n) the run time becomes even O(nC). 3.3 Goal-Directed Search In the last chapter the general outline of this speed-up technique is described (see page 16). The classical applications are graphs which are embedded in an Euclidean space and the edge lengths are the Euclidean distances. The traingraph is embedded in the twodimensional Euclidean space, but the edge lengths that we use (i.e., the traveltime between two events) is not the Euclidean distance. We can now use the Euclidean distance between two nodes u 1 and u 2 in the traingraph, denoted by d e (u 1, u 2 ), to define a valid lower bound for the goal-directed variant of Dijkstra s algorithm, but only if the edge lengths comply with the following condition: For each edge e = (u 1, u 2 ) in the traingraph: length(e) = d e (u 1, u 2 ) = With our edge lengths a violation of the condition would mean that the distance between two stations with different geometric locations can be covered without a loss of time. That would imply an infinite speed, so the condition seems to be fulfilled for all edges. The problem is that the smallest time unit is one minute, so it may be necessary to give a connection between very near stations, which takes less than half a minute, a traveltime of zero. However, in the input data that we used for computation all edges fulfill the condition above, so we can go ahead with the definition of the lower bound: For every node in the traingraph such a lower bound on the length of a path to the destination is needed. That bound has to fulfill a consistency condition (see 2.5.1). For the definition of the lower bound we need to know the maximum (average) speed over all edges: { de (u 1, u 2 ) v max = max length(e) e = (u 1, u 2 ) edge of the traingraph with length(e) }

Dijkstra s Algorithm On Line: An Empirical Case Study from Public Railroad Transport

Dijkstra s Algorithm On Line: An Empirical Case Study from Public Railroad Transport Dijkstra s Algorithm On Line: An Empirical Case Study from Public Railroad Transport Frank Schulz, Dorothea Wagner, and Karsten Weihe Universität Konstanz, Fakultät für Mathematik und Informatik Fach D188,

More information

Using Multi-Level Graphs for Timetable Information. Frank Schulz, Dorothea Wagner, and Christos Zaroliagis

Using Multi-Level Graphs for Timetable Information. Frank Schulz, Dorothea Wagner, and Christos Zaroliagis Using Multi-Level Graphs for Timetable Information Frank Schulz, Dorothea Wagner, and Christos Zaroliagis Overview 1 1. Introduction Timetable Information - A Shortest Path Problem 2. Multi-Level Graphs

More information

Lecture 5 Using Data Structures to Improve Dijkstra s Algorithm. (AM&O Sections and Appendix A)

Lecture 5 Using Data Structures to Improve Dijkstra s Algorithm. (AM&O Sections and Appendix A) Lecture Using Data Structures to Improve Dijkstra s Algorithm (AM&O Sections 4.6 4.8 and Appendix A) Manipulating the Data in Dijkstra s Algorithm The bottleneck operation in Dijkstra s Algorithm is that

More information

Adaptations of the A* Algorithm for the Computation of Fastest Paths in Deterministic Discrete-Time Dynamic Networks

Adaptations of the A* Algorithm for the Computation of Fastest Paths in Deterministic Discrete-Time Dynamic Networks 60 IEEE TRANSACTIONS ON INTELLIGENT TRANSPORTATION SYSTEMS, VOL. 3, NO. 1, MARCH 2002 Adaptations of the A* Algorithm for the Computation of Fastest Paths in Deterministic Discrete-Time Dynamic Networks

More information

The Encoding Complexity of Network Coding

The Encoding Complexity of Network Coding The Encoding Complexity of Network Coding Michael Langberg Alexander Sprintson Jehoshua Bruck California Institute of Technology Email: mikel,spalex,bruck @caltech.edu Abstract In the multicast network

More information

Algorithm Design (8) Graph Algorithms 1/2

Algorithm Design (8) Graph Algorithms 1/2 Graph Algorithm Design (8) Graph Algorithms / Graph:, : A finite set of vertices (or nodes) : A finite set of edges (or arcs or branches) each of which connect two vertices Takashi Chikayama School of

More information

arxiv: v3 [cs.ds] 18 Apr 2011

arxiv: v3 [cs.ds] 18 Apr 2011 A tight bound on the worst-case number of comparisons for Floyd s heap construction algorithm Ioannis K. Paparrizos School of Computer and Communication Sciences Ècole Polytechnique Fèdèrale de Lausanne

More information

3 No-Wait Job Shops with Variable Processing Times

3 No-Wait Job Shops with Variable Processing Times 3 No-Wait Job Shops with Variable Processing Times In this chapter we assume that, on top of the classical no-wait job shop setting, we are given a set of processing times for each operation. We may select

More information

Lecture 8: The Traveling Salesman Problem

Lecture 8: The Traveling Salesman Problem Lecture 8: The Traveling Salesman Problem Let G = (V, E) be an undirected graph. A Hamiltonian cycle of G is a cycle that visits every vertex v V exactly once. Instead of Hamiltonian cycle, we sometimes

More information

Linear programming II João Carlos Lourenço

Linear programming II João Carlos Lourenço Decision Support Models Linear programming II João Carlos Lourenço joao.lourenco@ist.utl.pt Academic year 2012/2013 Readings: Hillier, F.S., Lieberman, G.J., 2010. Introduction to Operations Research,

More information

Data Structures and Algorithms

Data Structures and Algorithms Berner Fachhochschule - Technik und Informatik Data Structures and Algorithms Topic 1: Algorithm Analysis Philipp Locher FS 2018 Outline Course and Textbook Overview Analysis of Algorithm Pseudo-Code and

More information

Efficient Algorithms for Solving Shortest Paths on Nearly Acyclic Directed Graphs

Efficient Algorithms for Solving Shortest Paths on Nearly Acyclic Directed Graphs Efficient Algorithms for Solving Shortest Paths on Nearly Acyclic Directed Graphs Shane Saunders Tadao Takaoka Department of Computer Science and Software Engineering, University of Canterbury, Christchurch,

More information

Theorem 2.9: nearest addition algorithm

Theorem 2.9: nearest addition algorithm There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used

More information

Column Generation Method for an Agent Scheduling Problem

Column Generation Method for an Agent Scheduling Problem Column Generation Method for an Agent Scheduling Problem Balázs Dezső Alpár Jüttner Péter Kovács Dept. of Algorithms and Their Applications, and Dept. of Operations Research Eötvös Loránd University, Budapest,

More information

Final Exam Solutions

Final Exam Solutions Introduction to Algorithms December 14, 2010 Massachusetts Institute of Technology 6.006 Fall 2010 Professors Konstantinos Daskalakis and Patrick Jaillet Final Exam Solutions Final Exam Solutions Problem

More information

Fundamental Graph Algorithms Part Four

Fundamental Graph Algorithms Part Four Fundamental Graph Algorithms Part Four Announcements Problem Set One due right now. Due Friday at 2:15PM using one late period. Problem Set Two out, due next Friday, July 12 at 2:15PM. Play around with

More information

III Data Structures. Dynamic sets

III Data Structures. Dynamic sets III Data Structures Elementary Data Structures Hash Tables Binary Search Trees Red-Black Trees Dynamic sets Sets are fundamental to computer science Algorithms may require several different types of operations

More information

Engineering Time-Expanded Graphs for Faster Timetable Information

Engineering Time-Expanded Graphs for Faster Timetable Information Engineering Time-Expanded Graphs for Faster Timetable Information Daniel Delling, Thomas Pajor, and Dorothea Wagner Department of Computer Science, University of Karlsruhe, P.O. Box 6980, 76128 Karlsruhe,

More information

Shortest Path Problem

Shortest Path Problem Shortest Path Problem CLRS Chapters 24.1 3, 24.5, 25.2 Shortest path problem Shortest path problem (and variants) Properties of shortest paths Algorithmic framework Bellman-Ford algorithm Shortest paths

More information

Review implementation of Stable Matching Survey of common running times. Turn in completed problem sets. Jan 18, 2019 Sprenkle - CSCI211

Review implementation of Stable Matching Survey of common running times. Turn in completed problem sets. Jan 18, 2019 Sprenkle - CSCI211 Objectives Review implementation of Stable Matching Survey of common running times Turn in completed problem sets Jan 18, 2019 Sprenkle - CSCI211 1 Review: Asymptotic Analysis of Gale-Shapley Alg Not explicitly

More information

Solution for Homework set 3

Solution for Homework set 3 TTIC 300 and CMSC 37000 Algorithms Winter 07 Solution for Homework set 3 Question (0 points) We are given a directed graph G = (V, E), with two special vertices s and t, and non-negative integral capacities

More information

22 Elementary Graph Algorithms. There are two standard ways to represent a

22 Elementary Graph Algorithms. There are two standard ways to represent a VI Graph Algorithms Elementary Graph Algorithms Minimum Spanning Trees Single-Source Shortest Paths All-Pairs Shortest Paths 22 Elementary Graph Algorithms There are two standard ways to represent a graph

More information

Construction of Minimum-Weight Spanners Mikkel Sigurd Martin Zachariasen

Construction of Minimum-Weight Spanners Mikkel Sigurd Martin Zachariasen Construction of Minimum-Weight Spanners Mikkel Sigurd Martin Zachariasen University of Copenhagen Outline Motivation and Background Minimum-Weight Spanner Problem Greedy Spanner Algorithm Exact Algorithm:

More information

CSE 421 Greedy Alg: Union Find/Dijkstra s Alg

CSE 421 Greedy Alg: Union Find/Dijkstra s Alg CSE 1 Greedy Alg: Union Find/Dijkstra s Alg Shayan Oveis Gharan 1 Dijkstra s Algorithm Dijkstra(G, c, s) { d s 0 foreach (v V) d[v] //This is the key of node v foreach (v V) insert v onto a priority queue

More information

Bidirectional search and Goal-directed Dijkstra

Bidirectional search and Goal-directed Dijkstra Computing the shortest path Bidirectional search and Goal-directed Dijkstra Alexander Kozyntsev October 18, 2010 Abstract We study the problem of finding a shortest path between two vertices in a directed

More information

Heap-on-Top Priority Queues. March Abstract. We introduce the heap-on-top (hot) priority queue data structure that combines the

Heap-on-Top Priority Queues. March Abstract. We introduce the heap-on-top (hot) priority queue data structure that combines the Heap-on-Top Priority Queues Boris V. Cherkassky Central Economics and Mathematics Institute Krasikova St. 32 117418, Moscow, Russia cher@cemi.msk.su Andrew V. Goldberg NEC Research Institute 4 Independence

More information

Computing intersections in a set of line segments: the Bentley-Ottmann algorithm

Computing intersections in a set of line segments: the Bentley-Ottmann algorithm Computing intersections in a set of line segments: the Bentley-Ottmann algorithm Michiel Smid October 14, 2003 1 Introduction In these notes, we introduce a powerful technique for solving geometric problems.

More information

Module 11. Directed Graphs. Contents

Module 11. Directed Graphs. Contents Module 11 Directed Graphs Contents 11.1 Basic concepts......................... 256 Underlying graph of a digraph................ 257 Out-degrees and in-degrees.................. 258 Isomorphism..........................

More information

Two hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. Date: Thursday 1st June 2017 Time: 14:00-16:00

Two hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. Date: Thursday 1st June 2017 Time: 14:00-16:00 COMP 26120 Two hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE Algorithms and Imperative Programming Date: Thursday 1st June 2017 Time: 14:00-16:00 Please answer THREE Questions from the FOUR

More information

demand point given tracks

demand point given tracks 2 Introduction Establishing stops (or stations) within a transportation network is fundamental for offering public transportation service, since stops are an important part of the PTN. But it is not clear

More information

CS521 \ Notes for the Final Exam

CS521 \ Notes for the Final Exam CS521 \ Notes for final exam 1 Ariel Stolerman Asymptotic Notations: CS521 \ Notes for the Final Exam Notation Definition Limit Big-O ( ) Small-o ( ) Big- ( ) Small- ( ) Big- ( ) Notes: ( ) ( ) ( ) ( )

More information

Improved Shortest Path Algorithms for Nearly Acyclic Graphs

Improved Shortest Path Algorithms for Nearly Acyclic Graphs Improved Shortest Path Algorithms for Nearly Acyclic Graphs A thesis submitted in partial fulfilment of the requirements for the Degree of Doctor of Philosophy in Computer Science in the University of

More information

DDS Dynamic Search Trees

DDS Dynamic Search Trees DDS Dynamic Search Trees 1 Data structures l A data structure models some abstract object. It implements a number of operations on this object, which usually can be classified into l creation and deletion

More information

V Advanced Data Structures

V Advanced Data Structures V Advanced Data Structures B-Trees Fibonacci Heaps 18 B-Trees B-trees are similar to RBTs, but they are better at minimizing disk I/O operations Many database systems use B-trees, or variants of them,

More information

Temporally Adaptive A* Algorithm on Time Dependent Transportation Network

Temporally Adaptive A* Algorithm on Time Dependent Transportation Network Temporally Adaptive A* Algorithm on Time Dependent Transportation Network Nianbo Zheng, Feng Lu Institute of Geographic Sciences and Natural Resources Research Chinese Academy of Sciences Beijing, 100101,

More information

General properties of staircase and convex dual feasible functions

General properties of staircase and convex dual feasible functions General properties of staircase and convex dual feasible functions JÜRGEN RIETZ, CLÁUDIO ALVES, J. M. VALÉRIO de CARVALHO Centro de Investigação Algoritmi da Universidade do Minho, Escola de Engenharia

More information

Chapter 15 Introduction to Linear Programming

Chapter 15 Introduction to Linear Programming Chapter 15 Introduction to Linear Programming An Introduction to Optimization Spring, 2015 Wei-Ta Chu 1 Brief History of Linear Programming The goal of linear programming is to determine the values of

More information

Institutionen för datavetenskap Department of Computer and Information Science

Institutionen för datavetenskap Department of Computer and Information Science Institutionen för datavetenskap Department of Computer and Information Science Final thesis K Shortest Path Implementation by RadhaKrishna Nagubadi LIU-IDA/LITH-EX-A--13/41--SE 213-6-27 Linköpings universitet

More information

II (Sorting and) Order Statistics

II (Sorting and) Order Statistics II (Sorting and) Order Statistics Heapsort Quicksort Sorting in Linear Time Medians and Order Statistics 8 Sorting in Linear Time The sorting algorithms introduced thus far are comparison sorts Any comparison

More information

Collaboration with: Dieter Pfoser, Computer Technology Institute, Athens, Greece Peter Wagner, German Aerospace Center, Berlin, Germany

Collaboration with: Dieter Pfoser, Computer Technology Institute, Athens, Greece Peter Wagner, German Aerospace Center, Berlin, Germany Towards traffic-aware aware a routing using GPS vehicle trajectories Carola Wenk University of Texas at San Antonio carola@cs.utsa.edu Collaboration with: Dieter Pfoser, Computer Technology Institute,

More information

Foundations of Computing

Foundations of Computing Foundations of Computing Darmstadt University of Technology Dept. Computer Science Winter Term 2005 / 2006 Copyright c 2004 by Matthias Müller-Hannemann and Karsten Weihe All rights reserved http://www.algo.informatik.tu-darmstadt.de/

More information

1 Dijkstra s Algorithm

1 Dijkstra s Algorithm Lecture 11 Dijkstra s Algorithm Scribes: Himanshu Bhandoh (2015), Virginia Williams, and Date: November 1, 2017 Anthony Kim (2016), G. Valiant (2017), M. Wootters (2017) (Adapted from Virginia Williams

More information

Some Extra Information on Graph Search

Some Extra Information on Graph Search Some Extra Information on Graph Search David Kempe December 5, 203 We have given basic definitions of graphs earlier in class, and talked about how to implement them. We had also already mentioned paths,

More information

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize.

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize. Cornell University, Fall 2017 CS 6820: Algorithms Lecture notes on the simplex method September 2017 1 The Simplex Method We will present an algorithm to solve linear programs of the form maximize subject

More information

Algorithms for Data Science

Algorithms for Data Science Algorithms for Data Science CSOR W4246 Eleni Drinea Computer Science Department Columbia University Thursday, October 1, 2015 Outline 1 Recap 2 Shortest paths in graphs with non-negative edge weights (Dijkstra

More information

V Advanced Data Structures

V Advanced Data Structures V Advanced Data Structures B-Trees Fibonacci Heaps 18 B-Trees B-trees are similar to RBTs, but they are better at minimizing disk I/O operations Many database systems use B-trees, or variants of them,

More information

Network optimization: An overview

Network optimization: An overview Network optimization: An overview Mathias Johanson Alkit Communications 1 Introduction Various kinds of network optimization problems appear in many fields of work, including telecommunication systems,

More information

Shortest Paths: Basics. Algorithms and Networks 2016/2017 Johan M. M. van Rooij Hans L. Bodlaender

Shortest Paths: Basics. Algorithms and Networks 2016/2017 Johan M. M. van Rooij Hans L. Bodlaender Shortest Paths: Basics Algorithms and Networks 2016/2017 Johan M. M. van Rooij Hans L. Bodlaender 1 Shortest path problem(s) Undirected single-pair shortest path problem Given a graph G=(V,E) and a length

More information

Approximation Method to Route Generation in Public Transportation Network

Approximation Method to Route Generation in Public Transportation Network dr Jolanta Koszelew Katedra Informatyki Teoretycznej Wydział Informatyki Politechnika Białostocka Approximation Method to Route Generation in Public Transportation Network Abstract This paper presents

More information

Conflict-free Real-time AGV Routing

Conflict-free Real-time AGV Routing Conflict-free Real-time AGV Routing Rolf H. Möhring, Ekkehard Köhler, Ewgenij Gawrilow, and Björn Stenzel Technische Universität Berlin, Institut für Mathematik, MA 6-1, Straße des 17. Juni 136, 1623 Berlin,

More information

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Mathematical and Algorithmic Foundations Linear Programming and Matchings Adavnced Algorithms Lectures Mathematical and Algorithmic Foundations Linear Programming and Matchings Paul G. Spirakis Department of Computer Science University of Patras and Liverpool Paul G. Spirakis

More information

Job-shop scheduling with limited capacity buffers

Job-shop scheduling with limited capacity buffers Job-shop scheduling with limited capacity buffers Peter Brucker, Silvia Heitmann University of Osnabrück, Department of Mathematics/Informatics Albrechtstr. 28, D-49069 Osnabrück, Germany {peter,sheitman}@mathematik.uni-osnabrueck.de

More information

Algorithms and Data Structures

Algorithms and Data Structures Algorithm Analysis Page 1 - Algorithm Analysis Dr. Fall 2008 Algorithm Analysis Page 2 Outline Textbook Overview Analysis of Algorithm Pseudo-Code and Primitive Operations Growth Rate and Big-Oh Notation

More information

Selection, Bubble, Insertion, Merge, Heap, Quick Bucket, Radix

Selection, Bubble, Insertion, Merge, Heap, Quick Bucket, Radix Spring 2010 Review Topics Big O Notation Heaps Sorting Selection, Bubble, Insertion, Merge, Heap, Quick Bucket, Radix Hashtables Tree Balancing: AVL trees and DSW algorithm Graphs: Basic terminology and

More information

Discrete Optimization. Lecture Notes 2

Discrete Optimization. Lecture Notes 2 Discrete Optimization. Lecture Notes 2 Disjunctive Constraints Defining variables and formulating linear constraints can be straightforward or more sophisticated, depending on the problem structure. The

More information

V1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0).

V1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0). CS4234: Optimisation Algorithms Lecture 4 TRAVELLING-SALESMAN-PROBLEM (4 variants) V1.0: Seth Gilbert, V1.1: Steven Halim August 30, 2016 Abstract The goal of the TRAVELLING-SALESMAN-PROBLEM is to find

More information

Branch-and-Bound Algorithms for Constrained Paths and Path Pairs and Their Application to Transparent WDM Networks

Branch-and-Bound Algorithms for Constrained Paths and Path Pairs and Their Application to Transparent WDM Networks Branch-and-Bound Algorithms for Constrained Paths and Path Pairs and Their Application to Transparent WDM Networks Franz Rambach Student of the TUM Telephone: 0049 89 12308564 Email: rambach@in.tum.de

More information

Java II Graph Algorithms II

Java II Graph Algorithms II Java II Graph Algorithms II Bernd Kiefer Bernd.Kiefer@dfki.de Deutsches Forschungszentrum für künstliche Intelligenz Heuristic Search Pictures from http://www-cs-students.stanford.edu/~amitp/gameprog.html

More information

CSE 21 Summer 2017 Homework 4

CSE 21 Summer 2017 Homework 4 CSE 21 Summer 201 Homework Key Concepts Minimum Spanning Trees, Directed Acyclic Graphs, Topological Sorting, Single source shortest paths, Counting, Basic probability principles, Independence, Linearity

More information

CS261: Problem Set #1

CS261: Problem Set #1 CS261: Problem Set #1 Due by 11:59 PM on Tuesday, April 21, 2015 Instructions: (1) Form a group of 1-3 students. You should turn in only one write-up for your entire group. (2) Turn in your solutions by

More information

Algorithms for COOPERATIVE DS: Leader Election in the MPS model

Algorithms for COOPERATIVE DS: Leader Election in the MPS model Algorithms for COOPERATIVE DS: Leader Election in the MPS model 1 Leader Election (LE) problem In a DS, it is often needed to designate a single processor (i.e., a leader) as the coordinator of some forthcoming

More information

Midterm 1 Solutions. (i) False. One possible counterexample is the following: n n 3

Midterm 1 Solutions. (i) False. One possible counterexample is the following: n n 3 CS 170 Efficient Algorithms & Intractable Problems, Spring 2006 Midterm 1 Solutions Note: These solutions are not necessarily model answers. Rather, they are designed to be tutorial in nature, and sometimes

More information

CS 161 Lecture 11 BFS, Dijkstra s algorithm Jessica Su (some parts copied from CLRS) 1 Review

CS 161 Lecture 11 BFS, Dijkstra s algorithm Jessica Su (some parts copied from CLRS) 1 Review 1 Review 1 Something I did not emphasize enough last time is that during the execution of depth-firstsearch, we construct depth-first-search trees. One graph may have multiple depth-firstsearch trees,

More information

Introduction to Internet Routing

Introduction to Internet Routing Introduction to Internet Routing (RCSE) Lecture Based on Slides by Prof. Dr. Günter Schäfer Page Topics of Special course on planning aspects in communication networks Prior attendance of courses Telematics

More information

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang 600.469 / 600.669 Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang 9.1 Linear Programming Suppose we are trying to approximate a minimization

More information

1 The Shortest Path Problem

1 The Shortest Path Problem CS161 Lecture 11 Single Source Shortest Paths Scribed by: Romil Verma (2015), Virginia Date: May 8, 2016 1 The Shortest Path Problem In this lecture, we ll discuss the shortest path problem. Assume we

More information

Sorting and Searching

Sorting and Searching Sorting and Searching Lecture 2: Priority Queues, Heaps, and Heapsort Lecture 2: Priority Queues, Heaps, and Heapsort Sorting and Searching 1 / 24 Priority Queue: Motivating Example 3 jobs have been submitted

More information

Reach for A : an Efficient Point-to-Point Shortest Path Algorithm

Reach for A : an Efficient Point-to-Point Shortest Path Algorithm Reach for A : an Efficient Point-to-Point Shortest Path Algorithm Andrew V. Goldberg Microsoft Research Silicon Valley www.research.microsoft.com/ goldberg/ Joint with Haim Kaplan and Renato Werneck Einstein

More information

Objective of the present work

Objective of the present work Objective of the present work Optimize Road Network Optimize Airline Network Optimize Rail Network Optimize Computer Network Optimize Social Network Spanners and Emulators For most graph algorithms, the

More information

CS420/520 Algorithm Analysis Spring 2009 Lecture 14

CS420/520 Algorithm Analysis Spring 2009 Lecture 14 CS420/520 Algorithm Analysis Spring 2009 Lecture 14 "A Computational Analysis of Alternative Algorithms for Labeling Techniques for Finding Shortest Path Trees", Dial, Glover, Karney, and Klingman, Networks

More information

Detecting negative cycles with Tarjan s breadth-first scanning algorithm

Detecting negative cycles with Tarjan s breadth-first scanning algorithm Detecting negative cycles with Tarjan s breadth-first scanning algorithm Tibor Ásványi asvanyi@inf.elte.hu ELTE Eötvös Loránd University Faculty of Informatics Budapest, Hungary Abstract The Bellman-Ford

More information

Accurate High-Performance Route Planning

Accurate High-Performance Route Planning Sanders/Schultes: Route Planning 1 Accurate High-Performance Route Planning Peter Sanders Dominik Schultes Institut für Theoretische Informatik Algorithmik II Universität Karlsruhe (TH) http://algo2.iti.uka.de/schultes/hwy/

More information

Name: Lirong TAN 1. (15 pts) (a) Define what is a shortest s-t path in a weighted, connected graph G.

Name: Lirong TAN 1. (15 pts) (a) Define what is a shortest s-t path in a weighted, connected graph G. 1. (15 pts) (a) Define what is a shortest s-t path in a weighted, connected graph G. A shortest s-t path is a path from vertex to vertex, whose sum of edge weights is minimized. (b) Give the pseudocode

More information

Worst-case running time for RANDOMIZED-SELECT

Worst-case running time for RANDOMIZED-SELECT Worst-case running time for RANDOMIZED-SELECT is ), even to nd the minimum The algorithm has a linear expected running time, though, and because it is randomized, no particular input elicits the worst-case

More information

We have used both of the last two claims in previous algorithms and therefore their proof is omitted.

We have used both of the last two claims in previous algorithms and therefore their proof is omitted. Homework 3 Question 1 The algorithm will be based on the following logic: If an edge ( ) is deleted from the spanning tree, let and be the trees that were created, rooted at and respectively Adding any

More information

Algorithm Design, Anal. & Imp., Homework 4 Solution

Algorithm Design, Anal. & Imp., Homework 4 Solution Algorithm Design, Anal. & Imp., Homework 4 Solution Note: The solution is for your personal use for this course. You are not allowed to post the solution in public place. There could be mistakes in the

More information

Let the dynamic table support the operations TABLE-INSERT and TABLE-DELETE It is convenient to use the load factor ( )

Let the dynamic table support the operations TABLE-INSERT and TABLE-DELETE It is convenient to use the load factor ( ) 17.4 Dynamic tables Let us now study the problem of dynamically expanding and contracting a table We show that the amortized cost of insertion/ deletion is only (1) Though the actual cost of an operation

More information

Sorting and Searching

Sorting and Searching Sorting and Searching Lecture 2: Priority Queues, Heaps, and Heapsort Lecture 2: Priority Queues, Heaps, and Heapsort Sorting and Searching 1 / 24 Priority Queue: Motivating Example 3 jobs have been submitted

More information

(Refer Slide Time: 00:18)

(Refer Slide Time: 00:18) Programming, Data Structures and Algorithms Prof. N. S. Narayanaswamy Department of Computer Science and Engineering Indian Institute of Technology, Madras Module 11 Lecture 58 Problem: single source shortest

More information

External Memory Algorithms and Data Structures Fall Project 3 A GIS system

External Memory Algorithms and Data Structures Fall Project 3 A GIS system External Memory Algorithms and Data Structures Fall 2003 1 Project 3 A GIS system GSB/RF November 17, 2003 1 Introduction The goal of this project is to implement a rudimentary Geographical Information

More information

Analyze the obvious algorithm, 5 points Here is the most obvious algorithm for this problem: (LastLargerElement[A[1..n]:

Analyze the obvious algorithm, 5 points Here is the most obvious algorithm for this problem: (LastLargerElement[A[1..n]: CSE 101 Homework 1 Background (Order and Recurrence Relations), correctness proofs, time analysis, and speeding up algorithms with restructuring, preprocessing and data structures. Due Thursday, April

More information

Notes for Lecture 24

Notes for Lecture 24 U.C. Berkeley CS170: Intro to CS Theory Handout N24 Professor Luca Trevisan December 4, 2001 Notes for Lecture 24 1 Some NP-complete Numerical Problems 1.1 Subset Sum The Subset Sum problem is defined

More information

Combining Speed-up Techniques for Shortest-Path Computations

Combining Speed-up Techniques for Shortest-Path Computations Combining Speed-up Techniques for Shortest-Path Computations Martin Holzer, Frank Schulz, and Thomas Willhalm Universität Karlsruhe Fakultät für Informatik Postfach 6980 76128 Karlsruhe Germany {mholzer,fschulz,willhalm}@ira.uka.de

More information

On the Max Coloring Problem

On the Max Coloring Problem On the Max Coloring Problem Leah Epstein Asaf Levin May 22, 2010 Abstract We consider max coloring on hereditary graph classes. The problem is defined as follows. Given a graph G = (V, E) and positive

More information

An O(n 2.75 ) algorithm for online topological ordering 1

An O(n 2.75 ) algorithm for online topological ordering 1 Electronic Notes in Discrete Mathematics 25 (2006) 7 12 www.elsevier.com/locate/endm An O(n 2.75 ) algorithm for online topological ordering 1 Deepak Ajwani a,2, Tobias Friedrich a and Ulrich Meyer a a

More information

CSE 431/531: Analysis of Algorithms. Greedy Algorithms. Lecturer: Shi Li. Department of Computer Science and Engineering University at Buffalo

CSE 431/531: Analysis of Algorithms. Greedy Algorithms. Lecturer: Shi Li. Department of Computer Science and Engineering University at Buffalo CSE 431/531: Analysis of Algorithms Greedy Algorithms Lecturer: Shi Li Department of Computer Science and Engineering University at Buffalo Main Goal of Algorithm Design Design fast algorithms to solve

More information

Algorithms: Lecture 10. Chalmers University of Technology

Algorithms: Lecture 10. Chalmers University of Technology Algorithms: Lecture 10 Chalmers University of Technology Today s Topics Basic Definitions Path, Cycle, Tree, Connectivity, etc. Graph Traversal Depth First Search Breadth First Search Testing Bipartatiness

More information

CSci 231 Final Review

CSci 231 Final Review CSci 231 Final Review Here is a list of topics for the final. Generally you are responsible for anything discussed in class (except topics that appear italicized), and anything appearing on the homeworks.

More information

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Priority Queues / Heaps Date: 9/27/17

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Priority Queues / Heaps Date: 9/27/17 01.433/33 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Priority Queues / Heaps Date: 9/2/1.1 Introduction In this lecture we ll talk about a useful abstraction, priority queues, which are

More information

Lecture 3: Linear Classification

Lecture 3: Linear Classification Lecture 3: Linear Classification Roger Grosse 1 Introduction Last week, we saw an example of a learning task called regression. There, the goal was to predict a scalar-valued target from a set of features.

More information

1 Bipartite maximum matching

1 Bipartite maximum matching Cornell University, Fall 2017 Lecture notes: Matchings CS 6820: Algorithms 23 Aug 1 Sep These notes analyze algorithms for optimization problems involving matchings in bipartite graphs. Matching algorithms

More information

Lecture #7. 1 Introduction. 2 Dijkstra s Correctness. COMPSCI 330: Design and Analysis of Algorithms 9/16/2014

Lecture #7. 1 Introduction. 2 Dijkstra s Correctness. COMPSCI 330: Design and Analysis of Algorithms 9/16/2014 COMPSCI 330: Design and Analysis of Algorithms 9/16/2014 Lecturer: Debmalya Panigrahi Lecture #7 Scribe: Nat Kell 1 Introduction In this lecture, we will further examine shortest path algorithms. We will

More information

2386 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 52, NO. 6, JUNE 2006

2386 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 52, NO. 6, JUNE 2006 2386 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 52, NO. 6, JUNE 2006 The Encoding Complexity of Network Coding Michael Langberg, Member, IEEE, Alexander Sprintson, Member, IEEE, and Jehoshua Bruck,

More information

Accurate High-Performance Route Planning

Accurate High-Performance Route Planning Sanders/Schultes: Route Planning 1 Accurate High-Performance Route Planning Peter Sanders Dominik Schultes Institut für Theoretische Informatik Algorithmik II Universität Karlsruhe (TH) Eindhoven, March

More information

Chapter 10. Fundamental Network Algorithms. M. E. J. Newman. May 6, M. E. J. Newman Chapter 10 May 6, / 33

Chapter 10. Fundamental Network Algorithms. M. E. J. Newman. May 6, M. E. J. Newman Chapter 10 May 6, / 33 Chapter 10 Fundamental Network Algorithms M. E. J. Newman May 6, 2015 M. E. J. Newman Chapter 10 May 6, 2015 1 / 33 Table of Contents 1 Algorithms for Degrees and Degree Distributions Degree-Degree Correlation

More information

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality Planar Graphs In the first half of this book, we consider mostly planar graphs and their geometric representations, mostly in the plane. We start with a survey of basic results on planar graphs. This chapter

More information

Solutions for the Exam 6 January 2014

Solutions for the Exam 6 January 2014 Mastermath and LNMB Course: Discrete Optimization Solutions for the Exam 6 January 2014 Utrecht University, Educatorium, 13:30 16:30 The examination lasts 3 hours. Grading will be done before January 20,

More information

CSE 431/531: Algorithm Analysis and Design (Spring 2018) Greedy Algorithms. Lecturer: Shi Li

CSE 431/531: Algorithm Analysis and Design (Spring 2018) Greedy Algorithms. Lecturer: Shi Li CSE 431/531: Algorithm Analysis and Design (Spring 2018) Greedy Algorithms Lecturer: Shi Li Department of Computer Science and Engineering University at Buffalo Main Goal of Algorithm Design Design fast

More information

W4231: Analysis of Algorithms

W4231: Analysis of Algorithms W4231: Analysis of Algorithms 10/21/1999 Definitions for graphs Breadth First Search and Depth First Search Topological Sort. Graphs AgraphG is given by a set of vertices V and a set of edges E. Normally

More information

Module 2: Classical Algorithm Design Techniques

Module 2: Classical Algorithm Design Techniques Module 2: Classical Algorithm Design Techniques Dr. Natarajan Meghanathan Associate Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu Module

More information