A Dynamic Programming Operator for Metaheuristics to Solve Vehicle Routing Problems with Optional Visits Leticia Gloria Vargas Suarez

Total Page:16

File Type:pdf, Size:1020Kb

A Dynamic Programming Operator for Metaheuristics to Solve Vehicle Routing Problems with Optional Visits Leticia Gloria Vargas Suarez A dynamic programming operator for metaheuristics to solve vehicle routing problems with optional visits Leticia Gloria Vargas Suarez To cite this version: Leticia Gloria Vargas Suarez. A dynamic programming operator for metaheuristics to solve vehi- cle routing problems with optional visits. Automatic. INSA de Toulouse, 2016. English. NNT : 2016ISAT0027. tel-01355746v2 HAL Id: tel-01355746 https://tel.archives-ouvertes.fr/tel-01355746v2 Submitted on 19 Jun 2017 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. THTHESEESE`` En vue de l’obtention du DOCTORAT DE L’UNIVERSITEF´ ED´ ERALE´ TOULOUSE MIDI-PYREN´ EES´ D´elivr´e par : l’Institut National des Sciences Appliqu´eesde Toulouse (INSA de Toulouse) Pr´esent´ee et soutenue le 24/06/2016 par : Leticia VARGAS A dynamic programming operator for metaheuristics to solve vehicle routing problems with optional visits JURY Dominique FEILLET Professeur Ecole´ des Mines St-Etienne´ Laetitia JOURDAN Professeur des Universit´es Universit´eLille 1 Nicolas JOZEFOWIEZ Maˆıtrede Conf´erences INSA Toulouse Sandra U. NGUEVEU Maˆıtrede Conf´erences INP Toulouse Caroline PRODHON Maˆıtrede Conf´erences Universit´ede Troyes Christos TARANTILIS Professeur Athens University Ecole´ doctorale et sp´ecialit´e : EDSYS : Informatique 4200018 Unit´e de Recherche : LAAS-CNRS Toulouse Directeur(s) de Th`ese : Nicolas JOZEFOWIEZ et Sandra Ulrich NGUEVEU Rapporteurs : Laetitia JOURDAN et Christos TARANTILIS iii Acknowledgments First and foremost, I thank my thesis advisor M. Nicolas Jozefowiez, Maˆıtrede Conf´erencesINSA-Toulouse, for his relentless support, advice and guidance along these three years. A great thank you also goes to my second thesis supervisor Mlle. Sandra Ulrich Ngueveu, Maˆıtrede Conf´erencesINP-Toulouse, for her continuous encourage- ment. It was a great experience working with both of you. Let me express my sincere gratitude to my jury: Professeur D. Feillet, Professeur de Universit´esL. Jourdan, Maˆıtrede Conf´erencesC. Prodhon, and Professor C. Tarantilis. Their comments, remarks and thought-provoking questions help to improve my work and writings. I am very grateful to our team leader M. Christian Artigues, Directeur de Recherche at LAAS-CNRS, who was always very helpful and supportive aside from being a very charismatic personality always seeking the cohesion of the team and the success of each of its members. I also thank him for always making me feel welcome in a foreign country. I am specially grateful to Mme. Christ`eleMouclier, Assistant ROC team, who helped me out so many times in diverse matters with a very kind and warm demeanour. I would also like to thank all the permanent members of the ROC team as well as all my colleagues for their help in diverse situations, for their patience with my limited French skills, and for making the average work day more fun and interesting. I am specially grateful to Erasmus Mundus Project LAMENITEC which financially supported my studies, fellowship 372362-1-2012-1-ES, and made this endeavor possible. I thank the French government as well for their support. This work was partially supported by the French National Research Agency through the ATHENA project under the grant ANR-13-BS02-0006. I also gratefully acknowledge the economic support received from the Mexican National Council of Science and Technology (CONACyT) as well as from the Instituto de Innovaci´ony Transferencia de Tecnolog´ıade Nuevo Le´on. Last but not least, I would like to thank my friends and family for their support. I especially wish to thank my parents for their inconditional love and support throughout my life. A very special thank you is for my children, Tavo and Tani, and my husband who have always been my greatest advocates and cheerleaders. iv Abstract Metaheuristics are problem independent optimisation techniques. As such, they do not take advantage of any specificity of the problem and, therefore, can provide general frameworks that may be applied to many problem classes. These iterative upper level methodologies can furnish a guiding strategy in designing subordinate heuristics to solve specific optimisation problems. Their use in many applications shows their efficiency and effectiveness to solve large and complex problems. Nowadays, metaheuristics applied to the solution of optimisation problems have shifted towards integrating other optimisation techniques, so that solution methods benefit from the advantages each offers. This thesis seeks to contribute to the study of vehicle routing problems with optional visits by providing a dynamic programming-based operator that works embedded into a generic metaheuristic. The operator retrieves the optimal tour of customers to visit, satisfying the side constraints of the problem, while optimising the defined objective. The operator formulates the problem of selecting the best customers to visit as a Resource Constrained Elementary Shortest Path Problem on an auxiliary directed acyclic graph where the side restrictions of the problem considered act as the constraining resource. In vehicle routing problems with optional visits, the customers to serve are not known a priori and this fact leaves a more difficult to solve problem than a classic routing problem, which per se is already NP-hard. Routing problems with optional visits find application in multiple and diverse areas such as bimodal distribution design, humanitarian logistics, health care delivery, tourism, recruitment, hot rolling production, selected collection or delivery, and urban patrolling among others. Keywords: Metaheuristics, dynamic programming, vehicle routing. R´esum´e Les m´etaheuristiques sont des techniques d’optimisation ind´ependantes des probl`emes trait´es.Elles ne profitent pas d’une sp´ecificit´edu probl`emeet, par cons´equent, peuvent fournir des cadres g´en´erauxqui peuvent ˆetreappliqu´es`ade nombreuses classes de probl`emes.Les m´etaheuristiquespeuvent fournir une strat´egiede guidage dans la conception des heuristiques pour r´esoudredes probl`emesd’optimisation sp´ecifiques. Leur utilisation dans de nombreuses applications montre leur efficacit´epour r´esoudredes probl`emesimportants et complexes. De nos jours, les m´etaheuristiquesappliqu´ees`ala solution des probl`emes d’optimisation ont ´evolu´e vers l’int´egrationd’autres techniques d’optimisation, de sorte que les m´ethodes de r´esolution peuvent b´en´eficier des avantages de chacune des composantes. Le travail dans cette th`esevise `acontribuer `al’´etudedes probl`emesde tourn´eesde v´ehicules avec des visites optionnelles en fournissant un op´erateur`abase de programmation dynamique int´egr´edans un processus m´etaheuristiqueg´en´erique.L’op´erateurr´ecup`erele tour optimal de clients `avisiter, r´epondant aux contraintes du probl`eme,tout en optimisant l’objectif d´efini. L’op´erateurpose le probl`eme de la s´electiondes meilleurs clients `avisiter comme un probl`emede plus court chemin avec contraintes de ressources sur un graphe auxiliaire dirig´eacyclique repr´esentant les choix de visite possibles. Dans les probl`emesde tourn´eesde v´ehicules avec des visites optionnelles, les clients `aservir ne sont pas connus a priori et cela rend plus difficile `ar´esoudrele probl`emequ’un probl`emede routage classique qui est lui-mˆeme d´ej`aNP-difficile. Les probl`emes de tourn´ees avec des visites optionnelles trouvent des applications dans des domaines multiples et vari´es tels que la conception de la distribution, la logistique humanitaire, la prestation des soins de sant´e,le tourisme, le recrutement, la collection ou la livraison de marchandises et patrouille en milieu urbain. Mots-cl´es: M´etaheuristiques,programmation dynamique, tourn´eesde v´ehicules. v vi Contents 1 Introduction 1 1.1 Affiliation . .1 1.2 Motivation . .1 1.3 Thesis Proposal . .4 1.4 Overview of the PhD. Thesis . .5 2 Routing Problems and Solution Methods 7 2.1 Introduction . .7 2.2 Routing Problems . .8 2.2.1 The Travelling Salesman Problem . .9 2.2.2 The Capacitated Vehicle Routing Problem . 10 2.2.3 The Vehicle Routing-Allocation Problem . 10 Covering Problems . 12 Profit Problems . 15 2.3 Overview of Solution Methods . 18 2.3.1 Exact Methods . 18 2.3.2 Approximate Methods . 22 2.4 Classical Heuristics in Vehicle Routing . 23 2.4.1 Construction Heuristics . 24 2.4.2 Improvement Heuristics . 27 2.5 Large Neighborhood Search Metaheuristics . 28 2.5.1 Neighborhoods . 28 2.5.2 Neighborhood Search . 29 2.5.3 Large Neighborhood Search . 29 2.5.4 Adaptive Large Neighborhood Search . 31 2.6 Hybrid Metaheuristics . 34 2.7 Conclusions . 35 3 Solution Methodology Developed 37 3.1 Introduction . 37 3.2 Foundations of Selector ........................... 39 3.2.1 Split Operator . 39 3.2.2 Resource-Constrained Elementary Shortest Path Problem . 41 3.3 Selector Operator . 43 3.3.1 Auxiliary Graph . 43 3.3.2 Labels . 44 3.3.3 Algorithm . 45 3.4 Generating a Feasible Solution . 49 3.5 Performance Improvements . 50 3.5.1 Restricting the Number of Labels Extended . 50 viii Contents 3.5.2 Computing a Lower/Upper Bound . 51 3.5.3 Bidirectional Search . 53 3.6 Multi-Vehicle Selector ............................ 54 3.7 Metaheuristic Framework . 55 3.7.1 Destroy Sub-heuristics . 57 Shaw Removal Heuristic . 57 Worst Removal Heuristic . 58 Random Removal Heuristic . 58 How Many to Remove . 58 3.7.2 Repair Sub-heuristics . 58 Best Greedy Heuristic . 58 First Greedy Heuristic . 58 Regret Heuristic . 59 Choosing a Destroy-Repair Heuristic Pair . 59 Adaptive Weight Adjustment . 59 3.7.3 Simulated Annealing Guides the Search . 60 3.8 Conclusions . 61 4 Solving the Covering Tour Problem with Selector 63 4.1 Introduction .
Recommended publications
  • Non-Liner Great Deluge Algorithm for Handling Nurse Rostering Problem
    International Journal of Applied Engineering Research ISSN 0973-4562 Volume 12, Number 15 (2017) pp. 4959-4966 © Research India Publications. http://www.ripublication.com Non-liner Great Deluge Algorithm for Handling Nurse Rostering Problem Yahya Z. Arajy*, Salwani Abdullah and Saif Kifah Data Mining and Optimisation Research Group (DMO), Centre for Artificial Intelligence Technology, Universiti Kebangsaan Malaysia, 43600 Bangi Selangor, Malaysia. Abstract which it has a variant of requirements and real world constraints, gives the researchers a great scientific challenge to The optimisation of the nurse rostering problem is chosen in solve. The nurse restring problem is one of the most this work due to its importance as an optimisation challenge intensively exploring topics. Further reviewing of the literature with an availability to improve the organisation in hospitals can show that over the last 45 years a range of researchers duties, also due to its relevance to elevate the health care studied the effect of different techniques and approaches on through an enhancement of the quality in a decision making NRP. To understand and efficiently solve the problem, we process. Nurse rostering in the real world is naturally difficult refer to the comprehensive literate reviews, which a great and complex problem. It consists on the large number of collection of papers and summaries regarding this rostering demands and requirements that conflicts the hospital workload problem can be found in [1], [2], and [3]. constraints with the employees work regulations and personal preferences. In this paper, we proposed a modified version of One of the first methods implemented to solve NRP is integer great deluge algorithm (GDA).
    [Show full text]
  • Metaheuristics1
    METAHEURISTICS1 Kenneth Sörensen University of Antwerp, Belgium Fred Glover University of Colorado and OptTek Systems, Inc., USA 1 Definition A metaheuristic is a high-level problem-independent algorithmic framework that provides a set of guidelines or strategies to develop heuristic optimization algorithms (Sörensen and Glover, To appear). Notable examples of metaheuristics include genetic/evolutionary algorithms, tabu search, simulated annealing, and ant colony optimization, although many more exist. A problem-specific implementation of a heuristic optimization algorithm according to the guidelines expressed in a metaheuristic framework is also referred to as a metaheuristic. The term was coined by Glover (1986) and combines the Greek prefix meta- (metá, beyond in the sense of high-level) with heuristic (from the Greek heuriskein or euriskein, to search). Metaheuristic algorithms, i.e., optimization methods designed according to the strategies laid out in a metaheuristic framework, are — as the name suggests — always heuristic in nature. This fact distinguishes them from exact methods, that do come with a proof that the optimal solution will be found in a finite (although often prohibitively large) amount of time. Metaheuristics are therefore developed specifically to find a solution that is “good enough” in a computing time that is “small enough”. As a result, they are not subject to combinatorial explosion – the phenomenon where the computing time required to find the optimal solution of NP- hard problems increases as an exponential function of the problem size. Metaheuristics have been demonstrated by the scientific community to be a viable, and often superior, alternative to more traditional (exact) methods of mixed- integer optimization such as branch and bound and dynamic programming.
    [Show full text]
  • Lecture 4 Dynamic Programming
    1/17 Lecture 4 Dynamic Programming Last update: Jan 19, 2021 References: Algorithms, Jeff Erickson, Chapter 3. Algorithms, Gopal Pandurangan, Chapter 6. Dynamic Programming 2/17 Backtracking is incredible powerful in solving all kinds of hard prob- lems, but it can often be very slow; usually exponential. Example: Fibonacci numbers is defined as recurrence: 0 if n = 0 Fn =8 1 if n = 1 > Fn 1 + Fn 2 otherwise < ¡ ¡ > A direct translation in:to recursive program to compute Fibonacci number is RecFib(n): if n=0 return 0 if n=1 return 1 return RecFib(n-1) + RecFib(n-2) Fibonacci Number 3/17 The recursive program has horrible time complexity. How bad? Let's try to compute. Denote T(n) as the time complexity of computing RecFib(n). Based on the recursion, we have the recurrence: T(n) = T(n 1) + T(n 2) + 1; T(0) = T(1) = 1 ¡ ¡ Solving this recurrence, we get p5 + 1 T(n) = O(n); = 1.618 2 So the RecFib(n) program runs at exponential time complexity. RecFib Recursion Tree 4/17 Intuitively, why RecFib() runs exponentially slow. Problem: redun- dant computation! How about memorize the intermediate computa- tion result to avoid recomputation? Fib: Memoization 5/17 To optimize the performance of RecFib, we can memorize the inter- mediate Fn into some kind of cache, and look it up when we need it again. MemFib(n): if n = 0 n = 1 retujrjn n if F[n] is undefined F[n] MemFib(n-1)+MemFib(n-2) retur n F[n] How much does it improve upon RecFib()? Assuming accessing F[n] takes constant time, then at most n additions will be performed (we never recompute).
    [Show full text]
  • Developing Novel Meta-Heuristic, Hyper-Heuristic and Cooperative Search for Course Timetabling Problems
    Developing Novel Meta-heuristic, Hyper-heuristic and Cooperative Search for Course Timetabling Problems by Joe Henry Obit, MSc GEORGE GREEN uBRARY O~ SCIENCE AND ENGINEERING A thesis submitted to the School of Graduate Studies in partial fulfilment of the requirements for the degree of Doctor of Philosophy School of Computer Science University of Nottingham November 2010 Abstract The research presented in this PhD thesis focuses on the problem of university course timetabling, and examines the various ways in which metaheuristics, hyper- heuristics and cooperative heuristic search techniques might be applied to this sort of problem. The university course timetabling problem is an NP-hard and also highly constrained combinatorial problem. Various techniques have been developed in the literature to tackle this problem. The research work presented in this thesis ap- proaches this problem in two stages. For the first stage, the construction of initial solutions or timetables, we propose four hybrid heuristics that combine graph colour- ing techniques with a well-known local search method, tabu search, to generate initial feasible solutions. Then, in the second stage of the solution process, we explore dif- ferent methods to improve upon the initial solutions. We investigate techniques such as single-solution metaheuristics, evolutionary algorithms, hyper-heuristics with rein- forcement learning, cooperative low-level heuristics and cooperative hyper-heuristics. In the experiments throughout this thesis, we mainly use a popular set of bench- mark instances of the university course timetabling problem, proposed by Socha et al. [152], to assess the performance of the methods proposed in this thesis. Then, this research work proposes algorithms for each of the two stages, construction of ini- tial solutions and solution improvement, and analyses the proposed methods in detail.
    [Show full text]
  • Hyperheuristics in Logistics Kassem Danach
    Hyperheuristics in Logistics Kassem Danach To cite this version: Kassem Danach. Hyperheuristics in Logistics. Combinatorics [math.CO]. Ecole Centrale de Lille, 2016. English. NNT : 2016ECLI0025. tel-01485160 HAL Id: tel-01485160 https://tel.archives-ouvertes.fr/tel-01485160 Submitted on 8 Mar 2017 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. No d’ordre: 315 Centrale Lille THÈSE présentée en vue d’obtenir le grade de DOCTEUR en Automatique, Génie Informatique, Traitement du Signal et des Images par Kassem Danach DOCTORAT DELIVRE PAR CENTRALE LILLE Hyperheuristiques pour des problèmes d’optimisation en logistique Hyperheuristics in Logistics Soutenue le 21 decembre 2016 devant le jury d’examen: President: Pr. Laetitia Jourdan Université de Lille 1, France Rapporteurs: Pr. Adnan Yassine Université du Havre, France Dr. Reza Abdi University of Bradford, United Kingdom Examinateurs: Pr. Saïd Hanafi Université de Valenciennes, France Dr. Abbas Tarhini Lebanese American University, Lebanon Dr. Rahimeh Neamatian Monemin University Road, United Kingdom Directeur de thèse: Pr. Frédéric Semet Ecole Centrale de Lille, France Co-encadrant: Dr. Shahin Gelareh Université de l’ Artois, France Invited Professor: Dr. Wissam Khalil Université Libanais, Lebanon Thèse préparée dans le Laboratoire CRYStAL École Doctorale SPI 072 (EC Lille) 2 Acknowledgements Firstly, I would like to express my sincere gratitude to my advisor Prof.
    [Show full text]
  • Dynamic Programming Via Static Incrementalization 1 Introduction
    Dynamic Programming via Static Incrementalization Yanhong A. Liu and Scott D. Stoller Abstract Dynamic programming is an imp ortant algorithm design technique. It is used for solving problems whose solutions involve recursively solving subproblems that share subsubproblems. While a straightforward recursive program solves common subsubproblems rep eatedly and of- ten takes exp onential time, a dynamic programming algorithm solves every subsubproblem just once, saves the result, reuses it when the subsubproblem is encountered again, and takes p oly- nomial time. This pap er describ es a systematic metho d for transforming programs written as straightforward recursions into programs that use dynamic programming. The metho d extends the original program to cache all p ossibly computed values, incrementalizes the extended pro- gram with resp ect to an input increment to use and maintain all cached results, prunes out cached results that are not used in the incremental computation, and uses the resulting in- cremental program to form an optimized new program. Incrementalization statically exploits semantics of b oth control structures and data structures and maintains as invariants equalities characterizing cached results. The principle underlying incrementalization is general for achiev- ing drastic program sp eedups. Compared with previous metho ds that p erform memoization or tabulation, the metho d based on incrementalization is more powerful and systematic. It has b een implemented and applied to numerous problems and succeeded on all of them. 1 Intro duction Dynamic programming is an imp ortant technique for designing ecient algorithms [2, 44 , 13 ]. It is used for problems whose solutions involve recursively solving subproblems that overlap.
    [Show full text]
  • Automatic Code Generation Using Dynamic Programming Techniques
    ! Automatic Code Generation using Dynamic Programming Techniques MASTERARBEIT zur Erlangung des akademischen Grades Diplom-Ingenieur im Masterstudium INFORMATIK Eingereicht von: Igor Böhm, 0155477 Angefertigt am: Institut für System Software Betreuung: o.Univ.-Prof.Dipl.-Ing. Dr. Dr.h.c. Hanspeter Mössenböck Linz, Oktober 2007 Abstract Building compiler back ends from declarative specifications that map tree structured intermediate representations onto target machine code is the topic of this thesis. Although many tools and approaches have been devised to tackle the problem of automated code generation, there is still room for improvement. In this context we present Hburg, an implementation of a code generator generator that emits compiler back ends from concise tree pattern specifications written in our code generator description language. The language features attribute grammar style specifications and allows for great flexibility with respect to the placement of semantic actions. Our main contribution is to show that these language features can be integrated into automatically generated code generators that perform optimal instruction selection based on tree pattern matching combined with dynamic program- ming. In order to substantiate claims about the usefulness of our language we provide two complete examples that demonstrate how to specify code generators for Risc and Cisc architectures. Kurzfassung Diese Diplomarbeit beschreibt Hburg, ein Werkzeug das aus einer Spezi- fikation des abstrakten Syntaxbaums eines Programms und der Spezifika- tion der gewuns¨ chten Zielmaschine automatisch einen Codegenerator fur¨ diese Maschine erzeugt. Abbildungen zwischen abstrakten Syntaxb¨aumen und einer Zielmaschine werden durch Baummuster definiert. Fur¨ diesen Zweck haben wir eine deklarative Beschreibungssprache entwickelt, die es erm¨oglicht den Baummustern Attribute beizugeben, wodurch diese gleich- sam parametrisiert werden k¨onnen.
    [Show full text]
  • Hybrid Genetic Algorithms with Great Deluge for Course Timetabling
    IJCSNS International Journal of Computer Science and Network Security, VOL.10 No.4, April 2010 283 Hybrid Genetic Algorithms with Great Deluge For Course Timetabling Nabeel R. AL-Milli Financial and Business Administration and Computer Science Department Zarqa University College Al-Balqa' Applied University time slots in such a way that no constraints are Summary violated for each timeslot [7]. The Course Timetabling problem deals with the assignment of 2) Constraint Based Methods, according to which a course (or lecture events) to a limited set of specific timeslots and timetabling problem is modeled as a set of rooms, subject to a variety of hard and soft constraints. All hard variables (events) to which values (resources such constraints must be satisfied, obtaining a feasible solution. In this as teachers and rooms) have to be assigned in paper we establish a new hybrid algorithm to solve course timetabling problem based on Genetic Algorithm and Great order to satisfy a number of hard and soft Deluge algorithm. We perform a hybrdised method on standard constraints [8]. benchmark course timetable problems and able to produce 3) Cluster Methods, in which the problem is divided promising results. into a number of events sets. Each set is defined Key words: so that it satisfies all hard constraints. Then, the Course timetabling, Genetic algorithms, Great deluge sets are assigned to real time slots to satisfy the soft constraints as well [9]. 4) Meta-heuristic methods, such as genetic 1. Introduction algorithms (GAs), simulated annealing, tabu search, and other heuristic approaches, that are University Course Timetabling Problems (UCTPs) is an mostly inspired from nature, and apply nature-like NPhard problem, which is very difficult to solve by processes to solutions or populations of solutions, conventional methods and the amount of computation in order to evolve them towards optimality [1], required to find optimal solution increases exponentially [3], [4], [10], [11], [13],[14].
    [Show full text]
  • 1 Introduction 2 Dijkstra's Algorithm
    15-451/651: Design & Analysis of Algorithms September 3, 2019 Lecture #3: Dynamic Programming II last changed: August 30, 2019 In this lecture we continue our discussion of dynamic programming, focusing on using it for a variety of path-finding problems in graphs. Topics in this lecture include: • The Bellman-Ford algorithm for single-source (or single-sink) shortest paths. • Matrix-product algorithms for all-pairs shortest paths. • Algorithms for all-pairs shortest paths, including Floyd-Warshall and Johnson. • Dynamic programming for the Travelling Salesperson Problem (TSP). 1 Introduction As a reminder of basic terminology: a graph is a set of nodes or vertices, with edges between some of the nodes. We will use V to denote the set of vertices and E to denote the set of edges. If there is an edge between two vertices, we call them neighbors. The degree of a vertex is the number of neighbors it has. Unless otherwise specified, we will not allow self-loops or multi-edges (multiple edges between the same pair of nodes). As is standard with discussing graphs, we will use n = jV j, and m = jEj, and we will let V = f1; : : : ; ng. The above describes an undirected graph. In a directed graph, each edge now has a direction (and as we said earlier, we will sometimes call the edges in a directed graph arcs). For each node, we can now talk about out-neighbors (and out-degree) and in-neighbors (and in-degree). In a directed graph you may have both an edge from u to v and an edge from v to u.
    [Show full text]
  • Language and Compiler Support for Dynamic Code Generation by Massimiliano A
    Language and Compiler Support for Dynamic Code Generation by Massimiliano A. Poletto S.B., Massachusetts Institute of Technology (1995) M.Eng., Massachusetts Institute of Technology (1995) Submitted to the Department of Electrical Engineering and Computer Science in partial fulfillment of the requirements for the degree of Doctor of Philosophy at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY September 1999 © Massachusetts Institute of Technology 1999. All rights reserved. A u th or ............................................................................ Department of Electrical Engineering and Computer Science June 23, 1999 Certified by...............,. ...*V .,., . .* N . .. .*. *.* . -. *.... M. Frans Kaashoek Associate Pro essor of Electrical Engineering and Computer Science Thesis Supervisor A ccepted by ................ ..... ............ ............................. Arthur C. Smith Chairman, Departmental CommitteA on Graduate Students me 2 Language and Compiler Support for Dynamic Code Generation by Massimiliano A. Poletto Submitted to the Department of Electrical Engineering and Computer Science on June 23, 1999, in partial fulfillment of the requirements for the degree of Doctor of Philosophy Abstract Dynamic code generation, also called run-time code generation or dynamic compilation, is the cre- ation of executable code for an application while that application is running. Dynamic compilation can significantly improve the performance of software by giving the compiler access to run-time infor- mation that is not available to a traditional static compiler. A well-designed programming interface to dynamic compilation can also simplify the creation of important classes of computer programs. Until recently, however, no system combined efficient dynamic generation of high-performance code with a powerful and portable language interface. This thesis describes a system that meets these requirements, and discusses several applications of dynamic compilation.
    [Show full text]
  • Bellman-Ford Algorithm
    The many cases offinding shortest paths Dynamic programming Bellman-Ford algorithm We’ve already seen how to calculate the shortest path in an Tyler Moore unweighted graph (BFS traversal) We’ll now study how to compute the shortest path in different CSE 3353, SMU, Dallas, TX circumstances for weighted graphs Lecture 18 1 Single-source shortest path on a weighted DAG 2 Single-source shortest path on a weighted graph with nonnegative weights (Dijkstra’s algorithm) 3 Single-source shortest path on a weighted graph including negative weights (Bellman-Ford algorithm) Some slides created by or adapted from Dr. Kevin Wayne. For more information see http://www.cs.princeton.edu/~wayne/kleinberg-tardos. Some code reused from Python Algorithms by Magnus Lie Hetland. 2 / 13 �������������� Shortest path problem. Given a digraph ����������, with arbitrary edge 6. DYNAMIC PROGRAMMING II weights or costs ���, find cheapest path from node � to node �. ‣ sequence alignment ‣ Hirschberg's algorithm ‣ Bellman-Ford 1 -3 3 5 ‣ distance vector protocols 4 12 �������� 0 -5 ‣ negative cycles in a digraph 8 7 7 2 9 9 -1 1 11 ����������� 5 5 -3 13 4 10 6 ������������� ���������������������������������� 22 3 / 13 4 / 13 �������������������������������� ��������������� Dijkstra. Can fail if negative edge weights. Def. A negative cycle is a directed cycle such that the sum of its edge weights is negative. s 2 u 1 3 v -8 w 5 -3 -3 Reweighting. Adding a constant to every edge weight can fail. 4 -4 u 5 5 2 2 ���������������������� c(W) = ce < 0 t s e W 6 6 �∈ 3 3 0 v -3 w 23 24 5 / 13 6 / 13 ���������������������������������� ���������������������������������� Lemma 1.
    [Show full text]
  • Notes on Dynamic Programming Algorithms & Data Structures 1
    Notes on Dynamic Programming Algorithms & Data Structures Dr Mary Cryan These notes are to accompany lectures 10 and 11 of ADS. 1 Introduction The technique of Dynamic Programming (DP) could be described “recursion turned upside-down”. However, it is not usually used as an alternative to recursion. Rather, dynamic programming is used (if possible) for cases when a recurrence for an algorithmic problem will not run in polynomial-time if it is implemented recursively. So in fact Dynamic Programming is a more- powerful technique than basic Divide-and-Conquer. Designing, Analysing and Implementing a dynamic programming algorithm is (like Divide- and-Conquer) highly problem specific. However, there are particular features shared by most dynamic programming algorithms, and we describe them below on page 2 (dp1(a), dp1(b), dp2, dp3). It will be helpful to carry along an introductory example-problem to illustrate these fea- tures. The introductory problem will be the problem of computing the nth Fibonacci number, where F(n) is defined as follows: F0 = 0; F1 = 1; Fn = Fn-1 + Fn-2 (for n ≥ 2). Since Fibonacci numbers are defined recursively, the definition suggests a very natural recursive algorithm to compute F(n): Algorithm REC-FIB(n) 1. if n = 0 then 2. return 0 3. else if n = 1 then 4. return 1 5. else 6. return REC-FIB(n - 1) + REC-FIB(n - 2) First note that were we to implement REC-FIB, we would not be able to use the Master Theo- rem to analyse its running-time. The recurrence for the running-time TREC-FIB(n) that we would get would be TREC-FIB(n) = TREC-FIB(n - 1) + TREC-FIB(n - 2) + Θ(1); (1) where the Θ(1) comes from the fact that, at most, we have to do enough work to add two values together (on line 6).
    [Show full text]