) = \min_{\pi'} \max_{1 \leq t \leq k'} \pi'(t)$, where $\pi'$ ranges over all paths starting at $\pi'(1) = \pi(t_1)$ and ending at $\pi'(k') = \pi(t_2)$.

$P$ and $Q$ are curves with $m$ and $n$ edges A locally correct discrete [Fréchet matching]{} for $P$ and $Q$

Construct grid $G$ for $P$ and $Q$ Let $T$ be a tree consisting only of the root $G[0,0]$ Add $G[i,0]$ to $T$ Add $G[0,j]$ to $T$ $\texttt{AddToTree}(T, G, i, j)$ path in $T$ between $G[0,0]$ and $G[m,n]$

#### Algorithm

The algorithm needs to compute a locally correct path between $G[0,0]$ and $G[m,n]$ in a grid $G$ of non-negative values. To this end, the algorithm incrementally constructs a tree $T$ on the grid such that each path in $T$ is locally correct. The algorithm is summarized by Algorithm \[alg:finddiscrete\]. We define a *growth node* as a node of $T$ that has a neighbor in the grid that is not yet part of $T$: a new branch may sprout from such a node. The growth nodes form a sequence of horizontally or vertically neighboring nodes. A *living node* is a node of $T$ that is not a growth node but is an ancestor of a growth node. A *dead node* is a node of $T$ that is neither a living nor a growth node, that is, it has no descendant that is a growth node. Every pair of nodes in this tree has a *nearest common ancestor* (NCA). When we have to decide what parent to use for a new node in the tree, we look at the maximum value on the path in the tree between the parents and their NCA (excluding the value of the latter). A *face* of the tree is the area enclosed by the segment between two horizontally or vertically neighboring growth nodes (without one being the parent of another) and the paths to their NCA. The unique *sink* of a face is the
) = \min_{\pi' } \max_{1 \leq t \leq k' } \pi'(t)$, where $ \pi'$ ranges over all paths depart at $ \pi'(1) = \pi(t_1)$ and end at $ \pi'(k') = \pi(t_2)$. 

 $ P$ and $ Q$ are curves with $ m$ and $ n$ edges A locally correct discrete [ Fréchet matching ] { }   for $ P$ and $ Q$ 

 Construct grid $ G$ for $ P$ and $ Q$ get $ T$ be a tree consisting only of the etymon $ G[0,0]$ total $ G[i,0]$ to $ T$ Add $ G[0,j]$ to $ T$ $ \texttt{AddToTree}(T, G, i, j)$ way in $ T$ between $ G[0,0]$ and $ G[m, n]$ 

 # # # # Algorithm 

 The algorithm need to compute a locally right path between $ G[0,0]$ and $ G[m, n]$ in a grid $ G$ of non - negative values. To this goal, the algorithm incrementally constructs a tree $ T$ on the grid such that each path in $ T$ is locally correct. The algorithm is summarized by Algorithm   \[alg: finddiscrete\ ]. We specify a * growth node * as a node of $ T$ that receive a neighbor in the grid that is not yet part of $ T$: a fresh branch may sprout from such a node. The growth nodes imprint a sequence of horizontally or vertically neighboring nodes. A * living node * is a node of $ T$ that is not a growth node but is an ancestor of a growth node. A * dead node * is a node of $ T$ that is neither a living nor a growth node, that is, it has no descendant that is a increase node. Every pair of node in this tree take a * nearest common ancestor * (NCA). When we have to decide what parent to practice for a new lymph node in the tree, we look at the maximum value on the path in the tree between the parent and their NCA (excluding the value of the latter). A * face * of the tree is the area enclosed by the segment between two horizontally or vertically neighboring growth nodes (without one being the parent of another) and the paths to their NCA. The unique * sink * of a side is the
) = \mln_{\pi'} \max_{1 \leq t \leq k'} \pi'(t)$, where $\pi'$ ranges over ell patgs startkng at $\pi'(1) = \pi(t_1)$ and ending at $\pu'(k') = \pu(t_2)$.

$P$ and $Q$ are curves wkth $m$ and $n$ edges A lixally corrxdt discvzte [Fdéghet ketching]{} for $P$ anc $Q$

Construwt grid $G$ for $[$ xnb $Q$ Let $T$ be a tree consisting only jf the tolt $G[0,0]$ Add $G[i,0]$ to $T$ Acq $G[0,j]$ no $T$ $\texttt{AddToTree}(T, G, i, j)$ patg in $T$ uetween $G[0,0]$ and $G[k,n]$

#### Algorithm

The algorithm jeedd to compute a locwlly correcj paey between $G[0,0]$ xnd $G[m,n]$ in a grid $G$ of non-negative values. To this end, the clgorithm ibceemfttally consvructs a tree $T$ on the grig such yhat each path in $T$ us locally correct. Thx algorithm is summatized by Angkrithm \[alg:finddisceere\]. We defhne x *gruwtg iods* as a nove of $T$ thaf has a neithbor in the grid tnae is not yet pzrt of $T$: a new branch may sprout from such a noge. Fhe growth nodes form a sequence of horizontwlly or vqrtically neighboring nodes. A *living node* is a noge of $G$ tkqt is boh a growth node but is an ancestor of a growtr npdv. A *dead node* is c node of $T$ that id mgither a livine nor c gdowth node, that is, it has no dwscendant thay is a growth node. Every paur of nodes pn tyis tree has a *neaxest common cncestpr* (NCS). When we have to decidz what parent to kse for a vew node in the grev, we look at the maximum value on the peth iu the trde bgtween ehe parentd and their NCA (excludinh the vdlue of thf latter). A *face* of the tree is vie area encloxeg bj the segient netween two horyzontally or vgrtically neigfboring grkwth noves (without jne being the karent of anovher) and ehe pathw to thdkr NCA. The uniaue *sink* of a face us the
) = \min_{\pi'} \max_{1 \leq t \leq where ranges over paths starting at at = \pi(t_2)$. $P$ $Q$ are curves $m$ and $n$ edges A locally discrete [Fréchet matching]{} for $P$ and $Q$ Construct grid $G$ for $P$ and Let $T$ be a tree consisting only of the root $G[0,0]$ Add $G[i,0]$ $T$ $G[0,j]$ $T$ G, i, j)$ path in $T$ between $G[0,0]$ and $G[m,n]$ #### Algorithm The algorithm needs to a locally correct path between $G[0,0]$ and $G[m,n]$ a grid $G$ of values. To this end, the incrementally a tree on grid that each path $T$ is locally correct. The algorithm is summarized by Algorithm \[alg:finddiscrete\]. We define a *growth node* as node of has a in grid is not yet $T$: a new branch may sprout node. The growth nodes form a sequence of or vertically nodes. A *living node* is a of $T$ that is not a growth node is an ancestor of a growth node. A *dead node* is a node of $T$ neither a living nor growth node, that it no that a growth Every pair of nodes in this tree has a *nearest common (NCA). When we have to decide what parent to use new in the tree, look at the maximum on path in the tree parents their value the A *face* of the is the area enclosed by segment between two horizontally (without one being the parent of another) and paths to their NCA. The unique *sink* a face is the
) = \min_{\pi'} \max_{1 \leq t \leq k'} \pi'(t)$, where $\pI'$ ranges oveR all pAthS stArTing At $\pi'(1) = \Pi(t_1)$ and ending at $\PI'(k') = \pi(T_2)$.

$P$ and $Q$ are curves with $m$ anD $n$ edgEs a LocaLLy CorreCt discrETe [fRÉchEt MaTchInG]{} FoR $P$ and $q$

CoNstruct Grid $G$ for $P$ aNd $Q$ leT $T$ be a tree conSIsTing only of The Root $G[0,0]$ Add $G[i,0]$ to $t$ AdD $G[0,j]$ to $T$ $\TeXttT{addTotreE}(T, G, i, j)$ Path in $t$ BetweeN $G[0,0]$ and $G[m,n]$

#### ALgORithm

THE algoriTHM nEeds To compute a locally COrREct path between $g[0,0]$ and $G[m,N]$ iN A gRID $G$ oF noN-negative vAlUes. To THis end, tHE aLGORitHM incrementallY constructs A TreE $T$ on thE gRid SUch thaT each PaTH in $t$ is locally cOrreCt. The algoRithm iS SummariZEd by AlgOrithm \[Alg:FinDdisCReTe\]. we dEfINe a *GRoWth NOde* As a node oF $T$ ThAt has A neiGHBOR in tHe gRid tHat is Not yet part of $T$: A neW braNCh mAy sprOut frOm suCh A node. the groWth noDeS form a sequence oF horIzontally Or vErTicAlLy neiGHborinG noDes. a *living Node* is a NOde Of $t$ THAt Is not a growth node buT iS AN aNcestor oF a growTH nOdE. a *dead nodE* iS a nOde oF $t$ That iS neiTHeR a living Nor a grOWtH nOde, that Is, It has nO dEscEndAnt thAT is a Growth Node. EverY pair OF nodes in this trEE has a *nearest cOMmON AnCEstoR* (NCa). When we have To deCIde wHat pAReNt tO Use foR a new NoDE iN The tree, we look at the mAxImum vaLue on The path in the tRee between THE Parents aNd thEIr ncA (excluding the Value Of the latteR). a *face* of tHe treE is the arEa encloseD BY the segmEnt BetWeeN twO HOrIzontally or veRTIcalLy NeighboRinG growth NodEs (wIthOut OnE being the Parent of AnOtHeR) aNd tHe patHS to their nCa. ThE uNiqUe *sinK* Of a facE is thE
) = \min_{\pi'} \max_{1 \l eq t \leqk'} \ pi' (t) $,  whe re $ \pi'$ ranges o v er a ll paths starting at $ \pi'( 1) = \p i (t _1)$and end i ng a t $ \p i' (k' )=  \ pi(t_ 2)$ .

$P$and $Q$ ar e c ur ves with $m$ an d $n$ edge s A  locally cor rec t disc re te[ Fréch etmatch ing]{} for $P $ and $Q$ 
C onstru c t grid$ G $for$P$ and $Q$ Let $ T $b e a tree consi stingon l yo f  th e r oot $G[0,0 ]$  Add$ G[i,0]$ to $ T $ A d d $G[0,j]$ to  $T$ $\text t t{A ddToTr ee }(T ,  G, i,  j)$pa t h i n $T$ betwe en $ G[0,0]$ a nd $G[ m ,n]$

# # ## Algo rithm
Th e a lgor i th mnee ds toc om put e  alocallyco rr ect p athb e t w een$G[ 0,0] $ and  $G[m,n]$ ina g rid$ G$of no n-neg ativ evalue s. Tothisen d, the algorith m in cremental lyco nst ru cts a tree $ T$onthe gri d sucht hat  e a c h  p ath in $T$ is loca ll y co rrect. T he alg o ri th m  is summ ar ize d by A lgori thm\ [a lg:findd iscret e \] .We defi ne  a *gr ow thnod e* as a no de of$T$ that  hasa  neighbor in t h e grid that i s  n o t  y e t pa rtof $T$: a n ew b r anch  may sp rou t  from  such  a no d e. The growth nodes  f orm aseque nce of horizo ntally orv e r ticallyneig h bo r ing nodes. A * livin g node* is a node o f $T$  that is  not a gr o w th nodebut  is  an  an c e st or of a growt h node .A *dead  no de* isa n ode  of  $T $that is n either a  l iv in gnor  a gr o wth node ,tha tis,  it h a s no d escen dant  t ha t  is  a grow t hn o de.Ev er y pa irof  node s in thi s treehas a *ne are s t co mm on  ancest or* (NCA). Wh en  we have t odec ide wh a t  parentto use for a new node i n  the tr ee,  we l ookat the ma xim um val ueo n thepath i n the  t ree b etwee n th e p ar ents and t h e irNCA ( ex clud ing the  value of the latt e r).  A *face* ofthe  tre e is  th e  a r eaen c los e d  by the segment  between t wo ho rizontally orve rticall y neigh borin g  growth  nodes (w ithout on ebein g the  parent of  another ) and the paths to  thei r N CA. Th euni que * sink*o f a  face  is th e
) =_\min_{\pi'} \max_{1_\leq t \leq k'}_\pi'(t)$, where_$\pi'$_ranges over_all_paths starting at_$\pi'(1) = \pi(t_1)$_and ending at $\pi'(k')_= \pi(t_2)$.

$P$ and_$Q$_are curves with $m$ and $n$ edges A locally correct discrete [Fréchet matching]{} for $P$_and_$Q$

Construct grid_$G$_for_$P$ and $Q$ Let $T$_be a tree consisting only_of the_root $G[0,0]$ Add $G[i,0]$ to $T$ Add $G[0,j]$_to_$T$ $\texttt{AddToTree}(T, G,_i, j)$ path in $T$ between $G[0,0]$ and $G[m,n]$

####_Algorithm

The algorithm needs to compute a_locally correct path_between_$G[0,0]$_and $G[m,n]$ in a_grid $G$ of non-negative values. To_this end, the algorithm incrementally constructs_a tree $T$ on the grid such_that each path in $T$ is_locally correct. The algorithm is_summarized by_Algorithm \[alg:finddiscrete\]. We define a *growth_node* as a_node of_$T$ that has_a neighbor in the grid that_is not yet_part of $T$: a new branch_may_sprout from such_a_node._The growth_nodes form a_sequence_of horizontally_or_vertically neighboring nodes. A *living node*_is_a node of $T$ that is not_a growth node but_is_an ancestor of a_growth node. A *dead node*_is a node of $T$ that_is neither_a living_nor a growth node, that is, it has no descendant that_is a growth node. Every pair_of nodes in this_tree has_a_*nearest common ancestor*_(NCA)._When we_have to decide what parent to use_for a_new node in the tree, we_look at the maximum_value_on the path in the tree_between the parents and their NCA_(excluding the value of the_latter)._A_*face* of the tree is_the area enclosed by the segment_between two horizontally_or vertically neighboring growth nodes (without one_being_the parent of another) and the_paths_to their NCA. The unique *sink*_of_a_face is the