Efficient Computation of the Max-Plus Semantics of Synchronous Dataflow Graphs