# Numerical Solutions to the Variational Problems by [PERSON]'s Path-Finding Algorithm
## 2 Variational Problems as the Shortest Path Finding
In the original variational problem, a path lies in the continuous  
Figure 1: The shortest path from a to b, with the smallest accumulated weight of 20.  
domain. Its trajectory directions can vary continuously. When the domain is discretized, the trajectory directions are limited. Thus, each vertex must be surrounded and joined by a large number of edges to approximate the infinitely possible directions of the trajectories passing through the vertex. Obviously, the conventional square lattice is not qualified since it allows only the vertical and horizontal edges to join a vertex. In this work, we adopt the Moser lattice [25], which is basically the square lattice with sub-lattices on the sides of a plaquette. The edges are defined as the pair-wise connection between the lattice points on the same plaquette. We can see that introducing sub-lattices increases the number of edges and path directions joining a vertex. Since each edge always lies inside or on the side of a plaquette, the lattice is short-range connected. The Euclidian distances between adjacent vertices on the lattice are of the order of the main lattice spacing. Thus, our discrete network gives a good approximation of the continuous medium when the lattice spacing is small, and the number of sub-lattices is large. Figure 2 shows an example of a two-dimensional Moser lattice with 3\(\times\)3 main lattices and five sub-lattices on each plaquette side. Even though the edges connecting vertices are abstract entities, it is useful to picture them as the real paths joining the vertices. In Figure 2, the edges are the thin straight line joining the vertices on the sides of the same plaquette. Next, we define the weight \(\mathrm{w_{ij}}\) of the edge joining the vertices i and j as  
\[\mathrm{w_{ij}}=\mathrm{F}\Big{(}\widetilde{\mathrm{x}},\widetilde{\mathrm{y }},\widetilde{\mathrm{y}}^{\prime}\Big{)}\Delta\mathrm{x_{ij}}. \tag{4}\]  
Here, \(\mathrm{F}\) is the functional defined in Equation (1); \(\widetilde{\mathrm{x}},\widetilde{\mathrm{y}}^{\prime}\), and \(\widetilde{\mathrm{y}}^{\prime}\) are the sets of values of x, y, and y\({}^{\prime}\) on edge, respectively; and \(\Delta\mathrm{x_{ij}}\) is the Euclidian distance between vertices i and j along the x-axis. The accumulated weight along a path can be defined as  
\[\widetilde{\mathrm{I}}\approx\sum_{\mathrm{path}}\mathrm{w_{ij}}. \tag{5}\]  
Figure 3 shows the examples of paths connecting the lower left and upper right vertices (vertices a and b, respectively) in the network in Figure 2. The accumulated weight along the red path is \(\widetilde{\mathrm{I}}=\mathrm{w_{ac}}+\mathrm{w_{cd}}+\mathrm{w_{db}}\), and the accumulated weight along the blue path is \(\widetilde{\mathrm{I}}=\mathrm{w_{ae}}+\mathrm{w_{ef}}+\mathrm{w_{fg}}+\mathrm{ w_{gh}}+\mathrm{w_{hb}}\). We can use a path-finding algorithm to find, among all possible paths, including these red and blue paths, the path that gives the smallest value of \(\widetilde{\mathrm{I}}\). The main message of this work is that, for a spatial network with lattice spacing l and a number of sub-lattices s, we have  
\[\lim_{\mathrm{l\to 0},\;\mathrm{s\to\infty}}\widetilde{\mathrm{I}}_{\mathrm{min}}= \mathrm{I}_{\mathrm{min}}. \tag{6}\]  
In other words, for the spatial network with infinitesimal small lattice spacing and an infinitely large number of sub-lattices, the shortest path obtained from a path-finding algorithm is identical to that in the variation problem. Practically, we expect that the  
Figure 2: An example of a 3 \(\times\) 3 Moser lattice (large dots) with 5 sub lattices (small dots). shortest path connects two vertices on a spatial network with small lattice spacing, and a large number of sub-lattices can be used to approximate the optimal path with the same initial and final points in the variational problem.