code: public static boolean isConstantMsg(int edge, FactorGraph fg) {
          BipartiteGraph<Var,Factor> bg = fg.getBipgraph();
          int numNbs = bg.isT1T2(edge) ? bg.numNbsT1(bg.parentE(edge)) : bg.numNbsT2(bg.parentE(edge)); 
          return numNbs == 1;
      }
docs: Returns true iff the edge corresponds to a message which is constant (i.e. sent from a leaf
  node).