  Classical knot theory can be generalized to virtual knot theory and spatial
graph theory. In 2007, Fleming and Mellor combined virtual knot theory and
spatial graph theory to form, combinatorially, virtual spatial graph theory. In
this paper, we introduce a topological definition of virtual spatial graphs
that is similar to the topological definition of a virtual link. Our main goal
is to generalize the classical Yamada polynomial that is defined for a spatial
graph. We define a generalized Yamada polynomial for a virtual spatial graph
and prove that it can be normalized to a rigid vertex isotopic invariant and to
a pliable vertex isotopic invariant for graphs with maximum degree at most 3.
We consider the connection and difference between the generalized Yamada
polynomial and the Dubrovnik polynomial of a classical link. The generalized
Yamada polynomial specializes to a version of the Dubrovnik polynomial for
virtual links such that it can be used to detect the non-classicality of some
virtual links. We obtain a specialization for the generalized Yamada polynomial
(via the Jones-Wenzl projector $P_2$ acting on a virtual spatial graph
diagram), that can be used to write a program for calculating it based on
Mathematica Code.
