Optimization of approximating networks for optimal fault diagnosis