public int numVariables ( ) { int maxVar = 0 ; for ( Factor f : factors ) { for ( int n : f . neigborIndices ) { if ( n > maxVar ) maxVar = n ; } } return maxVar + 1 ; }
The number of variables in this graphical model .