private boolean hasSequence(Subgraph graph){
  int oddDegreeCount=0;
  for (Iterator i=graph.nodeIterator(); i.hasNext(); ) {
    Node node=(Node)i.next();
    if (node.getDegree() % 2 == 1)     oddDegreeCount++;
  }
  return oddDegreeCount <= 2;
}

private boolean hasSequence ( Subgraph graph ) { int oddDegreeCount = 0 ; for ( Iterator i = graph . nodeIterator ( ) ; i . hasNext ( ) ; ) { Node node = ( Node ) i . next ( ) ; if ( node . getDegree ( ) % 2 == 1 ) oddDegreeCount ++ ; } return oddDegreeCount <= 2 ; }
tests whether a complete unique path exists in a graph using euler ' s theorem .
