A 2-variable polynomial invariant for a virtual link derived from magnetic graphs