bk-tree
0.1.4
Header-only Burkhard-Keller tree library
|
Lee distance metric. More...
#include <bktree.hpp>
Public Member Functions | |
LeeDistance (integer_type alphabet_size=BK_LEE_ALPHABET_SIZE) | |
integer_type | compute_distance (std::string_view s, std::string_view t) const |
Public Member Functions inherited from bk_tree::metrics::Distance< LeeDistance > | |
integer_type | operator() (std::string_view s, std::string_view t) const |
Lee distance metric.
\[d(x, y) = \sum_{i=0}^{n-1} \min\{|x_i - y_i|, m - |x_i - y_i|\},\]
where \(m\) is the alphabet size, and \(x\) and \(y\) are of the same length. When \(m = 2\) or \(m = 3\), LeeDistance is the same as HammingDistance.