M Theory Lesson 2
One works with a category of Ribbon Graphs. An object is a collection of vertices and edges and an incidence map i. Arrows are pairs of arrows that form a commuting square with the two incidence maps. Vertices are always at least trivalent, but we then add bivalent vertices at the centre of each edge to create half edges. A cyclic ordering on half-edge vertices gives an orientation to the ribbon edges. By definition, a boundary of a graph is a sequence of directed edges which cycles back on itself. Then Euler's relation holds,
v - e + b = 2 - 2g
where g is the genus of the surface represented by the ribbon graph.