Skip to content

Complexity Calculation Formulas

The Degree of Complexity calculation might be of interest to you. This appendix explains how to derive it.

Because changes are of two types (single and in conflict), reconciliation complexity depends on the following two factors:

  • the number of single changes

  • the number of conflicts.

The conflicts themselves are of two types:

  • involving only two derivatives

  • involving more than two derivatives

Also, the single changes are of two types:

  • simple - deletions and insertions

  • combined - replacements = deletions + insertions

The following table contains the main variable that determine the Degree of Reconciliation Complexity.

Variable Description
R The current number of replaced Base code line
C' The number of Base code lines still in conflict
C" The number of conflicts C' that involve more than two derivatives
S The number of base code lines changed in only one derivative or in the same way in all derivatives affecting a base code line
C The initial number of base code lines in conflict
N The total number of base code lines

The Degree of Complexity is determined as follows:

NONE    = 0                 when R = C'= C" = S = 0

LOW     = Low               when C'= C" = 0 and S >= R > 0

        = low               when R = C'= C" = 0 and S > 0

MIDDLE  = Low + Mid         when C'> 0 and C" = 0 and C'/ (S + C) <
                            threshold (default 50%)

HIGH    = Low + Mid + High  when C" > 0 and/or C'/ (S + C) >= threshold
                            (default 50%)

where the intermediate variables Low, low, Mid, and High are calculated as follows:

Intermediate Values How Calculated
Low: 0 < R / S <= 1 = 1, 2, 3 when <= 1/3, 2/3, 3/3
low: 0 < S / N <= 1 = 1, 2, 3 when <= 1/3, 2/3, 3/3
Mid: 0 <= C'/ (S + C) <= 1 IF 0 < C'/ (S + C) < threshold (default 50%) = 1, 2, 3 when <= 1/3, 2/3, 3/3 of threshold ELSE = 4, 5, 6 when <= 1/3, 2/3, 3/3 of (100 - threshold)
High: 0 <= C" / C <= 1 = 1, 2, 3 when <= 1/3, 2/3, 3/3