The Cetacea were thought to be most closely related to the Perissodactyla
or the odd-toed ungulates which include the horse, the tapir and the
rhinoceros (ungulate = approx. hoofed, plant-eating mammals, but more
accurately approximates to a group showing taxanomic and ecologic adaptions
to plant eating). However molecular immunodifusion, protien sequence and
cxytochrome b sequence results suggested a link with the Artiodacyla or
even-toed ungulates (pig, camal, hippo, deer, cow etc.).
In 1985-88, Eocene whales (archaeocetes) were found in which the skull and
dental structure was very like the mesonychid condylarths (primative
artiodactyls). In 1990 a late Middle Eocene whale was described with
complete (if vestigial) hindlimbs . The whale, _Basilosaurus_ has a
paraxonic arrangement of digits - where the digits symmetrically extend
about a plane between digits III and IV. This is very similar to the
condition in mesonychid condylarths and paraxonic artiodactylans.
Thus the fossil record confirms the inferences gained from molecular data
on the relationship between the cetaceans and the ungulates.
The nearest reletive to the whale is within the Artiodacyla and could be
any of a number of candidates - I have no more detailed information than
that (so it could be the pig), except that it could not be the camal - that
group does not have the paraxonic condition and was already established by
 Science (1990) 249, p.154-157