The aim of negative mapping is to reduce the count of transactions behind a server during a transaction of interest in front of it, by excluding those usually not related to the front transaction. This is crucial for intelligible graphical presentation what happens during the transaction of interest.
Below follows a simple algorithm that has the potential to exclude many of the unrelated transactions.
For each type of a transaction in front of a server, Ai (initial trial: amongst 3 most frequent and 2 most frequent amongst slow pages), and each type of transaction behind a server, Xj collect counts: what percentage of Ai , counting only those shorter than 25% quartile (or 10%) for that Ai duration, time-includes Xj. For a given Ai, each x in Xj is counted at most once (and marked as assigned). So if transactions Ai overlap, a Xj included in them, is counted as belonging to the Ai that ends first. The Ai that ends later can include another Xj. If more than 1 Xj can be assigned to a Ai only one is counted, as we are interested in A-X coincidence, not any X per A measure. If for a given pair Ai-Xj the percentage is below 0.1
this is a parameter of the method to tweak with the pair is assumed not related, i.e. negatively mapped.
We look only at Ai below certain duration, as not to count the many unrelated Xs happening during long A. The shorter the upper time limit the better the result more A-X negatively mapped but that also increases the possibility that we negatively map X exceptionally happening during long A only. Anyway, such Xs might be impossible to significantly correlate with an A, due to their low count/exceptional behavior.