Bilevel Optimization: Feasibility Test and Flexibility Index