Algebraic solution of Maxwell equations by means of finite formulation