{'fraction_non_alphanumeric': 0.020765027322404372, 'fraction_numerical': 0.0, 'mean_word_length': 5.361111111111111, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Constraints reordering to speed up successive over-relaxation for constraint-based user interface layouts

If successive over-relaxation (SOR) is applied to linear systems, the ordering in which constraints are solved affects the convergence behaviour of the algorithm. A bad ordering can slow down the convergence whereas a good ordering can speed it up. To overcome this problem, we propose an algorithm that reorders the sequence of constraints used during solving in an optimal way. Our contribution consists of, first, a metric to measure the optimality of a constraint sequence and, second, a simulated annealing based algorithm, which optimizes the order of constraints. The performance of sequence optimization is evaluated empirically using randomly generated UI layout specifications of various sizes. The results show that our proposed algorithm speeds up the convergence of SOR for constraint-based UIs.