Low-cost deadlock avoidance policies for flexible production systems