Esempio n. 1
0
 /**
  * Find the maximum number of faces in a graph.
  *
  * @param graph Graph to determine the number of faces for.
  * @return The maximum number of faces in the graph.
  */
 public int findFaces(DefaultGraph graph) {
   onRecursionStart(graph);
   int faces = findFaces(graph, -1, -1, -1, -1, 0, graph.getNumberOfEdges(), 0);
   afterRecursion();
   return faces;
 }
Esempio n. 2
0
 /**
  * Find the genus of a DefaultGraph.
  *
  * @param graph Graph to find the genus for.
  * @param faces Maximum number of faces.
  * @return The graph genus.
  */
 public int findGenus(DefaultGraph graph, int faces) {
   return 1 - (graph.getNumberOfVertices() + faces - graph.getNumberOfEdges() / 2) / 2;
 }