Defined TaskGraph and GraphScheduler constructor.