Determine if a Graph is Toroidal

A simple graph is toroidal if it can be drawn on the surface of a torus without any edges intersecting. Your task is to take a simple undirected graph via any reasonable method (adjacency matrix, edge vertex sets, etc.) and decide whether or not it is a toroidal graph. You should output one of two distinct values for each of the two decisions. You may choose what these values are.

This is so answers will be scored in bytes with less bytes being better.

Test Cases

Here Kn is the complete graph with n vertices and Kn,m is the complete bipartite graph.

Not Toroidal

• K8
• Actual test cases would be helpful, for instance a few adjacency matrices. People are probably able to convert it to another appropriate format if they have to. – Stewie Griffin Aug 25 '17 at 18:44
• web.math.ucsb.edu/~padraic/ucsb_2013_14/math137b_s2014/… the theorem at the end states: "If G is toroidal, then the Euler characteristic of G is 0" – Giuseppe Aug 25 '17 at 19:03
• What are K₃, K₇, K₃,₃ and K₈? – Erik the Outgolfer Aug 25 '17 at 19:16
• Looks like the general purpose algorithm for this is quite extensive and probably beyond the scope of PPCG. See the Yu (2011) paper mentioned at: mathoverflow.net/questions/119493/toroidality-testing. If "maybe" is a suitable answer I've got a short 1-liner :) – Kelly Lowder Aug 25 '17 at 19:48
• @KellyLowder This is not meant to be an easy question. I don't really think there is a scope of difficulty on PPCG, after all we have the implement tetris in GoL question. – Sriotchilism O'Zaic Aug 25 '17 at 19:50