That's all fine and good if OP's wife is performing "qualifying honorable service" on the vessel. From the way OP wrote their post, it sounds as though they simply want to travel with the vessel and use that time to count towards physical presence.
FYI, the N400 policy manual explains situations where certain cases of living overseas maybe acceptable but doesn't mention about ships, etc.
D. Preserving Residence for Naturalization (Form N-470)
Certain applicants[28] may seek to preserve their residence for an absence of 1 year or more to engage in qualifying employment abroad.[29] Such applicants must file an Application to Preserve Residence for Naturalization Purposes (Form N-470) in accordance with the form instructions.
In order to qualify, the following criteria must be met:
The applicant must have been physically present in the United States as an LPR for an uninterrupted period of at least 1 year prior to working abroad.
The application may be filed either before or after the applicant’s employment begins, but before the applicant has been abroad for a continuous period of 1 year.[30]
In addition, the applicant must have been:
Employed with or under contract with the U.S. government or an American institution of research[31] recognized as such by the Attorney General;
Employed by an American firm or corporation engaged in the development of U.S. foreign trade and commerce, or a subsidiary thereof if more than 50 percent of its stock is owned by an American firm or corporation; or
Employed by a public international organization of which the United States is a member by a treaty or statute and by which the applicant was not employed until after becoming an LPR.[32]