Algorithm Search⌘K

Problemcore

Discrete geodesic problem

Also called geodesics on polyhedral surfaces.

Find shortest paths or the geodesic distance field on the surface of a polyhedron, where paths may cross faces and unfold over edges.

The discrete geodesic problem asks for shortest paths on the surface of a polyhedron, usually a triangle mesh. A path may go anywhere on the surface: straight across a face, over an edge into the next face, and around a vertex. Its length is its Euclidean length. The geodesic distance from a source to a point is the length of a shortest such path, and the distance field gives it for every point or every vertex. The problem is not a graph problem. A shortest path along the edges of the mesh is in general longer than the geodesic, and it does not get closer when the mesh is refined. Mitchell, Mount and Papadimitriou named the problem and gave the first exact polynomial method for general surfaces in 1987.

In plain words

An ant on a box wants the shortest walk to the far corner. It can walk across the sides, not only along the edges. Cut the box open and lay two sides flat, and the best walk is a straight line on the flat sheet. The question is which sides to lay flat, and in what order, because each choice gives a different line.

The problem is to find these shortest walks, or just their lengths, from one start point to every point of a surface made of flat triangles. On a smooth curved surface the answer is a curve. On a surface of triangles it is a chain of straight pieces that bend only at edges, in a way that is straight when unfolded, or at special corners.

Definition

Input. A connected manifold triangle mesh MM with vertices in R3\mathbb{R}^3, possibly with border, and a source point ss on it, usually a vertex. Variants use a set of sources.

Paths. A path is a continuous curve on the union of the closed faces. Its length is its Euclidean length in R3\mathbb{R}^3.

Output. The geodesic distance d(x)=inf⁡{length⁡(γ):γ a path from s to x}d(x) = \inf \{\operatorname{length}(\gamma) : \gamma \text{ a path from } s \text{ to } x\}, either at every vertex, or as a description of dd on the whole surface, or a shortest path to a given target.

Structure of solutions. A shortest path exists. Inside a face it is a straight segment. Where it crosses the inside of an edge, the two faces can be unfolded into one plane, and in that plane the path is straight. It can pass through a vertex only if the vertex is on the border or its face angles sum to at least 2π2\pi. At such a vertex the path may bend, but the angles on both sides must be at least π\pi. At a vertex with angle sum below 2π2\pi, such as a corner of a cube, a shortest path never passes. So a shortest path is a straight line in the unfolding of the faces that it crosses, broken only at border vertices and at vertices of negative discrete Gaussian curvature. A path with these local properties is a geodesic, but it need not be shortest.

Variants

  • Single source, all vertices. The common form, which gives a distance field on the mesh.
  • Point to point. One source and one target, with the path as output.
  • Several sources. The distance to the nearest source, which gives the geodesic Voronoi diagram of the sources on the surface.
  • All pairs. The distance between every two vertices, an n×nn \times n table.
  • Approximate. A distance within a factor 1+ε1 + \varepsilon, or a field that converges to the true distance as the mesh is refined.
  • Convex surfaces. The surface of a convex polytope, where no vertex can be passed through, and faster exact methods exist.
  • Flat domains. A flat mesh with holes is a polygonal domain in the plane, and the problem is the Euclidean shortest path among obstacles.
  • Paths in space. Shortest paths in R3\mathbb{R}^3 among polyhedral obstacles, not on a surface, form a different and harder problem, which Canny and Reif showed to be NP-hard.
  • Weighted regions. Each face has a cost per unit length, and paths refract at edges as light does.

Examples

Edges are not enough. On a flat grid of unit squares, each cut by a diagonal in the same direction, the distance from (0,0)(0, 0) to (2,1)(2, 1) is 5≈2.236\sqrt{5} \approx 2.236, the straight line. The shortest path along edges is one diagonal and one side, 1+2≈2.4141 + \sqrt{2} \approx 2.414. If the grid is refined by a factor of kk, the same point is reached by kk diagonals and kk sides, so the error of 88 percent stays.

The cube. On the unit cube, from one corner to the opposite corner, unfolding two sides into a 1×21 \times 2 rectangle gives 5\sqrt{5}. There are six such shortest paths, one for each pair of sides that meet along an edge at neither corner. Along edges the best is 1+21 + \sqrt{2} with a face diagonal, or 33 with the cube edges only.

A box. On the box 1×2×31 \times 2 \times 3, the three unfoldings between opposite corners give (1+2)2+32=18\sqrt{(1 + 2)^2 + 3^2} = \sqrt{18}, (1+3)2+22=20\sqrt{(1 + 3)^2 + 2^2} = \sqrt{20} and (2+3)2+12=26\sqrt{(2 + 3)^2 + 1^2} = \sqrt{26}. The distance is the smallest, 18≈4.243\sqrt{18} \approx 4.243. The choice of unfolding is a combinatorial part of the problem.

Bending at a corner. On the flat L-shaped region [0,2]2[0, 2]^2 without the square (1,2]×(1,2](1, 2] \times (1, 2], the shortest path from (2,0)(2, 0) to (12,2)(\frac{1}{2}, 2) cannot be straight. It goes to the inner corner (1,1)(1, 1), a border vertex with angle 3π2\frac{3\pi}{2}, and bends there, with length 2+52≈2.532\sqrt{2} + \frac{\sqrt{5}}{2} \approx 2.532.

Known algorithms

method answer time
Mitchell, Mount and Papadimitriou, 1987, and its window form by Surazhsky and coauthors, 2005 exact, the whole distance field O(n2log⁡n)O(n^2 \log n) worst case, measured much less in practice
Chen and Han, 1990, a tree of unfoldings exact O(n2)O(n^2) time, O(n)O(n) space
Sharir and Schorr, 1986, then Schreiber and Sharir, 2008, for convex polytopes exact O(nlog⁡n)O(n \log n) for the second
graph search over Steiner points on the edges, with Dijkstra's algorithm an upper bound, within a factor that shrinks as more points are added the cost of Dijkstra on the larger graph
fast marching on the triangles, Kimmel and Sethian, 1998 an approximation that converges as the mesh is refined O(nlog⁡n)O(n \log n)
heat method, Crane, Weischedel and Wardetzky, 2013 an approximation from two sparse linear solves the cost of two solves, with a factorization reused for new sources

The exact methods give the reference values against which the approximate ones are measured. The approximate ones are faster in practice and easier to use on large meshes, and they also work on other kinds of domain, such as grids and point clouds.

AlgorithmTimeSpacePropertiesCode
Heat methodΘ(s n) worstΘ(n) extradeterministicnot exactiterative1 language
Mitchell-Mount-Papadimitriou algorithmO(n² log n) worstO(n²) extradeterministicexactiterative1 language

Bounds

  • Exact, general surfaces. O(n2log⁡n)O(n^2 \log n) time and O(n2)O(n^2) space by Mitchell, Mount and Papadimitriou, and O(n2)O(n^2) time and O(n)O(n) space by Chen and Han. A faster exact method for general nonconvex surfaces is not confirmed here.
  • Exact, convex surfaces. O(nlog⁡n)O(n \log n) time by Schreiber and Sharir, which they show to be optimal.
  • Output size. A single shortest path can cross Θ(n)\Theta(n) faces, so writing out the paths to all vertices can take Θ(n2)\Theta(n^2) space even when the nn distances alone take Θ(n)\Theta(n).
  • Graphs with a fixed spacing are not exact. A Steiner graph gives the geodesic distance to a vertex only if it contains the points where a shortest path crosses the edges. These points depend on the source and the target, so a graph with evenly spaced points gives in general only an upper bound.

Reductions

  • From planar shortest paths. Triangulate a polygonal domain with holes. The result is a flat mesh with border, and its geodesic distance is the Euclidean shortest path distance among the holes. So the planar problem is a special case.
  • To graph shortest paths, approximately. Put Steiner points on the edges and join the points of each face by straight segments. Every graph path is a real path on the surface, so graph distances are upper bounds, and with enough points they come within any factor 1+ε1 + \varepsilon.
  • To a partial differential equation. The distance field solves the eikonal equation ∣∇d∣=1|\nabla d| = 1 with d=0d = 0 at the source, which is the base of fast marching, and by Varadhan's formula it is the short-time limit of the heat equation, which is the base of the heat method.

Applications

  • Geometry processing. Geodesic distances drive remeshing, mesh segmentation, geodesic Voronoi diagrams, and the placement of samples on a surface.
  • Parameterization and texturing. Geodesic polar coordinates around a point place decals and local texture patches.
  • Shape analysis. Distance distributions on a surface are invariant to bending, so they serve as shape descriptors and for matching.
  • Path planning. Shortest routes over a terrain model for robots and vehicles.
  • Manufacturing. Tool paths at equal geodesic distance on a curved part.

References

  1. Joseph S. B. Mitchell, David M. Mount and Christos H. Papadimitriou, The discrete geodesic problem, SIAM Journal on Computing 16(4), 1987, 647 to 668, the statement of the problem for a source on a polyhedral surface, the structure of shortest paths, and the exact O(n^2 log n) algorithm
  2. Micha Sharir and Amir Schorr, On shortest paths in polyhedral spaces, SIAM Journal on Computing 15(1), 1986, 193 to 215, shortest paths on the surface of a convex polytope
  3. Yevgeny Schreiber and Micha Sharir, An optimal-time algorithm for shortest paths on a convex polytope in three dimensions, Discrete and Computational Geometry 39, 2008, the O(n log n) time bound for convex polytopes (general locator, the pages were not checked)
  4. Vitaly Surazhsky, Tatiana Surazhsky, Danil Kirsanov, Steven J. Gortler and Hugues Hoppe, Fast exact and approximate geodesics on meshes, ACM Transactions on Graphics 24(3) (SIGGRAPH 2005), 553 to 560, the practical exact method and its comparison with approximate methods on meshes
  5. Ron Kimmel and James A. Sethian, Computing geodesic paths on manifolds, Proceedings of the National Academy of Sciences 95(15), 1998, 8431 to 8435, fast marching on triangulated surfaces, with the correction for obtuse triangles
  6. Keenan Crane, Clarisse Weischedel and Max Wardetzky, Geodesics in heat, a new approach to computing distance based on heat flow, ACM Transactions on Graphics 32(5), 2013, article 152, the heat method and its comparison with exact and fast marching distances

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a contract.yaml