{'fraction_non_alphanumeric': 0.016113744075829384, 'fraction_numerical': 0.0009478672985781991, 'mean_word_length': 4.899441340782123, '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}}
The Complexity of Toroidality Testing

We study the toroidality testing and toroidal embedding problems in the context of bounded space algorithms. Specifically, we show that the problem of embedding a toroidal graph on a surface of genus 1 can be solved by an algorithm that runs in deterministic logarithmic space. The algorithm rejects whenever the graph is not toroidal. This algorithm is optimal as we also show a matching hardness result. The algorithm and its proof of correctness are simple & elementary and do not make use of graph minor theory or of the embedding extension techniques of previous works. The only black-boxes we need are a planar embedding algorithm (such as the one by Allender-Mahajan or by DattaPrakriya) and the undirected reachability algorithm of Reingold, both of which are deterministic logarithmic space algorithms. Our result implies that toroidal directed reachability and toroidal bipartite perfect matching problems are in UL ∩ co-UL and SPL ∩ NL respectively even when a toroidal embedding is not part of the input.