Former Arkansas Gov. Mike Huckabee fares best against President Obama in a test of several Republicans' strength nationally in 2012.

Huckabee and former Massachusetts Gov. Mitt Romney (R) have an early advantage on Obama, two years before voters head to the polls for the next presidential election, according to a CNN/Opinion Research poll released Thursday.

Fifty-two percent of registered voters would elect Huckabee over Obama if the 2012 election were held today, while 44 percent would choose Obama. Romney enjoys a 50-45 percent advantage over Obama.

Two other candidates tested against Obama — former Alaska Gov. Sarah Palin (R) and former House Speaker Newt Gingrich (R-Ga.) — fared less well.

Fifty-two percent of registered voters would choose Obama if he were running against Palin, who drew support from 44 percent. Obama would best Gingrich 49-47 percent.

The polls underscore the public's frustrations with Obama as expressed in Tuesday's elections, when a Republican wave helped the GOP retake the House and eat into Democrats' Senate majority. The party is now shifting, though, to 2012, the opportunity that presents Republicans' "only" real option to being able to advance their agenda, according to remarks on Thursday by Senate Minority Leader Mitch McConnell (R-Ky.).

Republican voters shift now to determining which candidate is most viable to take on Obama in 2012. The CNN poll suggested an early pecking order in the primary races over the next two years.

Twenty-one percent of Republicans said their choice would be Huckabee, followed by 20 percent who backed Romney, 14 percent who supported Palin, 12 percent who wanted Gingrich and 7 percent who preferred Rep. Ron Paul (Texas.). Mississippi Gov. Haley Barbour, Minnesota Gov. Tim Pawlenty and Rep. Mike Pence (Ind.) all checked in at 3 percent.

The poll, conducted Oct. 27-30, has a 3 percent margin of error for registered voters and a 4.5 percent margin of error among the subsample of Republicans.