fix a performance bug: DUGraph.pred