Safe optimization of potentially runaway processes using topology based tools and software