Function figuring out which close-by value comes from which input value
A couple of low-hanging fruit inefficiencies:


distance = dict().  The distance[k] value is computed in a loop, and only every used in the next statement of the loop.  It does not need to be stored in a dictionary.
all([ ...list comprehension... ]): You are using list comprehension to build up a list, which you immediately pass to all(...).  There is no need to actually create the list.  Just use all(...list comprehension...).
set1 = set(value).  This is inside a for val in other_values: loop, where value and set1 are not changed.  Move the statement out of the for loop, to avoid recreating the same set each iteration.
len_values is only used in the afore mentioned all(...), and only the the values of len_values dictionary are used.  As such, the len_value dictionary construction is also unnecessary, and the if statement can be written:

if all(len(val) &lt;= 1 for val in alt_identification.values()):





Since you are returning alt_identification from the if statement, and after the if...else statement, you can invert the test, and remove one return statement:

if any(len(val) &gt; 1 for val in alt_identification.values()):
    for key, value in alt_identification.items():
        # ... omitted for brevity ...

return alt_identification


Similarly, the two if condition: continue else: could be re-written if not condition:. 



Other possible improvements:


tolerances[k] is only used in next for k loop.  The list can be removed and the calculations move into the loop.
numpy is only used for a list(np.where([...])[0]) operation, which is fairly obfuscated.  A simple list comprehension can be used instead.
The values of alt_identification are of type list, and converted (repeatedly) into a set() in the "control &amp; correct" code.  They could be stored as set() to avoid repeated conversions.


Here is my rework of the code, with the changes based on above comments:

def traceback(tuple_node, tuple_node_alt):

    def close_alternates(x):
        tolerance = (0.1 if x &lt;= 100 else 0.2) + 0.00001
        return set( k for k, alt_x in enumerate(tuple_node_alt)
                    if abs(alt_x/x - 1) &lt;= tolerance )

    alt_identification = { x: close_alternates(x) for x in tuple_node }   

    if any(len(val) &gt; 1 for val in alt_identification.values()):
        for key, values in alt_identification.items():
            if len(values) &gt; 1:
                other_values = [val for k, val in alt_identification.items() if k != key]
                if values not in other_values:
                    for other in other_values:
                        alt_identification[key] -= other

    return alt_identification


I'm getting up to a 2.8x speedup with the above code, on your test data set that require correction.