Let $S$ be a compact connected orientable bordered surface of genus $g$ with $n$ holes (a hole is a component of the border homeomorphic to a circle). Consider a cell decomposition (the closure of each cell is a closed disk of the same dimension as the cell) with $f$ faces, $e\_i$ interior edges, $e\_b$ boundary edges, $v\_i$ interior vertices and $v\_b$ boundary vertices. Is there a function $F$ such that $g=F(f,e\_i,e\_b,v\_i,v\_b)$? If the answer is positive what is this function $F$?


The Euler characteristic gives me $2g+n$, and I want to recover $g$ and $n$
separately from $f,e\_i,e\_b,v\_i,v\_b$. A negative answer would be an example of two non-homeomorphic surfaces with cell decompositions for which the five numbers $f,e\_i,e\_b,v\_i,v\_b$ are the same. 



Elementary topology of surfaces
The answer is negative. First, take two hexagons $A\_1 B\_1 C\_1 D\_1 E\_1 F\_1$ and $A\_2 B\_2 C\_2 D\_2 E\_2 F\_2$ and identify vertices $(A\_1,A\_2), (B\_1,B\_2)$, as well as glue the pairs of edges $(F\_1A\_1,F\_2A\_2), (B\_1C\_1, B\_2C\_2)$. Now add edges $D\_1D\_2, E\_1E\_2$ and a $2$-cell $D\_1D\_2E\_2E\_1$. You obtain a cell decomposition with $g=0, n=3$ and $(f,e\_i,e\_b,v\_i,v\_b)=(3,4,8,0,8)$.


On the other hand you can cut out a small octagon $ABCDEFGH$ from a torus and draw two non intersecting edges $AD,EH$ along longitudes, as well as two edges $CF, BG$ along meridians. This produces three faces and gives $g=1, n=1$ with the same vector $(f,e\_i,e\_b,v\_i,v\_b)=(3,4,8,0,8)$.




---


If we are given the more refined data of all incidence relations between cells then there are multiple ways to count the number of boundary components. If one doesn't wish to chase the cycles formed by boundary edges, one can take a more algebraic approach. For example, if the matrix $M\in \mathbb R^{v\_b\times e\_b}$ records incidences between boundary vertices and boundary edges (each entry being $1$ when two cells are incident and $0$ otherwise) then the matrix $MM^{T}$ is equal to $2I+A$, where $I$ is the identity matrix and $A$ is the adjacency graph of the boundary graph. 


Since the number of connected components of a graph is given by the dimension of the nullspace of its Laplacian matrix, this means that the number of boundary components of our original complex is given by $\dim \text{null} (2I-A)=\dim \text{null} (4I-MM^{T})$.


