The high cost of living in Washington, D.C., isn't preventing out-of-state college grads from setting up shop in the nation's capital.

"Washington, D.C., came up right at the top of the list as a city that attracted a lot of out of state grads," said Stephen Dash, CEO of Credible, which issued a report on which cities had more out-of-state graduates than in-state grads.

"The rent-to-income ratios are high, but the employment prospects are high, so we hypothesize that graduates are making a longer-term decision about their career growth."

Washington D.C.'s ratio of out-of-state to in-state grads was 2.2, the report found. The city's rent-to-income ratio is 19.9%. The median ratio of the 20 cities Credible analyzed, which included major hubs like New York City, Chicago, Los Angeles and San Francisco, was 18.5%.

Next on the list was Charlotte, N.C., with an out-of-state to in-state ratio of 2.17.

"People in Charlotte are attracted by a lower cost of living than some of the other cities we compared," Dash added.

Out-of-state graduates in Charlotte also held a median student loan debt of $42,650, compared to $58,143 in New York City and $77,530 in Philadelphia. Dash said the lower student debt levels make it easier to buy a home, instead of merely renting. "Charlotte is an affordable place to be a homeowner," he said.

As for Denver, which took the third spot on Credible's list, Dash points the city's relatively low rent-to-income ratio of 18%, compared to 20.77% in New York and 20.9% in Los Angeles.

"Denver is an up and coming technology hub," Dash noted. "Grads are attracted to a job market that is buoyant."

The fourth most appealing city for out-of-state graduates was Portland, Oregon, which holds an out-of-state to in-state ratio of 1.48. "Graduates of STEM type degrees - science, technology, engineering and math - are attracted to cities like Portland," Dash added.

Rounding out the top five on the list was Seattle, Wash., which also has a robust tech center. "The city is in the Pacific West Coast and from a climate, cultural and employment perspective, (the city is) very attractive for recent graduates," Dash said, adding that the employment market in the city has been buoyed by technology. Microsoft (MSFT) - Get Report and Amazon.com (AMZN) - Get Report are major local employers.