Optimal Routing and Scheduling by Maximum Gap Policies in Manufacturing Systems