A New Algorithm for Computing Process Flexibility