In biology, we were given a problem in which we had to use "distances" (recombination frequency) between genes in order to create a genetic map of how genes are located relative to each other on a chromosome.
For example, say that gene A and B are 11 units apart, B and C are 7 units apart, A and D are 2 units apart, and C and D are 6 units apart. This corresponds to constraints $|A-B|=11$, $|B-C|=7$, and $|A-D|=2$. One solution would be D-A-C-B, with distances of 2, 4, and 7 between each pair.
Immediately, I thought of rewriting the given data as a system of equations. Each gene-distance pair could be written as A - B = 11, for example, where A and B represent the distance gene A and gene B are from some origin point. However, this makes the assumption that B is greater than A. What if A - B = -11? Since we were only given a few genes, I simply tested all of the $2^n$ positive/negative distance possibilities, and I picked out the right answer. But this wouldn't work at scale.
So I am wondering, how could a system |A - B| = 11, |B - C| = 7, etc, be solved efficently?