Minimization Formulation for Neural Network Based Solution of Maxwell’s Equations in Frequency Domain