Mining Significant Temporal Networks Is Polynomial