Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 ·...

11
Fajie Li and Reinhard Klette Euclidean Shortest Paths Exact or Approximate Algorithms Springer

Transcript of Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 ·...

Page 1: Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 · Euclidean Shortest Paths Ptolemy once asked Euclid whether there was any shorter way to

Fajie Li and Reinhard Klette

Euclidean Shortest Paths

Exact or Approximate Algorithms

Springer

Page 2: Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 · Euclidean Shortest Paths Ptolemy once asked Euclid whether there was any shorter way to

Contents

Foreword by Ron Kimmel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Part I Discrete or Continuous Shortest Paths

1 Euclidean Shortest Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.1 Arithmetic Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.2 Upper Time Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.3 Free Parameters in Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.4 An Unsolvable Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151.5 Distance, Metric, and Length of a Path . . . . . . . . . . . . . . . . . . . . . . . . . 161.6 A Walk in Ancient Alexandria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201.7 Shortest Paths in Weighted Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231.8 Points, Polygons, and Polyhedrons in Euclidean Spaces . . . . . . . . . . 271.9 Euclidean Shortest Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

2 Deltas and Epsilons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392.1 Exact and δ -Approximate Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . 392.2 Approximate Iterative ESP Algorithms . . . . . . . . . . . . . . . . . . . . . . . . 422.3 Convergence Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442.4 Convex Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472.5 Topology in Euclidean Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482.6 Continuous and Differentiable Functions; Length of a Curve . . . . . . 502.7 Calculating the Zero of a Continuous Function . . . . . . . . . . . . . . . . . . 532.8 Cauchy’s Mean-Value Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

3

Page 3: Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 · Euclidean Shortest Paths Ptolemy once asked Euclid whether there was any shorter way to

4 Contents

3 Rubberband Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593.1 Pursuit Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593.2 Fixed or Floating ESP Problems; Sequence of Line Segments . . . . . 613.3 Rubberband Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633.4 A Rubberband Algorithm for Line Segments in 3D Space . . . . . . . . . 653.5 Asymptotic and Experimental Time Complexity . . . . . . . . . . . . . . . . . 663.6 Proof of Correctness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693.7 Processing Non-Disjoint Line Segments as Inputs . . . . . . . . . . . . . . . 753.8 More Experimental Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783.9 An Interesting Input Example of Segments in 3D Space . . . . . . . . . . 803.10 A Generic Rubberband Algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

Part II Paths in the Plane

4 Convex Hulls in the Plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 974.1 Convex Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 974.2 Convex Hull and Shortest Path; Area . . . . . . . . . . . . . . . . . . . . . . . . . . 1004.3 Convex Hull of a Set of Points in the Plane . . . . . . . . . . . . . . . . . . . . . 1044.4 Convex Hull of a Simple Polygon or Polyline . . . . . . . . . . . . . . . . . . . 1094.5 Relative Convex Hulls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1154.6 Minimum-Length Polygons in Digital Pictures . . . . . . . . . . . . . . . . . . 1174.7 Relative Convex Hulls - The General Case . . . . . . . . . . . . . . . . . . . . . . 119Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

5 Partitioning a Polygon or the Plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1295.1 Partitioning and Shape Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1295.2 Partitioning of Simple Polygons and Dual Graphs . . . . . . . . . . . . . . . 1315.3 Seidel’s Algorithm for Polygon Trapezoidation . . . . . . . . . . . . . . . . . . 1345.4 Inner, Up-, Down-, or Monotone Polygons . . . . . . . . . . . . . . . . . . . . . 1405.5 Trapezoidation of a Polygon at Up- or Down-Stable Vertices . . . . . . 1435.6 Time Complexity of Algorithm 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1535.7 Polygon Trapezoidation Method by Chazelle . . . . . . . . . . . . . . . . . . . 1555.8 The Continuous Dijkstra Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1575.9 Wavelets and Shortest-Path Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1585.10 Mitchell’s Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

6 ESPs in Simple Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1716.1 Properties of ESPs in Simple Polygons . . . . . . . . . . . . . . . . . . . . . . . . 1716.2 Decompositions and Approximate ESPs . . . . . . . . . . . . . . . . . . . . . . . 1756.3 Chazelle Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1776.4 Two Approximate Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180

Page 4: Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 · Euclidean Shortest Paths Ptolemy once asked Euclid whether there was any shorter way to

Contents 5

6.5 Chazelle Algorithm versus both RBAs . . . . . . . . . . . . . . . . . . . . . . . . . 1826.6 Turning the Approximate RBA into an Exact Algorithm . . . . . . . . . . 183Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186

Part III Paths in 3-Dimensional Space

7 Paths on Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1917.1 Obstacle Avoidance Paths in 3D Space . . . . . . . . . . . . . . . . . . . . . . . . . 1917.2 Polygonal Cuts and Bands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1937.3 ESPs on Surfaces of Convex Polyhedrons . . . . . . . . . . . . . . . . . . . . . . 1957.4 ESPs on Surfaces of Polyhedrons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1997.5 The Non-Existence of Exact Algorithms for Surface ESPs . . . . . . . . 205Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

8 Paths in Simple Polyhedrons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2118.1 Types of Polyhedrons; Strips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2118.2 ESP Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2168.3 Time Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2218.4 Examples: Three NP-complete or NP-hard Problems . . . . . . . . . . . . . 2228.5 Conclusions for the General 3D ESP Problem . . . . . . . . . . . . . . . . . . . 224Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

9 Paths in Cube-Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2299.1 The Cuboidal World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2309.2 Original and Revised RBA for Cube-Curves . . . . . . . . . . . . . . . . . . . . 2349.3 An Algorithm with Guaranteed Error Limit . . . . . . . . . . . . . . . . . . . . . 2379.4 MLPs of Decomposable Simple Cube-Curves . . . . . . . . . . . . . . . . . . . 2419.5 Analysis of the Original RBA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2549.6 RBAs for MLP Calculation in Any Simple Cube-Curve . . . . . . . . . . . 2729.7 Correctness Proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2839.8 Time Complexities and Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2849.9 The Non-Existence of Exact Solutions . . . . . . . . . . . . . . . . . . . . . . . . . 287Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300

Part IV Art Galleries

10 Touring Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30910.1 About TPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30910.2 Contributions in this Chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31210.3 The Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31310.4 Experimental Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31710.5 Concluding Remarks and Future Work . . . . . . . . . . . . . . . . . . . . . . . . . 318

Page 5: Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 · Euclidean Shortest Paths Ptolemy once asked Euclid whether there was any shorter way to

6 Contents

Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

11 Watchman Routes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32311.1 Essential Cuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32311.2 Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32911.3 Correctness and Time Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338

12 Safari and Zookeeper Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34312.1 Fixed and Floating Problems; Dilations . . . . . . . . . . . . . . . . . . . . . . . . 34312.2 Solving the Safari Route Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34612.3 Solving the Zookeeper Route Problem . . . . . . . . . . . . . . . . . . . . . . . . . 35112.4 Some Generalizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359

Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367

Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

Page 6: Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 · Euclidean Shortest Paths Ptolemy once asked Euclid whether there was any shorter way to

Preface

A Euclidean shortest path connects a source with a destination, avoids some places(called obstacles), visits some places (called attractions), possibly in a defined or-der, and is of minimum length. Euclidean shortest-path problems are defined in theEuclidean plane or in Euclidean 3-dimensional space. The calculation of a convexhull in the plane is an example for finding a shortest path (around the given setof planar obstacles). Polyhedral obstacles and polyhedral attractions, a start and anendpoint define a general Euclidean shortest-path problem in 3-dimensional space.

The book presents selected algorithms (i.e., not aiming at a general overview)for the exact or approximate solution of shortest-path problems. Subjects in thefirst chapters of the book also include fundamental algorithms. Graph theory offersshortest-path algorithms for discrete problems. Convex hulls (and to a less extentalso constrained convex hulls) have been discussed in computational geometry. Sei-del’s triangulation and Chazelle’s triangulation method for a simple polygon, andMitchell’s solution of the continuous Dijkstra problem have also been selected for adetailed presentation, just to name three examples of important work in the area.

The book also covers a class of algorithms (called rubberband algorithms),which originated from a proposal for calculating minimum-length polygonal curvesin cube-curves; Thomas Bulow was a co-author of the initiating publication, and hecoined the name ‘rubberband algorithm’ in 2000 for the first time for this approach.

Subsequent work between 2000 and now shows that the basic ideas of this al-gorithm generalized for solving a range of problems. In a sequence of publicationsbetween 2003 and 2010 we, the authors of this book, describe a class of rubberbandalgorithms with proofs of their correctness and time-efficiency. Those algorithmscan be used to solve different Euclidean shortest-path (ESP) problems, such as cal-culating the ESP inside of a simple cube-arc (the initial problem), inside of a simplepolygon, on the surface of a convex polytope, or inside of a simple polyhedron, butalso ESP problems such as touring a finite sequence of polygons, cutting parts, orthe safari, zookeeper, or watchman route problems.

We aimed at writing a book that might be useful for a second or third-year algo-rithms course at university level. It should also contain sufficient details for studentsand researchers in the field who are keen to understand the correctness proofs, the

7

Page 7: Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 · Euclidean Shortest Paths Ptolemy once asked Euclid whether there was any shorter way to

8 Preface

analysis of time complexities and related topics and not just the algorithms and theirpseudocodes. The book discusses selected subjects and algorithms at some depth,including mathematical proofs for most of the given statements. (This is differentfrom books which aim at a representative coverage of areas in algorithm design.)

Each chapter closes with theoretical or programming exercises, giving studentsvarious opportunities to learn the subject by solving problems or doing their ownexperiments. Tasks are (intentionally) only sketched in the given programming exer-cises, not described exactly in all their details (say, as it is typically when a costumerspecifies a problem to an IT consultant), and identical solutions to such vaguely de-scribed projects do not exist, leaving space for the creativity of the student.

The audience for the book could be students in computer science, IT, mathe-matics, or engineering at a university, or academics being involved in research orteaching of efficient algorithms. The book could also be useful for programmers,mathematicians, or engineers which have to deal with shortest-path problems inpractical applications, such as in robotics (e.g., when programming an industrialrobot), in routing (i.e., when selecting a path in a network), in gene technology (e.g.,when studying structures of genes), or in game programming (e.g., when optimizingpaths for moves of players) - just to cite four of such application areas.

The authors thank (in alphabetical order) Tetsuo Asano, Donald Bailey, Chander-jit Bajaj, Partha Bhowmick, Alfred (Freddy) Bruckstein, Thomas Bulow, Xia Chen,Yewang Chen, David Coeurjolly, Eduardo Destefanis, Michael J. Dinneen, DavidEppstein, Claudia Esteves Jaramillo, David Gauld, Jean-Bernard Hayet, DavidKirkpatrick, Wladimir Kovalevski, Norbert Kruger, Jacques-Olivier Lachaud, JoeMitchell, Akira Nakamura, Xiuxia Pan, Henrik G. Petersen, Nicolai Petkov, FridrichSloboda, Gerald Sommer, Mutsuhiro Terauchi, Ivan Reilly, the late Azriel Rosen-feld, the late Klaus Voss, Jinlong Wang, and Jovisa Zunic for discussions or com-ments that were of relevance for this book.

The authors thank Chengle Huang (ChingLok Wong) for discussions on rubber-band algorithms; he also wrote C++ programs for testing Algorithms 7 and 8. Wethank Jinling Zhang and Xinbo Fu for improving C++ programs for testing Algo-rithm 7. The authors acknowledge computer support by Wei Chen, Wenze Chen,Yongqian Du, Wenxian Jiang, Yanmin Luo, Shujuan Peng, Huijuan Pi, HuazhenWang, and Jian Yu.

The first author thanks dean Weibin Chen at Huaqiao University for supportingthe project of writing this book. The second author thanks Jose L. Marroquın atCIMAT Guanajuato for an invitation to this institute, thus providing excellent con-ditions for working on this book project.

Parts of Chapter 4 (on relative convex hulls) are co-authored by Gisela Klette,who also contributed comments, ideas and criticisms throughout the book project.

We are grateful to Garry Tee for corrections and valuable comments, often addingimportant mathematical or historic details.

Huaqiao and Auckland, Fajie LiJuly 2011 Reinhard Klette

Page 8: Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 · Euclidean Shortest Paths Ptolemy once asked Euclid whether there was any shorter way to

Part IDiscrete or Continuous Shortest Paths

Page 9: Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 · Euclidean Shortest Paths Ptolemy once asked Euclid whether there was any shorter way to

The road system of the historic city of Guanajuato is mostly underground, forminga network of tunnels. Optimizing routes from one part of the city to another part isan exciting task not only for visitors of the city, but even for locals. In 2010, therewas not yet a “3D route planner” available for calculating shortest connections inthis historic city.

The first part of the book defines shortest paths in the geometry that we prac-tice in our daily life, known as Euclidean geometry. Finding a shortest pathbetween two given points and avoiding existing obstacles can be a challenge.We provide basic definitions and we propose the class of rubberband algo-rithms for solving various Euclidean shortest-path problems, either defined inthe plane or in the 3-dimensional space.

Page 10: Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 · Euclidean Shortest Paths Ptolemy once asked Euclid whether there was any shorter way to

Chapter 1Euclidean Shortest Paths

Ptolemy once asked Euclid whether there was any shorter wayto a knowledge of geometry than by a study of the Elements,whereupon Euclid answered that there was no royal road togeometry.

Proclus Diadochus (410...412 – 485)

This introductory chapter explains the difference between shortest paths in finitegraphs and shortest paths in Euclidean geometry, which is also called ‘the commongeometry of our world’. The chapter demonstrates the diversity of such problems,defined between points in a plane, on a surface, or in the 3-dimensional space.

1.1 Arithmetic Algorithms

Technology is evaluated by applying various measures, which are mapping compo-nents of the technology into real numbers, such as kilometres per hour, a maximumerror in millimetres, or a shape descriptor. We describe algorithms with respect torun time, deviations of results from being optimal, or necessary constraints on inputdata.

The shortest path algorithms in this book are designed to be fast, accurate, andfor a wide range of input data.

The time for calculating a shortest path on a computer depends on parameterssuch as available memory space or execution time per applied operation. It is mean-ingless to express the required time as an absolute value in, say, micro- or nano-seconds, because computers differ in their parameters, they change frequently, andyour computer is certainly not identical to one used by someone else.

Measures for computing time need to be independent from the configuration ofcomputers for expressing the quality of an algorithm. For example, we apply an ab-stract measure to estimate the running time of algorithms, also called time complex-ity or computational complexity. This is a common approach in computer sciencefor more than 50 years. We define a set of basic operations, thus specifying a par-ticular abstract computer, and we assign one time unit to each basic operation. Sucha ‘unit of time’ is not measured in a physical scale; it is an abstract unit for each

11

Page 11: Euclidean Shortest Paths - University of Aucklandrklette/Books/LK2011/... · 2011-08-07 · Euclidean Shortest Paths Ptolemy once asked Euclid whether there was any shorter way to

12 1 Euclidean Shortest Paths

basic operation. For those abstract units, the estimation of run time of an algorithmis independent of progress in computer technology.

Definition 1.1. An algorithm is a finite sequence of basic operations.

We consider basic operations that are executable on ‘a normal sequential com-puter’, and not, for example, on some kind of specialized processor. Basic opera-tions are classified into numerical operations, logical tests, and control instructions;alphanumerical operations on letters or other symbols are not a subject in this book.Logical tests are comparisons in magnitude (such as “length < threshold”?). Con-trol instructions are of the type if-then-else, while-do, or do-until. It only remains todefine a particular computer model by specifying the set of numerical operations.

Definition 1.2. An arithmetic algorithm is defined by having addition, subtraction,multiplication, division, and the n-th root (for any integer n > 1) as its basic opera-tions.

A scientific algorithm expands an arithmetic algorithm by the following addi-tional basic operations: trigonometric and inverse trigonometric functions, expo-nential and logarithmic functions, factorials, and conversions of numbers betweendifferent representation schemes (binary, decimal, or hexadecimal).

This book applies arithmetic algorithms for solving shortest-path problems.

(There is just one case in the book where trigonometric functions are used whenoptimizing a point location in an ellipse.)

Arithmetic algorithms are further specified by the range of numbers they areworking on. For example, assuming the unbounded range of rational numbers a/b(for integers a and b) goes beyond the capabilities of existing computers, which canonly represent rational numbers up to some finite number of bits per number. Evenif divisions a/b are not performed, and assuming that there are no roots (i.e., allcalculations remain in the area of integers) then there is still the problem of a limitedrange, having only a finite number of bits for representing all available integers.

Definition 1.3. An arithmetic algorithm over the rational numbers uses the basicoperations as available in an arithmetic algorithm and operates on the set of allrational numbers.

1.2 Upper Time Bounds

We assume, as is common in algorithmic complexity theory, that the performanceof each basic operation requires one time unit.