An index for operational flexibility in chemical process design. Part II: Computational algorithms